+
+The LabAPI project is **[SCP: Secret Laboratory](https://store.steampowered.com/app/700330/SCP_Secret_Laboratory/)**'s official server-side plugin loader and framework. It facilitates development of plugins by providing wrappers and events around various game mechanics found throughout the game.
+
+## Documentation
+Code should have self-explanatory documentation, but there's only so much you can explain through comments!
+- For guides, tips and tricks, our main source of documentation can be found [here](https://github.com/northwood-studios/LabAPI/wiki).
+- For a more practical approach, examples can be found [here](https://github.com/northwood-studios/LabAPI/tree/master/LabApi.Examples).
+
+## Installation
+All **SCP: SL Dedicated Server** builds are bundled with a compiled **`LabAPI.dll`**, so you don't need to install it if you are hosting a server.
+
+However, [releases](https://github.com/northwood-studios/LabAPI/releases) may occasionally occur *before* the dedicated server is updated, while we advice you wait for an official update, you can always apply the updated release manually.
+
+To do so, you should update the **`LabAPI.dll`** file located within: `%DEDICATED_SERVER_PATH%/SCPSL_Data/Managed/`.
\ No newline at end of file
diff --git a/.gitlab/issue_templates/New Bug.md b/.gitlab/issue_templates/New Bug.md
new file mode 100644
index 00000000..a1b4ffcd
--- /dev/null
+++ b/.gitlab/issue_templates/New Bug.md
@@ -0,0 +1,34 @@
+> **New Issue Guidelines:** (For you! The writer :writing_hand: )
+> - Make sure to only choose one priority level, the bottom of this template has all labels you'll need. Delete the ones you don't need!
+> - Mention the affected system in this issue's title. Something like `[RA] Using X throws an exception` or `[Intercom] Talking blows your computer up`.
+> - In some cases, remember to verify with the team in charge of this kind of feature. (Examples: Art, Programming, Game Design)
+
+> **Choose one task priority level:** *(You can delete this line as well)*
+/label ~"P1 - Critical"
+/label ~"P2 - Priority Issue"
+/label ~"P3 - Regular Priority"
+/label ~"P4 - Low Priority"
+
+## Description
+> A description about what the issue / bug is. How it affects players. And finally, how it's supposed to function.
+
+## Replication Steps & Requirements
+
+### Requirements:
+- Have 2 or more players online, they'll be called Hubert & You. (Example)
+- Before entering the game, change your Graphic Settings to **Low**. (Example)
+
+### Replication Steps:
+- You must join the server first, without Hubert in it.
+- Hubert must then join after you.
+- When Hubert spawns, he will appear as a giant pink-textured role.
+
+## Attachments
+> Any sort of video, image, client/server logs, just proof of the reported issue. For example:
+- Related issues: #244 #123 #21 #50
+- Replication video: https://www.youtube.com/watch?v=2Q_ZzBGPdqE
+
+/label ~bug
+/label ~todo
+
+/cc @jesusqc
\ No newline at end of file
diff --git a/.gitlab/issue_templates/New Idea.md b/.gitlab/issue_templates/New Idea.md
new file mode 100644
index 00000000..dc6854b1
--- /dev/null
+++ b/.gitlab/issue_templates/New Idea.md
@@ -0,0 +1,18 @@
+> **New Issue Guidelines:** (For you! The writer :writing_hand: )
+> - Mention the affected system in this issue's title. Something like `[RA] Custom Menus Idea` or `[Map] New Map Generation Algorithm Ideas`.
+
+## Description
+> A description of what you would like to see implemented, and perhaps how. Can be as vague and informal as you want. However, being descriptive is always appreciated. 😉
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+
+## Notes
+> These should serve as a guide of different ideas or concerns you may have regarding task, providing some insight of your vision to the programmer that may work on it.
+- Example1.
+- Example2.
+
+# Status
+- [ ] **Approved for implementation by LabAPI's Management.**
+
+/label ~experimental
+/confidential
\ No newline at end of file
diff --git a/.gitlab/issue_templates/New Task - Docless.md b/.gitlab/issue_templates/New Task - Docless.md
new file mode 100644
index 00000000..55f021e0
--- /dev/null
+++ b/.gitlab/issue_templates/New Task - Docless.md
@@ -0,0 +1,17 @@
+/label ~"P1 - Critical"
+/label ~"P2 - Priority Issue"
+/label ~"P3 - Regular Priority"
+/label ~"P4 - Low Priority"
+
+## Description
+
+
+## Task Expectations/Check-list
+- [ ]
+
+## Assets
+- Design Document:
+
+/label ~"Task / Bounty"
+/label ~todo
+/confidential
\ No newline at end of file
diff --git a/.gitlab/issue_templates/New Task.md b/.gitlab/issue_templates/New Task.md
new file mode 100644
index 00000000..18ac27d6
--- /dev/null
+++ b/.gitlab/issue_templates/New Task.md
@@ -0,0 +1,27 @@
+> **New Issue Guidelines:** (For you! The writer :writing_hand: )
+> - Make sure to only choose one priority level, the bottom of this template has all labels you'll need. Delete the ones you don't need!
+> - Mention the affected system in this issue's title. Something like `[RA] Using X throws an exception` or `[Intercom] Talking blows your computer up`.
+
+> **Choose one task priority level:** *(You can delete this line as well)*
+/label ~"P1 - Critical"
+/label ~"P2 - Priority Issue"
+/label ~"P3 - Regular Priority"
+/label ~"P4 - Low Priority"
+
+## Description
+> A description about what the task is and possibly an idea of how to implement if possible.
+
+## Task Expectations/Check-list
+> **As always,** read the design document before starting work on it (if one was attached), the check-list below is merely done to help assignees follow some steps and not get lost. :smile:
+- [ ] Text.
+- [ ] Text2.
+- [ ] Text3.
+
+## Assets
+> Any assets that the assignee will need to complete this task / implement this feature. Make sure to include the **Design Document** here.
+- Asset1.
+- Asset2.
+
+/label ~"Task / Bounty"
+/label ~todo
+/confidential
\ No newline at end of file
diff --git a/.gitlab/merge_request_templates/MR Template - Docless.md b/.gitlab/merge_request_templates/MR Template - Docless.md
new file mode 100644
index 00000000..3de19d68
--- /dev/null
+++ b/.gitlab/merge_request_templates/MR Template - Docless.md
@@ -0,0 +1,20 @@
+## Changes
+
+### Changelog
+```yml
+-
+```
+
+## Relevant Issues / Tasks
+
+Resolves #X
+
+## Notes (Optional)
+
+
+
+# **Status**
+- [ ] **Approved by QA.**
+
+/ready
+/done
\ No newline at end of file
diff --git a/.gitlab/merge_request_templates/MR Template.md b/.gitlab/merge_request_templates/MR Template.md
new file mode 100644
index 00000000..a75c866a
--- /dev/null
+++ b/.gitlab/merge_request_templates/MR Template.md
@@ -0,0 +1,22 @@
+## Changes
+
+### Changelog
+> These should stay technical, you don't have to mention exactly what you did step-by-step, but providing something for other programmers to check on later is preferred. Studio Staff in charge of public announcements will use this changelog to create a simplified version of it.
+```yml
+- Text
+```
+
+## Relevant Issues / Tasks (Optional)
+
+> Replace the `X` with the issue ID you wish to automatically close when this is merged.
+Resolves #X
+
+## Notes (Optional)
+
+> Write down any additional related notes programmers or the current lead programmer should be aware of regarding this merge request.
+
+# **Status**
+- [ ] **Approved by QA.**
+
+/ready
+/done
\ No newline at end of file
diff --git a/LabApi.Examples/LogAll/LogPlugin/LogPlugin.csproj b/LabApi.Examples/LogAll/LogPlugin/LogPlugin.csproj
index 2fd62420..d546ec6e 100644
--- a/LabApi.Examples/LogAll/LogPlugin/LogPlugin.csproj
+++ b/LabApi.Examples/LogAll/LogPlugin/LogPlugin.csproj
@@ -15,6 +15,7 @@
+
diff --git a/LabApi.Examples/LogAll/LogPlugin/MyCustomEventsHandler.cs b/LabApi.Examples/LogAll/LogPlugin/MyCustomEventsHandler.cs
index 69fac15b..8c00e2d3 100644
--- a/LabApi.Examples/LogAll/LogPlugin/MyCustomEventsHandler.cs
+++ b/LabApi.Examples/LogAll/LogPlugin/MyCustomEventsHandler.cs
@@ -1,13 +1,17 @@
using System.Linq;
+using LabApi.Events.Arguments.ObjectiveEvents;
using LabApi.Events.Arguments.PlayerEvents;
using LabApi.Events.Arguments.Scp0492Events;
using LabApi.Events.Arguments.Scp049Events;
using LabApi.Events.Arguments.Scp079Events;
using LabApi.Events.Arguments.Scp096Events;
using LabApi.Events.Arguments.Scp106Events;
+using LabApi.Events.Arguments.Scp127Events;
using LabApi.Events.Arguments.Scp173Events;
+using LabApi.Events.Arguments.Scp3114Events;
using LabApi.Events.Arguments.Scp914Events;
using LabApi.Events.Arguments.Scp939Events;
+using LabApi.Events.Arguments.ScpEvents;
using LabApi.Events.Arguments.ServerEvents;
using LabApi.Events.Arguments.WarheadEvents;
using LabApi.Events.CustomHandlers;
@@ -26,7 +30,7 @@ public override void OnPlayerActivatedGenerator(PlayerActivatedGeneratorEventArg
{
Logger.Info($"{nameof(OnPlayerActivatedGenerator)} triggered by {ev.Player.UserId}");
}
-
+
public override void OnPlayerUnlockingGenerator(PlayerUnlockingGeneratorEventArgs ev)
{
Logger.Info($"{nameof(OnPlayerUnlockingGenerator)} triggered by {ev.Player.UserId}");
@@ -36,7 +40,7 @@ public override void OnPlayerUnlockedGenerator(PlayerUnlockedGeneratorEventArgs
{
Logger.Info($"{nameof(OnPlayerUnlockedGenerator)} triggered by {ev.Player.UserId}");
}
-
+
public override void OnPlayerUnlockingWarheadButton(PlayerUnlockingWarheadButtonEventArgs ev)
{
Logger.Info($"{nameof(OnPlayerUnlockingWarheadButton)} triggered by {ev.Player.UserId}");
@@ -97,6 +101,16 @@ public override void OnPlayerChangedNickname(PlayerChangedNicknameEventArgs ev)
Logger.Info($"{nameof(OnPlayerChangedNickname)} triggered by {ev.Player.UserId}");
}
+ public override void OnPlayerChangingBadgeVisibility(PlayerChangingBadgeVisibilityEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerChangingBadgeVisibility)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerChangedBadgeVisibility(PlayerChangedBadgeVisibilityEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerChangedBadgeVisibility)} triggered by {ev.Player.UserId}");
+ }
+
public override void OnPlayerChangingRadioRange(PlayerChangingRadioRangeEventArgs ev)
{
Logger.Info($"{nameof(OnPlayerChangingRadioRange)} triggered by {ev.Player.UserId}");
@@ -457,6 +471,16 @@ public override void OnPlayerPreAuthenticated(PlayerPreAuthenticatedEventArgs ev
Logger.Info($"{nameof(OnPlayerPreAuthenticated)} triggered by {ev.UserId}");
}
+ public override void OnPlayerProcessingJailbirdMessage(PlayerProcessingJailbirdMessageEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerProcessingJailbirdMessage)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerProcessedJailbirdMessage(PlayerProcessedJailbirdMessageEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerProcessedJailbirdMessage)} triggered by {ev.Player.UserId}");
+ }
+
public override void OnPlayerUpdatingEffect(PlayerEffectUpdatingEventArgs ev)
{
Logger.Info($"{nameof(OnPlayerUpdatingEffect)} triggered by {ev.Player.UserId}");
@@ -467,6 +491,56 @@ public override void OnPlayerUpdatedEffect(PlayerEffectUpdatedEventArgs ev)
Logger.Info($"{nameof(OnPlayerUpdatedEffect)} triggered by {ev.Player.UserId}");
}
+ public override void OnPlayerRaPlayerListAddedPlayer(PlayerRaPlayerListAddedPlayerEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerRaPlayerListAddedPlayer)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerRaPlayerListAddingPlayer(PlayerRaPlayerListAddingPlayerEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerRaPlayerListAddingPlayer)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerReceivedAchievement(PlayerReceivedAchievementEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerReceivedAchievement)} triggered by {ev.Player?.UserId ?? "unknown"}");
+ }
+
+ public override void OnPlayerRequestedCustomRaInfo(PlayerRequestedCustomRaInfoEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerRequestedCustomRaInfo)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerRequestedRaPlayerInfo(PlayerRequestedRaPlayerInfoEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerRequestedRaPlayerInfo)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerRequestedRaPlayerList(PlayerRequestedRaPlayerListEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerRequestedRaPlayerList)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerRequestedRaPlayersInfo(PlayerRequestedRaPlayersInfoEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerRequestedRaPlayersInfo)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerRequestingRaPlayerInfo(PlayerRequestingRaPlayerInfoEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerRequestingRaPlayerInfo)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerRequestingRaPlayerList(PlayerRequestingRaPlayerListEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerRequestingRaPlayerList)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerRequestingRaPlayersInfo(PlayerRequestingRaPlayersInfoEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerRequestingRaPlayersInfo)} triggered by {ev.Player.UserId}");
+ }
+
//public override void OnPlayerReceivingVoiceMessage(PlayerReceivingVoiceMessageEventArgs ev)
//{
// Logger.Info($"{nameof(OnPlayerReceivingVoiceMessage)} triggered by {ev.Player.UserId}");
@@ -702,6 +776,11 @@ public override void OnPlayerUsedItem(PlayerUsedItemEventArgs ev)
Logger.Info($"{nameof(OnPlayerUsedItem)} triggered by {ev.Player.UserId}");
}
+ public override void OnPlayerItemUsageEffectsApplying(PlayerItemUsageEffectsApplyingEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerItemUsageEffectsApplying)} triggered by {ev.Player.UserId}");
+ }
+
public override void OnPlayerTogglingNoclip(PlayerTogglingNoclipEventArgs ev)
{
Logger.Info($"{nameof(OnPlayerTogglingNoclip)} triggered by {ev.Player.UserId}");
@@ -737,6 +816,26 @@ public override void OnPlayerLeftHazard(PlayerLeftHazardEventArgs ev)
Logger.Info($"{nameof(OnPlayerLeftHazard)} triggered by {ev.Player.UserId}");
}
+ public override void OnScp049Attacking(Scp049AttackingEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp049Attacking)} triggered by {ev.Player} {ev.Target} {ev.InstantKill} {ev.IsSenseTarget} {ev.CooldownTime}");
+ }
+
+ public override void OnScp049Attacked(Scp049AttackedEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp049Attacked)} triggered by {ev.Player} {ev.Target} {ev.InstantKill} {ev.IsSenseTarget}");
+ }
+
+ public override void OnScp049SenseKilledTarget(Scp049SenseKilledTargetEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp049SenseKilledTarget)} triggered by {ev.Player} {ev.Target}");
+ }
+
+ public override void OnScp049SenseLostTarget(Scp049SenseLostTargetEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp049SenseLostTarget)} triggered by {ev.Player} {ev.Target}");
+ }
+
public override void OnScp049StartingResurrection(Scp049StartingResurrectionEventArgs ev)
{
Logger.Info($"{nameof(OnScp049StartingResurrection)} triggered by {ev.Player.UserId}");
@@ -1072,6 +1171,36 @@ public override void OnScp173PlayedSound(Scp173PlayedSoundEventArgs ev)
Logger.Info($"{nameof(OnScp173PlayedSound)} triggered by {ev.Player.UserId}");
}
+ public override void OnScp173Snapped(Scp173SnappedEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp173Snapped)} triggered by {ev.Player.UserId} targeting {ev.Target.UserId}");
+ }
+
+ public override void OnScp173Snapping(Scp173SnappingEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp173Snapping)} triggered by {ev.Player.UserId} targeting {ev.Target.UserId}");
+ }
+
+ public override void OnScp3114StrangleAborting(Scp3114StrangleAbortingEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp3114StrangleAborting)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnScp3114StrangleAborted(Scp3114StrangleAbortedEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp3114StrangleAborted)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnScp3114StrangleStarting(Scp3114StrangleStartingEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp3114StrangleStarting)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnScp3114StrangleStarted(Scp3114StrangleStartedEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp3114StrangleStarted)} triggered by {ev.Player.UserId}");
+ }
+
public override void OnScp914Activating(Scp914ActivatingEventArgs ev)
{
Logger.Info($"{nameof(OnScp914Activating)} triggered by {ev.Player.UserId}");
@@ -1311,7 +1440,7 @@ public override void OnServerCassieQueuingScpTermination(CassieQueuingScpTermina
{
Logger.Info($"{nameof(OnServerCassieQueuingScpTermination)} triggered");
}
-
+
public override void OnServerCassieQueuedScpTermination(CassieQueuedScpTerminationEventArgs ev)
{
Logger.Info($"{nameof(OnServerCassieQueuedScpTermination)} triggered");
@@ -1376,8 +1505,282 @@ public override void OnWarheadDetonated(WarheadDetonatedEventArgs ev)
{
Logger.Info($"{nameof(OnWarheadDetonated)} triggered by {ev.Player.UserId}");
}
+
+ public override void OnObjectiveCompleting(ObjectiveCompletingBaseEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnObjectiveCompleting)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnObjectiveCompleted(ObjectiveCompletedBaseEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnObjectiveCompleted)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnObjectiveActivatedGeneratorCompleted(GeneratorActivatedObjectiveEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnObjectiveActivatedGeneratorCompleted)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnObjectiveActivatingGeneratorCompleting(GeneratorActivatingObjectiveEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnObjectiveActivatingGeneratorCompleting)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnObjectiveDamagedScpCompleted(ScpDamagedObjectiveEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnObjectiveDamagedScpCompleted)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnObjectiveDamagingScpCompleting(ScpDamagingObjectiveEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnObjectiveDamagingScpCompleting)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnObjectiveEscapingCompleting(EscapingObjectiveEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnObjectiveEscapingCompleting)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnObjectiveEscapedCompleted(EscapedObjectiveEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnObjectiveEscapedCompleted)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnObjectiveKillingEnemyCompleting(EnemyKillingObjectiveEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnObjectiveKillingEnemyCompleting)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnObjectiveKilledEnemyCompleted(EnemyKilledObjectiveEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnObjectiveKilledEnemyCompleted)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnObjectivePickingScpItemCompleting(ScpItemPickingObjectiveEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnObjectivePickingScpItemCompleting)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnObjectivePickedScpItemCompleted(ScpItemPickedObjectiveEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnObjectivePickedScpItemCompleted)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerJumped(PlayerJumpedEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerJumped)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerMovementStateChanged(PlayerMovementStateChangedEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerMovementStateChanged)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerChangingAttachments(PlayerChangingAttachmentsEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerChangingAttachments)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerChangedAttachments(PlayerChangedAttachmentsEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerChangedAttachments)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerSendingAttachmentsPrefs(PlayerSendingAttachmentsPrefsEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerSendingAttachmentsPrefs)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerSentAttachmentsPrefs(PlayerSentAttachmentsPrefsEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerSentAttachmentsPrefs)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnServerElevatorSequenceChanged(ElevatorSequenceChangedEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnServerElevatorSequenceChanged)} triggered");
+ }
+
+ public override void OnPlayerInteractingWarheadLever(PlayerInteractingWarheadLeverEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerInteractingWarheadLever)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerInteractedWarheadLever(PlayerInteractedWarheadLeverEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerInteractedWarheadLever)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnScp3114Disguising(Scp3114DisguisingEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp3114Disguising)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnScp3114Disguised(Scp3114DisguisedEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp3114Disguised)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnScp3114Revealing(Scp3114RevealingEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp3114Revealing)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnScp3114Revealed(Scp3114RevealedEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp3114Revealed)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnScp3114StartDancing(Scp3114StartingDanceEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp3114StartDancing)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnScp3114Dance(Scp3114StartedDanceEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp3114Dance)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerToggledDisruptorFiringMode(PlayerToggledDisruptorFiringModeEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerToggledDisruptorFiringMode)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerSpinningRevolver(PlayerSpinningRevolverEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerSpinningRevolver)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnPlayerSpinnedRevolver(PlayerSpinnedRevolverEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerSpinnedRevolver)} triggered by {ev.Player.UserId}");
+ }
+
+ public override void OnScp127GainingExperience(Scp127GainingExperienceEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp127GainingExperience)} triggered by {ev.Scp127Item.CurrentOwner}");
+ }
+
+ public override void OnScp127GainExperience(Scp127GainExperienceEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp127GainExperience)} triggered by {ev.Scp127Item.CurrentOwner}");
+ }
+
+ public override void OnScp127LevellingUp(Scp127LevellingUpEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp127LevellingUp)} triggered by {ev.Scp127Item.CurrentOwner}");
+ }
+
+ public override void OnScp127LevelUp(Scp127LevelUpEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp127LevelUp)} triggered by {ev.Scp127Item.CurrentOwner}");
+ }
+
+ public override void OnScp127Talking(Scp127TalkingEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp127Talking)} triggered by {ev.Scp127Item.CurrentOwner}");
+ }
+
+ public override void OnScp127Talked(Scp127TalkedEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScp127Talked)} triggered by {ev.Scp127Item.CurrentOwner}");
+ }
-
+ public override void OnPlayerCheckedHitmarker(PlayerCheckedHitmarkerEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerCheckedHitmarker)} triggered by {ev.Player} {ev.Victim} {ev.Result}");
+ }
+
+ public override void OnPlayerSentHitmarker(PlayerSentHitmarkerEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerSentHitmarker)} triggered by {ev.Player} {ev.Size} {ev.PlayedAudio}");
+ }
+
+ public override void OnPlayerSendingHitmarker(PlayerSendingHitmarkerEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnPlayerSendingHitmarker)} triggered by {ev.Player} {ev.Size} {ev.PlayAudio}");
+ }
+
+ public override void OnScpHumeShieldBroken(ScpHumeShieldBrokenEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnScpHumeShieldBroken)} triggered by {ev.Player}");
+ }
+
+ public override void OnServerAchievedMilestone(AchievedMilestoneEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnServerAchievedMilestone)} triggered by {ev.Faction} {ev.Threshold} {ev.MilestoneIndex}");
+ }
+
+ public override void OnServerAchievingMilestone(AchievingMilestoneEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnServerAchievingMilestone)} triggered by {ev.Faction} {ev.Threshold} {ev.MilestoneIndex}");
+ }
+
+ public override void OnServerModifiedFactionInfluence(ModifiedFactionInfluenceEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnServerModifiedFactionInfluence)} triggered by {ev.Faction} {ev.Influence}");
+ }
+
+ public override void OnServerModifyingFactionInfluence(ModifyingFactionInfluenceEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnServerModifyingFactionInfluence)} triggered by {ev.Faction} {ev.Influence}");
+ }
+
+ public override void OnServerBlastDoorChanged(BlastDoorChangedEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnServerBlastDoorChanged)} triggered by {ev.BlastDoor} {ev.NewState}");
+ }
+
+ public override void OnServerBlastDoorChanging(BlastDoorChangingEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnServerBlastDoorChanging)} triggered by {ev.BlastDoor} {ev.NewState}");
+ }
+
+ public override void OnServerDoorDamaged(DoorDamagedEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnServerDoorDamaged)} triggered by {ev.Door} {ev.Damage} {ev.DamageType}");
+ }
+
+ public override void OnServerDoorDamaging(DoorDamagingEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnServerDoorDamaging)} triggered by {ev.Door} {ev.Damage} {ev.DamageType}");
+ }
+
+ public override void OnServerDoorLockChanged(DoorLockChangedEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnServerDoorLockChanged)} triggered by {ev.Door} {ev.PrevLockReason} => {ev.LockReason}");
+ }
+
+ public override void OnServerDoorRepaired(DoorRepairedEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnServerDoorRepaired)} triggered by {ev.Door} {ev.RemainingHealth}");
+ }
+
+ public override void OnServerDoorRepairing(DoorRepairingEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnServerDoorRepairing)} triggered by {ev.Door} {ev.RemainingHealth}");
+ }
+
+ public override void OnServerCheckpointDoorSequenceChanged(CheckpointDoorSequenceChangedEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnServerCheckpointDoorSequenceChanged)} triggered by {ev.CheckpointDoor} {ev.CurrentSequence}");
+ }
+
+ public override void OnServerCheckpointDoorSequenceChanging(CheckpointDoorSequenceChangingEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnServerCheckpointDoorSequenceChanging)} triggered by {ev.CheckpointDoor} {ev.CurrentSequence} {ev.NewSequence}");
+ }
+
+ public override void OnServerRoomColorChanged(RoomColorChangedEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnServerRoomColorChanged)} triggered by {ev.Room} {ev.NewState}");
+ }
+
+ public override void OnServerRoomLightChanged(RoomLightChangedEventArgs ev)
+ {
+ Logger.Info($"{nameof(OnServerRoomLightChanged)} triggered by {ev.Room} {ev.NewState}");
+ }
+
#region Excluded Events
// The following events spam the console and are therefore excluded from this example:
diff --git a/LabApi.sln b/LabApi.sln
index 264f4e50..208d8a88 100644
--- a/LabApi.sln
+++ b/LabApi.sln
@@ -25,7 +25,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Commands", "Commands", "{3B
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandsPlugin", "LabApi.Examples\Commands\CommandsPlugin\CommandsPlugin.csproj", "{DFDB27D3-70C9-44A6-B2D3-6D8D0716D6FC}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandsPlugin2", "LabApi.Examples\Commands\CommandsPlugin2\CommandsPlugin2.csproj", "{295205EA-B4A2-42CF-8B91-7F9BF6909694}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandsPlugin2", "LabApi.Examples\Commands\CommandsPlugin2\CommandsPlugin2.csproj", "{295205EA-B4A2-42CF-8B91-7F9BF6909694}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9FDD2A60-56E4-4E77-9E87-B62F3BF06CC8}"
+ ProjectSection(SolutionItems) = preProject
+ StyleCopAnalyzers.ruleset = StyleCopAnalyzers.ruleset
+ EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/LabApi/Events/Arguments/Interfaces/Hazards/IHazardEvent.cs b/LabApi/Events/Arguments/Interfaces/Hazards/IHazardEvent.cs
index 159767d3..b77c4717 100644
--- a/LabApi/Events/Arguments/Interfaces/Hazards/IHazardEvent.cs
+++ b/LabApi/Events/Arguments/Interfaces/Hazards/IHazardEvent.cs
@@ -12,4 +12,3 @@ public interface IHazardEvent
///
public Hazard? Hazard { get; }
}
-
diff --git a/LabApi/Events/Arguments/Interfaces/IGroupEvent.cs b/LabApi/Events/Arguments/Interfaces/IGroupEvent.cs
index 0f1d3f9c..06164ad9 100644
--- a/LabApi/Events/Arguments/Interfaces/IGroupEvent.cs
+++ b/LabApi/Events/Arguments/Interfaces/IGroupEvent.cs
@@ -1,4 +1,5 @@
namespace LabApi.Events.Arguments.Interfaces;
+
///
/// Represents an event that involves a .
///
diff --git a/LabApi/Events/Arguments/Interfaces/IObjectiveEvent.cs b/LabApi/Events/Arguments/Interfaces/IObjectiveEvent.cs
new file mode 100644
index 00000000..2bec4f79
--- /dev/null
+++ b/LabApi/Events/Arguments/Interfaces/IObjectiveEvent.cs
@@ -0,0 +1,39 @@
+using LabApi.Features.Wrappers;
+using PlayerRoles;
+using Respawning.Objectives;
+
+namespace LabApi.Events.Arguments.Interfaces;
+
+///
+/// Represents an event that involves .
+///
+public interface IObjectiveEvent
+{
+ ///
+ /// Gets the player who triggered the objective completion.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the which will receive the and rewards.
+ ///
+ public Faction Faction { get; }
+
+ ///
+ /// Gets the amount of influence to grant to the .
+ ///
+ public float InfluenceToGrant { get; }
+
+ ///
+ /// Gets the amount of time to be reduced from the 's timer.
+ ///
+ ///
+ /// Negative values reduce the timer, positive extends it.
+ ///
+ public float TimeToGrant { get; }
+
+ ///
+ /// Gets whether the objective completion should be sent to players and visible on their screen.
+ ///
+ public bool SendToPlayers { get; }
+}
diff --git a/LabApi/Events/Arguments/Interfaces/Items/Firearms/IRevolverItemEvent.cs b/LabApi/Events/Arguments/Interfaces/Items/Firearms/IRevolverItemEvent.cs
new file mode 100644
index 00000000..24d0777a
--- /dev/null
+++ b/LabApi/Events/Arguments/Interfaces/Items/Firearms/IRevolverItemEvent.cs
@@ -0,0 +1,17 @@
+using LabApi.Features.Wrappers;
+
+namespace LabApi.Events.Arguments.Interfaces;
+
+///
+/// Represents an event that involves a revolver.
+///
+public interface IRevolverItemEvent : IItemEvent
+{
+ ///
+ Item? IItemEvent.Item => Revolver;
+
+ ///
+ /// The revolver that is involved in the event.
+ ///
+ public RevolverFirearm? Revolver { get; }
+}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/Interfaces/Items/Firearms/IScp127ItemEvent.cs b/LabApi/Events/Arguments/Interfaces/Items/Firearms/IScp127ItemEvent.cs
new file mode 100644
index 00000000..dd8652d7
--- /dev/null
+++ b/LabApi/Events/Arguments/Interfaces/Items/Firearms/IScp127ItemEvent.cs
@@ -0,0 +1,17 @@
+using LabApi.Features.Wrappers;
+
+namespace LabApi.Events.Arguments.Interfaces;
+
+///
+/// Represents an event that involves SCP-127.
+///
+public interface IScp127ItemEvent : IItemEvent
+{
+ ///
+ Item? IItemEvent.Item => Scp127Item;
+
+ ///
+ /// The SCP-127 item that is involved in the event.
+ ///
+ public Scp127Firearm? Scp127Item { get; }
+}
diff --git a/LabApi/Events/Arguments/Interfaces/Items/IJailbirdEvent.cs b/LabApi/Events/Arguments/Interfaces/Items/IJailbirdEvent.cs
new file mode 100644
index 00000000..8684233c
--- /dev/null
+++ b/LabApi/Events/Arguments/Interfaces/Items/IJailbirdEvent.cs
@@ -0,0 +1,17 @@
+using LabApi.Features.Wrappers;
+
+namespace LabApi.Events.Arguments.Interfaces.Items;
+
+///
+/// Represents an event that involves a jailbird item.
+///
+public interface IJailbirdEvent : IItemEvent
+{
+ ///
+ Item? IItemEvent.Item => JailbirdItem;
+
+ ///
+ /// The jailbird item that is involved in the event.
+ ///
+ public JailbirdItem? JailbirdItem { get; }
+}
diff --git a/LabApi/Events/Arguments/Interfaces/Items/IKeycardItemEvent.cs b/LabApi/Events/Arguments/Interfaces/Items/IKeycardItemEvent.cs
new file mode 100644
index 00000000..2d3ebaae
--- /dev/null
+++ b/LabApi/Events/Arguments/Interfaces/Items/IKeycardItemEvent.cs
@@ -0,0 +1,17 @@
+using LabApi.Features.Wrappers;
+
+namespace LabApi.Events.Arguments.Interfaces;
+
+///
+/// Represents an event that involves a keycard item.
+///
+public interface IKeycardItemEvent : IItemEvent
+{
+ ///
+ Item? IItemEvent.Item => KeycardItem;
+
+ ///
+ /// The keycard item that is involved in the event.
+ ///
+ public KeycardItem KeycardItem { get; }
+}
diff --git a/LabApi/Events/Arguments/ObjectiveEvents/EnemyKilledObjectiveEventArgs.cs b/LabApi/Events/Arguments/ObjectiveEvents/EnemyKilledObjectiveEventArgs.cs
new file mode 100644
index 00000000..c69a4071
--- /dev/null
+++ b/LabApi/Events/Arguments/ObjectiveEvents/EnemyKilledObjectiveEventArgs.cs
@@ -0,0 +1,30 @@
+using LabApi.Features.Wrappers;
+using PlayerRoles;
+
+namespace LabApi.Events.Arguments.ObjectiveEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class EnemyKilledObjectiveEventArgs : ObjectiveCompletedBaseEventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player hub who triggered the objective.
+ /// The Faction to grant the influence to.
+ /// The influence points to grant to the .
+ /// The time to reduce from the .
+ /// Whether the objective completion has been sent to players.
+ /// The player that has been killed.
+ public EnemyKilledObjectiveEventArgs(ReferenceHub hub, Faction faction, float influenceToGrant, float timeToGrant, bool sendToPlayers, ReferenceHub targetHub)
+ : base(hub, faction, influenceToGrant, timeToGrant, sendToPlayers)
+ {
+ Target = Player.Get(targetHub);
+ }
+
+ ///
+ /// Gets the player that has been killed.
+ ///
+ public Player Target { get; }
+}
diff --git a/LabApi/Events/Arguments/ObjectiveEvents/EnemyKillingObjectiveEventArgs.cs b/LabApi/Events/Arguments/ObjectiveEvents/EnemyKillingObjectiveEventArgs.cs
new file mode 100644
index 00000000..d1b636ca
--- /dev/null
+++ b/LabApi/Events/Arguments/ObjectiveEvents/EnemyKillingObjectiveEventArgs.cs
@@ -0,0 +1,30 @@
+using LabApi.Features.Wrappers;
+using PlayerRoles;
+
+namespace LabApi.Events.Arguments.ObjectiveEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class EnemyKillingObjectiveEventArgs : ObjectiveCompletingBaseEventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player hub who triggered the objective.
+ /// The Faction to grant the influence to.
+ /// The influence points to grant to the .
+ /// The time to reduce from the .
+ /// The player that has been killed.
+ /// Whether the objective completion will be sent to players.
+ public EnemyKillingObjectiveEventArgs(ReferenceHub hub, Faction faction, float influenceToGrant, float timeToGrant, ReferenceHub targetHub, bool sendToPlayers)
+ : base(hub, faction, influenceToGrant, timeToGrant, sendToPlayers)
+ {
+ Target = Player.Get(targetHub);
+ }
+
+ ///
+ /// Gets the player that has been killed.
+ ///
+ public Player Target { get; }
+}
diff --git a/LabApi/Events/Arguments/ObjectiveEvents/EscapedObjectiveEventArgs.cs b/LabApi/Events/Arguments/ObjectiveEvents/EscapedObjectiveEventArgs.cs
new file mode 100644
index 00000000..09deb136
--- /dev/null
+++ b/LabApi/Events/Arguments/ObjectiveEvents/EscapedObjectiveEventArgs.cs
@@ -0,0 +1,36 @@
+using PlayerRoles;
+
+namespace LabApi.Events.Arguments.ObjectiveEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class EscapedObjectiveEventArgs : ObjectiveCompletedBaseEventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player hub who triggered the objective.
+ /// The Faction to grant the influence to.
+ /// The influence points to grant to the .
+ /// The time to reduce from the .
+ /// The new role the player gets after escaping.
+ /// Whether the objective completion has been sent to players.
+ /// The old role of the player.
+ public EscapedObjectiveEventArgs(ReferenceHub hub, Faction faction, float influenceToGrant, float timeToGrant, bool sendToPlayers, RoleTypeId oldRole, RoleTypeId newRole)
+ : base(hub, faction, influenceToGrant, timeToGrant, sendToPlayers)
+ {
+ OldRole = oldRole;
+ NewRole = newRole;
+ }
+
+ ///
+ /// Gets the old role of the player.
+ ///
+ public RoleTypeId OldRole { get; }
+
+ ///
+ /// Gets the new role the player is getting.
+ ///
+ public RoleTypeId NewRole { get; }
+}
diff --git a/LabApi/Events/Arguments/ObjectiveEvents/EscapingObjectiveEventArgs.cs b/LabApi/Events/Arguments/ObjectiveEvents/EscapingObjectiveEventArgs.cs
new file mode 100644
index 00000000..245a7aae
--- /dev/null
+++ b/LabApi/Events/Arguments/ObjectiveEvents/EscapingObjectiveEventArgs.cs
@@ -0,0 +1,36 @@
+using PlayerRoles;
+
+namespace LabApi.Events.Arguments.ObjectiveEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class EscapingObjectiveEventArgs : ObjectiveCompletingBaseEventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player hub who triggered the objective.
+ /// The Faction to grant the influence to.
+ /// The influence points to grant to the .
+ /// The time to reduce from the .
+ /// The new role the player gets after escaping.
+ /// The old role of the player.
+ /// Whether the objective completion will be sent to players.
+ public EscapingObjectiveEventArgs(ReferenceHub hub, Faction faction, float influenceToGrant, float timeToGrant, RoleTypeId oldRole, RoleTypeId newRole, bool sendToPlayers)
+ : base(hub, faction, influenceToGrant, timeToGrant, sendToPlayers)
+ {
+ OldRole = oldRole;
+ NewRole = newRole;
+ }
+
+ ///
+ /// Gets the old role of the player.
+ ///
+ public RoleTypeId OldRole { get; }
+
+ ///
+ /// Gets the new role the player is getting.
+ ///
+ public RoleTypeId NewRole { get; }
+}
diff --git a/LabApi/Events/Arguments/ObjectiveEvents/GeneratorActivatedObjectiveEventArgs.cs b/LabApi/Events/Arguments/ObjectiveEvents/GeneratorActivatedObjectiveEventArgs.cs
new file mode 100644
index 00000000..8cf18012
--- /dev/null
+++ b/LabApi/Events/Arguments/ObjectiveEvents/GeneratorActivatedObjectiveEventArgs.cs
@@ -0,0 +1,31 @@
+using LabApi.Features.Wrappers;
+using MapGeneration.Distributors;
+using PlayerRoles;
+
+namespace LabApi.Events.Arguments.ObjectiveEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class GeneratorActivatedObjectiveEventArgs : ObjectiveCompletedBaseEventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player hub who triggered the objective.
+ /// The Faction to grant the influence to.
+ /// The influence points to grant to the .
+ /// The time to reduce from the .
+ /// Whether the objective completion has been sent to players.
+ /// The generator that has been activated.
+ public GeneratorActivatedObjectiveEventArgs(ReferenceHub hub, Faction faction, float influenceToGrant, float timeToGrant, bool sendToPlayers, Scp079Generator generator)
+ : base(hub, faction, influenceToGrant, timeToGrant, sendToPlayers)
+ {
+ Generator = Generator.Get(generator);
+ }
+
+ ///
+ /// Gets the generator that has been activated.
+ ///
+ public Generator Generator { get; }
+}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/ObjectiveEvents/GeneratorActivatingObjectiveEventArgs.cs b/LabApi/Events/Arguments/ObjectiveEvents/GeneratorActivatingObjectiveEventArgs.cs
new file mode 100644
index 00000000..43bb7e5f
--- /dev/null
+++ b/LabApi/Events/Arguments/ObjectiveEvents/GeneratorActivatingObjectiveEventArgs.cs
@@ -0,0 +1,31 @@
+using LabApi.Features.Wrappers;
+using MapGeneration.Distributors;
+using PlayerRoles;
+
+namespace LabApi.Events.Arguments.ObjectiveEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class GeneratorActivatingObjectiveEventArgs : ObjectiveCompletingBaseEventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player hub who triggered the objective.
+ /// The Faction to grant the influence to.
+ /// The influence points to grant to the .
+ /// The time to reduce from the .
+ /// The generator that has been activated.
+ /// Whether the objective completion will be sent to players.
+ public GeneratorActivatingObjectiveEventArgs(ReferenceHub hub, Faction faction, float influenceToGrant, float timeToGrant, Scp079Generator generator, bool sendToPlayers)
+ : base(hub, faction, influenceToGrant, timeToGrant, sendToPlayers)
+ {
+ Generator = Generator.Get(generator);
+ }
+
+ ///
+ /// Gets the generator that has been activated.
+ ///
+ public Generator Generator { get; }
+}
diff --git a/LabApi/Events/Arguments/ObjectiveEvents/ObjectiveCompletedBaseEventArgs.cs b/LabApi/Events/Arguments/ObjectiveEvents/ObjectiveCompletedBaseEventArgs.cs
new file mode 100644
index 00000000..76113da9
--- /dev/null
+++ b/LabApi/Events/Arguments/ObjectiveEvents/ObjectiveCompletedBaseEventArgs.cs
@@ -0,0 +1,44 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using PlayerRoles;
+using System;
+
+namespace LabApi.Events.Arguments.ObjectiveEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class ObjectiveCompletedBaseEventArgs : EventArgs, IPlayerEvent, IObjectiveEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player hub who triggered the objective.
+ /// The Faction to grant the influence to.
+ /// The influence points granted to the .
+ /// The time reduced from the .
+ /// Whether the objective completion has been sent to players.
+ public ObjectiveCompletedBaseEventArgs(ReferenceHub hub, Faction faction, float influenceToGrant, float timeToGrant, bool sendToPlayers)
+ {
+ Player = Player.Get(hub);
+ Faction = faction;
+ InfluenceToGrant = influenceToGrant;
+ TimeToGrant = timeToGrant;
+ SendToPlayers = sendToPlayers;
+ }
+
+ ///
+ public Player Player { get; }
+
+ ///
+ public Faction Faction { get; }
+
+ ///
+ public float InfluenceToGrant { get; }
+
+ ///
+ public float TimeToGrant { get; }
+
+ ///
+ public bool SendToPlayers { get; }
+}
diff --git a/LabApi/Events/Arguments/ObjectiveEvents/ObjectiveCompletingBaseEventArgs.cs b/LabApi/Events/Arguments/ObjectiveEvents/ObjectiveCompletingBaseEventArgs.cs
new file mode 100644
index 00000000..de9a335e
--- /dev/null
+++ b/LabApi/Events/Arguments/ObjectiveEvents/ObjectiveCompletingBaseEventArgs.cs
@@ -0,0 +1,62 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using PlayerRoles;
+using System;
+
+namespace LabApi.Events.Arguments.ObjectiveEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public abstract class ObjectiveCompletingBaseEventArgs : EventArgs, ICancellableEvent, IPlayerEvent, IObjectiveEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player hub who triggered the objective.
+ /// The Faction to grant the influence to.
+ /// The influence points to grant to the .
+ /// The time to reduce from the .
+ /// Whether the objective completion will be sent to players.
+ public ObjectiveCompletingBaseEventArgs(ReferenceHub hub, Faction faction, float influenceToGrant, float timeToGrant, bool sendToPlayers)
+ {
+ Player = Player.Get(hub);
+ Faction = faction;
+ InfluenceToGrant = influenceToGrant;
+ TimeToGrant = timeToGrant;
+ SendToPlayers = sendToPlayers;
+
+ IsAllowed = true;
+ }
+
+ ///
+ /// Gets or sets the player who triggered the objective completion.
+ ///
+ public Player Player { get; set; }
+
+ ///
+ /// Gets or sets the which receives the and rewards.
+ ///
+ public Faction Faction { get; set; }
+
+ ///
+ /// Gets or sets the amount of influence granted to the .
+ ///
+ public float InfluenceToGrant { get; set; }
+
+ ///
+ /// Gets or sets the amount of time reduced from the 's timer.
+ ///
+ ///
+ /// Negative values reduce the timer, positive extends it.
+ ///
+ public float TimeToGrant { get; set; }
+
+ ///
+ /// Gets or sets whether the objective completion has been sent to players and is visible on their screen.
+ ///
+ public bool SendToPlayers { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/ObjectiveEvents/ScpDamagedObjectiveEventArgs.cs b/LabApi/Events/Arguments/ObjectiveEvents/ScpDamagedObjectiveEventArgs.cs
new file mode 100644
index 00000000..a856bf50
--- /dev/null
+++ b/LabApi/Events/Arguments/ObjectiveEvents/ScpDamagedObjectiveEventArgs.cs
@@ -0,0 +1,30 @@
+using LabApi.Features.Wrappers;
+using PlayerRoles;
+
+namespace LabApi.Events.Arguments.ObjectiveEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class ScpDamagedObjectiveEventArgs : ObjectiveCompletedBaseEventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player hub who triggered the objective.
+ /// The Faction to grant the influence to.
+ /// The influence points to grant to the .
+ /// The time to reduce from the .
+ /// Whether the objective completion has been sent to players.
+ /// The hub of the player SCP that has been damaged.
+ public ScpDamagedObjectiveEventArgs(ReferenceHub hub, Faction faction, float influenceToGrant, float timeToGrant, bool sendToPlayers, ReferenceHub targetHub)
+ : base(hub, faction, influenceToGrant, timeToGrant, sendToPlayers)
+ {
+ Target = Player.Get(targetHub);
+ }
+
+ ///
+ /// Gets the SCP player that has been damaged.
+ ///
+ public Player Target { get; }
+}
diff --git a/LabApi/Events/Arguments/ObjectiveEvents/ScpDamagingObjectiveEventArgs.cs b/LabApi/Events/Arguments/ObjectiveEvents/ScpDamagingObjectiveEventArgs.cs
new file mode 100644
index 00000000..8a66f8a4
--- /dev/null
+++ b/LabApi/Events/Arguments/ObjectiveEvents/ScpDamagingObjectiveEventArgs.cs
@@ -0,0 +1,30 @@
+using LabApi.Features.Wrappers;
+using PlayerRoles;
+
+namespace LabApi.Events.Arguments.ObjectiveEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class ScpDamagingObjectiveEventArgs : ObjectiveCompletingBaseEventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player hub who triggered the objective.
+ /// The Faction to grant the influence to.
+ /// The influence points to grant to the .
+ /// The time to reduce from the .
+ /// The hub of the player SCP that has been damaged.
+ /// Whether the objective completion will be sent to players.
+ public ScpDamagingObjectiveEventArgs(ReferenceHub hub, Faction faction, float influenceToGrant, float timeToGrant, ReferenceHub targetHub, bool sendToPlayers)
+ : base(hub, faction, influenceToGrant, timeToGrant, sendToPlayers)
+ {
+ Target = Player.Get(targetHub);
+ }
+
+ ///
+ /// Gets the SCP player that has been damaged.
+ ///
+ public Player Target { get; }
+}
diff --git a/LabApi/Events/Arguments/ObjectiveEvents/ScpItemPickedObjectiveEventArgs.cs b/LabApi/Events/Arguments/ObjectiveEvents/ScpItemPickedObjectiveEventArgs.cs
new file mode 100644
index 00000000..b5ad603d
--- /dev/null
+++ b/LabApi/Events/Arguments/ObjectiveEvents/ScpItemPickedObjectiveEventArgs.cs
@@ -0,0 +1,31 @@
+using InventorySystem.Items;
+using LabApi.Features.Wrappers;
+using PlayerRoles;
+
+namespace LabApi.Events.Arguments.ObjectiveEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class ScpItemPickedObjectiveEventArgs : ObjectiveCompletedBaseEventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player hub who triggered the objective.
+ /// The Faction to grant the influence to.
+ /// The influence points to grant to the .
+ /// The time to reduce from the .
+ /// Whether the objective completion has been sent to players.
+ /// The item that has been picked up.
+ public ScpItemPickedObjectiveEventArgs(ReferenceHub hub, Faction faction, float influenceToGrant, float timeToGrant, bool sendToPlayers, ItemBase item)
+ : base(hub, faction, influenceToGrant, timeToGrant, sendToPlayers)
+ {
+ Item = Item.Get(item);
+ }
+
+ ///
+ /// Gets the item that has been picked up.
+ ///
+ public Item Item { get; }
+}
diff --git a/LabApi/Events/Arguments/ObjectiveEvents/ScpItemPickingObjectiveEventArgs.cs b/LabApi/Events/Arguments/ObjectiveEvents/ScpItemPickingObjectiveEventArgs.cs
new file mode 100644
index 00000000..e241b906
--- /dev/null
+++ b/LabApi/Events/Arguments/ObjectiveEvents/ScpItemPickingObjectiveEventArgs.cs
@@ -0,0 +1,31 @@
+using InventorySystem.Items;
+using LabApi.Features.Wrappers;
+using PlayerRoles;
+
+namespace LabApi.Events.Arguments.ObjectiveEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class ScpItemPickingObjectiveEventArgs : ObjectiveCompletingBaseEventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player hub who triggered the objective.
+ /// The Faction to grant the influence to.
+ /// The influence points to grant to the .
+ /// The time to reduce from the .
+ /// The item that has been picked up.
+ /// Whether the objective completion will be sent to players.
+ public ScpItemPickingObjectiveEventArgs(ReferenceHub hub, Faction faction, float influenceToGrant, float timeToGrant, ItemBase item, bool sendToPlayers)
+ : base(hub, faction, influenceToGrant, timeToGrant, sendToPlayers)
+ {
+ Item = Item.Get(item);
+ }
+
+ ///
+ /// Gets the item that has been picked up.
+ ///
+ public Item Item { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerActivatedGeneratorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerActivatedGeneratorEventArgs.cs
index bcc59650..9a63b0a8 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerActivatedGeneratorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerActivatedGeneratorEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerActivatedGeneratorEventArgs : EventArgs, IPlayerEvent, IGener
///
/// Initializes a new instance of the class.
///
- /// The player who activated the generator.
+ /// The player who activated the generator.
/// The generator that the player has activated.
- public PlayerActivatedGeneratorEventArgs(ReferenceHub player, Scp079Generator generator)
+ public PlayerActivatedGeneratorEventArgs(ReferenceHub hub, Scp079Generator generator)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Generator = Generator.Get(generator);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerActivatingGeneratorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerActivatingGeneratorEventArgs.cs
index def56887..691c1ae3 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerActivatingGeneratorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerActivatingGeneratorEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerActivatingGeneratorEventArgs : EventArgs, IPlayerEvent, IGene
///
/// Initializes a new instance of the class.
///
- /// The player who is activating the generator.
+ /// The player who is activating the generator.
/// The generator that the player is activating.
- public PlayerActivatingGeneratorEventArgs(ReferenceHub player, Scp079Generator generator)
+ public PlayerActivatingGeneratorEventArgs(ReferenceHub hub, Scp079Generator generator)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Generator = Generator.Get(generator);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerAimedWeaponEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerAimedWeaponEventArgs.cs
index a737ea84..0a797935 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerAimedWeaponEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerAimedWeaponEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerAimedWeaponEventArgs : EventArgs, IPlayerEvent, IFirearmItemE
///
/// Initializes a new instance of the class.
///
- /// The player who aimed the weapon.
+ /// The player who aimed the weapon.
/// The weapon that the player aimed.
/// Whether the player was aiming or unaiming their weapon.
- public PlayerAimedWeaponEventArgs(ReferenceHub player, Firearm weapon, bool aiming)
+ public PlayerAimedWeaponEventArgs(ReferenceHub hub, Firearm weapon, bool aiming)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
FirearmItem = FirearmItem.Get(weapon);
Aiming = aiming;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerAimingWeaponEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerAimingWeaponEventArgs.cs
index 1bbf62cd..8d53a40c 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerAimingWeaponEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerAimingWeaponEventArgs.cs
@@ -6,25 +6,26 @@
namespace LabApi.Events.Arguments.PlayerEvents;
+#pragma warning disable SA1005 // Single line comments should begin with single space
// TODO: implement cancellable aiming.
/////
///// Represents the arguments for the event.
/////
-//public class PlayerAimingWeaponEventArgs : EventArgs, IPlayerEvent, IWeaponEvent, ICancellableEvent
-//{
-// ///
-// /// Initializes a new instance of the class.
-// ///
-// /// The player who is aiming the weapon.
-// /// The weapon that the player is aiming.
-// /// Whether or not the player is aiming or unaiming their weapon.
-// public PlayerAimingWeaponEventArgs(ReferenceHub player, ItemBase weapon, bool aiming)
-// {
-// IsAllowed = true;
-// Player = Player.Get(player);
-// Weapon = Item.Get(weapon);
-// Aiming = aiming;
-// }
+ //public class PlayerAimingWeaponEventArgs : EventArgs, IPlayerEvent, IWeaponEvent, ICancellableEvent
+ //{
+ // ///
+ // /// Initializes a new instance of the class.
+ // ///
+ // /// The player who is aiming the weapon.
+ // /// The weapon that the player is aiming.
+ // /// Whether or not the player is aiming or unaiming their weapon.
+ // public PlayerAimingWeaponEventArgs(ReferenceHub player, ItemBase weapon, bool aiming)
+ // {
+ // IsAllowed = true;
+ // Player = Player.Get(player);
+ // Weapon = Item.Get(weapon);
+ // Aiming = aiming;
+ // }
// ///
// /// Gets the player who is aiming the weapon.
@@ -41,4 +42,5 @@ namespace LabApi.Events.Arguments.PlayerEvents;
// ///
// public bool IsAllowed { get; set; }
-//}
\ No newline at end of file
+//}
+#pragma warning restore SA1005 // Single line comments should begin with single space
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerBannedEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerBannedEventArgs.cs
index 6731568d..e1e46d3f 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerBannedEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerBannedEventArgs.cs
@@ -12,14 +12,14 @@ public class PlayerBannedEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who is getting the ban.
+ /// The player who is getting the ban.
/// The ID of the player who is getting the ban.
/// The player who issued the ban.
/// The reason of the ban.
/// The duration of the ban.
- public PlayerBannedEventArgs(ReferenceHub? player, string playerId, ReferenceHub issuer, string reason, long duration)
+ public PlayerBannedEventArgs(ReferenceHub? hub, string playerId, ReferenceHub issuer, string reason, long duration)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
PlayerId = playerId;
Issuer = Player.Get(issuer);
Reason = reason;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerBanningEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerBanningEventArgs.cs
index 4358f492..f0c74e4f 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerBanningEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerBanningEventArgs.cs
@@ -12,15 +12,15 @@ public class PlayerBanningEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
///
/// Initializes a new instance of the class.
///
- /// The player who is getting the ban.
+ /// The player who is getting the ban.
/// The ID of the player who is getting the ban.
/// The player who issued the ban.
/// The reason of the ban.
/// The duration of the ban.
- public PlayerBanningEventArgs(ReferenceHub? player, string playerId, ReferenceHub issuer, string reason, long duration)
+ public PlayerBanningEventArgs(ReferenceHub? hub, string playerId, ReferenceHub issuer, string reason, long duration)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
PlayerId = playerId;
Issuer = Player.Get(issuer);
Reason = reason;
@@ -31,7 +31,7 @@ public PlayerBanningEventArgs(ReferenceHub? player, string playerId, ReferenceHu
/// Gets the player who is being banned.
///
public Player? Player { get; }
-
+
///
/// Gets the ID of the player who is being banned.
///
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerCancelledUsingItemEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerCancelledUsingItemEventArgs.cs
index ec2b16bd..751c18b2 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerCancelledUsingItemEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerCancelledUsingItemEventArgs.cs
@@ -8,16 +8,16 @@ namespace LabApi.Events.Arguments.PlayerEvents;
///
/// Represents the arguments for the event.
///
-public class PlayerCancelledUsingItemEventArgs : EventArgs, IUsableItemEvent
+public class PlayerCancelledUsingItemEventArgs : EventArgs, IUsableItemEvent, IPlayerEvent
{
///
/// Initializes a new instance of the class.
///
- /// The player who cancelled using the item.
+ /// The player who cancelled using the item.
/// The item which the player cancelled using.
- public PlayerCancelledUsingItemEventArgs(ReferenceHub player, BaseUsableItem item)
+ public PlayerCancelledUsingItemEventArgs(ReferenceHub hub, BaseUsableItem item)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
UsableItem = UsableItem.Get(item);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerCancellingUsingItemEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerCancellingUsingItemEventArgs.cs
index 60c16c64..fdbc61d1 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerCancellingUsingItemEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerCancellingUsingItemEventArgs.cs
@@ -8,17 +8,17 @@ namespace LabApi.Events.Arguments.PlayerEvents;
///
/// Represents the arguments for the event.
///
-public class PlayerCancellingUsingItemEventArgs : EventArgs, IUsableItemEvent, ICancellableEvent
+public class PlayerCancellingUsingItemEventArgs : EventArgs, IUsableItemEvent, ICancellableEvent, IPlayerEvent
{
///
/// Initializes a new instance of the class.
///
- /// The player who is cancelling using the item.
+ /// The player who is cancelling using the item.
/// The item which the player cancels using.
- public PlayerCancellingUsingItemEventArgs(ReferenceHub player, BaseUsableItem item)
+ public PlayerCancellingUsingItemEventArgs(ReferenceHub hub, BaseUsableItem item)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
UsableItem = UsableItem.Get(item);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerChangedAttachmentsEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerChangedAttachmentsEventArgs.cs
new file mode 100644
index 00000000..32304ec7
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerChangedAttachmentsEventArgs.cs
@@ -0,0 +1,43 @@
+using InventorySystem.Items.Firearms;
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerChangedAttachmentsEventArgs : EventArgs, IPlayerEvent, IFirearmItemEvent
+{
+ ///
+ /// Initialized a new instance of .
+ ///
+ /// The player who is changing the firearm attachments.
+ /// The firearm whose attachments are being changed.
+ /// The old attachments code.
+ /// The new attachments code.
+ public PlayerChangedAttachmentsEventArgs(ReferenceHub player, Firearm firearm, uint oldAttachments, uint newAttachments)
+ {
+ Player = Player.Get(player);
+ FirearmItem = FirearmItem.Get(firearm);
+ OldAttachments = oldAttachments;
+ NewAttachments = newAttachments;
+ }
+
+ ///
+ public Player Player { get; }
+
+ ///
+ public FirearmItem FirearmItem { get; }
+
+ ///
+ /// Gets previous attachments code.
+ ///
+ public uint OldAttachments { get; }
+
+ ///
+ /// Gets the new attachments code.
+ ///
+ public uint NewAttachments { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerChangedBadgeVisibilityEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerChangedBadgeVisibilityEventArgs.cs
new file mode 100644
index 00000000..e472ef42
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerChangedBadgeVisibilityEventArgs.cs
@@ -0,0 +1,39 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerChangedBadgeVisibilityEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The component of the player that changed their badge visibility.
+ /// Whether the badge is a global badge.
+ /// The new visibility state.
+ public PlayerChangedBadgeVisibilityEventArgs(ReferenceHub hub, bool isGlobal, bool newVisibility)
+ {
+ Player = Player.Get(hub);
+ IsGlobalBadge = isGlobal;
+ NewVisibility = newVisibility;
+ }
+
+ ///
+ /// The player that changed their badge visibility.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// if the badge is a global badge, otherwise it is a local badge.
+ ///
+ public bool IsGlobalBadge { get; }
+
+ ///
+ /// Whether the badge is now visible.
+ ///
+ public bool NewVisibility { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerChangedItemEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerChangedItemEventArgs.cs
index 7333606b..2b34bcdf 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerChangedItemEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerChangedItemEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerChangedItemEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who changed current item.
+ /// The player who changed current item.
/// The old item which player changed to.
/// The new item which player changed to.
- public PlayerChangedItemEventArgs(ReferenceHub player, ItemBase? oldItem, ItemBase? newItem)
+ public PlayerChangedItemEventArgs(ReferenceHub hub, ItemBase? oldItem, ItemBase? newItem)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
OldItem = Item.Get(oldItem);
NewItem = Item.Get(newItem);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerChangedNicknameEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerChangedNicknameEventArgs.cs
index f3368fe2..adf3fd81 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerChangedNicknameEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerChangedNicknameEventArgs.cs
@@ -12,12 +12,12 @@ public class PlayerChangedNicknameEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player whose nickname has changed.
+ /// The player whose nickname has changed.
/// The old nickname of the player.
/// The new nickname of the player.
- public PlayerChangedNicknameEventArgs(ReferenceHub player, string? oldNickname, string? newNickname)
+ public PlayerChangedNicknameEventArgs(ReferenceHub hub, string? oldNickname, string? newNickname)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
OldNickname = oldNickname;
NewNickname = newNickname;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerChangedRadioRangeEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerChangedRadioRangeEventArgs.cs
index 92984e5b..59978c05 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerChangedRadioRangeEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerChangedRadioRangeEventArgs.cs
@@ -9,17 +9,17 @@ namespace LabApi.Events.Arguments.PlayerEvents;
///
/// Represents the arguments for the event.
///
-public class PlayerChangedRadioRangeEventArgs : EventArgs, IRadioItemEvent
+public class PlayerChangedRadioRangeEventArgs : EventArgs, IRadioItemEvent, IPlayerEvent
{
///
/// Initializes a new instance of the class.
///
- /// The player who changed radio range.
+ /// The player who changed radio range.
/// The radio item.
/// The new range level.
- public PlayerChangedRadioRangeEventArgs(ReferenceHub player, BaseRadioItem radio, RadioRangeLevel range)
+ public PlayerChangedRadioRangeEventArgs(ReferenceHub hub, BaseRadioItem radio, RadioRangeLevel range)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
RadioItem = RadioItem.Get(radio);
Range = range;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerChangedRoleEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerChangedRoleEventArgs.cs
index fcd19bae..a2fc0810 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerChangedRoleEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerChangedRoleEventArgs.cs
@@ -13,14 +13,14 @@ public class PlayerChangedRoleEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player whose role changed.
+ /// The player whose role changed.
/// The old role type.
/// The new role object of the player.
/// The reason of role changed.
/// The spawn flags used for this role change.
- public PlayerChangedRoleEventArgs(ReferenceHub player, RoleTypeId oldRole, PlayerRoleBase newRole, RoleChangeReason changeReason, RoleSpawnFlags spawnFlags)
+ public PlayerChangedRoleEventArgs(ReferenceHub hub, RoleTypeId oldRole, PlayerRoleBase newRole, RoleChangeReason changeReason, RoleSpawnFlags spawnFlags)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
OldRole = oldRole;
NewRole = newRole;
ChangeReason = changeReason;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerChangedSpectatorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerChangedSpectatorEventArgs.cs
index ae76eab5..69a6cf48 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerChangedSpectatorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerChangedSpectatorEventArgs.cs
@@ -12,12 +12,12 @@ public class PlayerChangedSpectatorEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who changed spectator.
+ /// The player who changed spectator.
/// Old target that was spectated previously.
/// New target that was spectating changed to.
- public PlayerChangedSpectatorEventArgs(ReferenceHub player, ReferenceHub oldTarget, ReferenceHub newTarget)
+ public PlayerChangedSpectatorEventArgs(ReferenceHub hub, ReferenceHub oldTarget, ReferenceHub newTarget)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
OldTarget = Player.Get(oldTarget);
NewTarget = Player.Get(newTarget);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerChangingAttachmentsEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerChangingAttachmentsEventArgs.cs
new file mode 100644
index 00000000..669ff328
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerChangingAttachmentsEventArgs.cs
@@ -0,0 +1,47 @@
+using InventorySystem.Items.Firearms;
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerChangingAttachmentsEventArgs : EventArgs, IPlayerEvent, IFirearmItemEvent, ICancellableEvent
+{
+ ///
+ /// Initialized a new instance of .
+ ///
+ /// The player who is changing the firearm attachments.
+ /// The firearm whose attachments are being changed.
+ /// The old attachments code.
+ /// The new attachments code requested by the player.
+ public PlayerChangingAttachmentsEventArgs(ReferenceHub player, Firearm firearm, uint oldAttachments, uint newAttachments)
+ {
+ Player = Player.Get(player);
+ FirearmItem = FirearmItem.Get(firearm);
+ OldAttachments = oldAttachments;
+ NewAttachments = newAttachments;
+ IsAllowed = true;
+ }
+
+ ///
+ public Player Player { get; }
+
+ ///
+ public FirearmItem FirearmItem { get; }
+
+ ///
+ /// Gets previous attachments code.
+ ///
+ public uint OldAttachments { get; }
+
+ ///
+ /// Gets or sets new attachments code.
+ ///
+ public uint NewAttachments { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerChangingBadgeVisibilityEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerChangingBadgeVisibilityEventArgs.cs
new file mode 100644
index 00000000..6fb7ee1e
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerChangingBadgeVisibilityEventArgs.cs
@@ -0,0 +1,43 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerChangingBadgeVisibilityEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The component of the player that is changing their badge visibility.
+ /// Whether the badge is a global badge.
+ /// The new visibility state.
+ public PlayerChangingBadgeVisibilityEventArgs(ReferenceHub hub, bool isGlobal, bool newVisibility)
+ {
+ Player = Player.Get(hub);
+ IsGlobalBadge = isGlobal;
+ NewVisibility = newVisibility;
+ IsAllowed = true;
+ }
+
+ ///
+ /// The player that is changing their badge visibility.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// if the badge is a global badge, otherwise it is a local badge.
+ ///
+ public bool IsGlobalBadge { get; }
+
+ ///
+ /// Whether the badge will be visible.
+ ///
+ public bool NewVisibility { get; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerChangingItemEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerChangingItemEventArgs.cs
index cbfe21e8..1f3e719f 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerChangingItemEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerChangingItemEventArgs.cs
@@ -13,13 +13,13 @@ public class PlayerChangingItemEventArgs : EventArgs, IPlayerEvent, ICancellable
///
/// Initializes a new instance of the class.
///
- /// The player who is changing item.
+ /// The player who is changing item.
/// The old item.
/// The new item that is being equipped.
- public PlayerChangingItemEventArgs(ReferenceHub player, ItemBase? oldItem, ItemBase? newItem)
+ public PlayerChangingItemEventArgs(ReferenceHub hub, ItemBase? oldItem, ItemBase? newItem)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
OldItem = Item.Get(oldItem);
NewItem = Item.Get(newItem);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerChangingNicknameEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerChangingNicknameEventArgs.cs
index 12a45c24..159b66bd 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerChangingNicknameEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerChangingNicknameEventArgs.cs
@@ -12,13 +12,13 @@ public class PlayerChangingNicknameEventArgs : EventArgs, IPlayerEvent, ICancell
///
/// Initializes a new instance of the class.
///
- /// The player whose nickname is changing.
+ /// The player whose nickname is changing.
/// The old nickname of the player.
/// The new nickname of the player.
- public PlayerChangingNicknameEventArgs(ReferenceHub player, string? oldNickname, string? newNickname)
+ public PlayerChangingNicknameEventArgs(ReferenceHub hub, string? oldNickname, string? newNickname)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
OldNickname = oldNickname;
NewNickname = newNickname;
}
@@ -33,7 +33,7 @@ public PlayerChangingNicknameEventArgs(ReferenceHub player, string? oldNickname,
///
/// Null means they did not have a custom display-name before.
public string? OldNickname { get; }
-
+
///
/// Gets or sets the new nickname of the player.
///
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerChangingRadioRangeEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerChangingRadioRangeEventArgs.cs
index 0f79bfc5..d1a848c3 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerChangingRadioRangeEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerChangingRadioRangeEventArgs.cs
@@ -9,18 +9,18 @@ namespace LabApi.Events.Arguments.PlayerEvents;
///
/// Represents the arguments for the event.
///
-public class PlayerChangingRadioRangeEventArgs : EventArgs, IRadioItemEvent, ICancellableEvent
+public class PlayerChangingRadioRangeEventArgs : EventArgs, IRadioItemEvent, ICancellableEvent, IPlayerEvent
{
///
/// Initializes a new instance of the class.
///
- /// The player who is changing radio range.
+ /// The player who is changing radio range.
/// The radio item.
/// The range level that is radio being changed to.
- public PlayerChangingRadioRangeEventArgs(ReferenceHub player, BaseRadioItem radio, RadioRangeLevel range)
+ public PlayerChangingRadioRangeEventArgs(ReferenceHub hub, BaseRadioItem radio, RadioRangeLevel range)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
RadioItem = RadioItem.Get(radio);
Range = range;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerChangingRoleEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerChangingRoleEventArgs.cs
index 0ce9e283..59c68293 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerChangingRoleEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerChangingRoleEventArgs.cs
@@ -13,15 +13,15 @@ public class PlayerChangingRoleEventArgs : EventArgs, IPlayerEvent, ICancellable
///
/// Initializes a new instance of the class.
///
- /// The player whose role is changing.
+ /// The player whose role is changing.
/// The old role object of the player.
/// The new role type.
/// The reason of role changing.
/// The spawn flags for this role change.
- public PlayerChangingRoleEventArgs(ReferenceHub player, PlayerRoleBase oldRole, RoleTypeId newRole, RoleChangeReason changeReason, RoleSpawnFlags spawnFlags)
+ public PlayerChangingRoleEventArgs(ReferenceHub hub, PlayerRoleBase oldRole, RoleTypeId newRole, RoleChangeReason changeReason, RoleSpawnFlags spawnFlags)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
OldRole = oldRole;
NewRole = newRole;
ChangeReason = changeReason;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerCheckedHitmarkerEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerCheckedHitmarkerEventArgs.cs
new file mode 100644
index 00000000..9291f616
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerCheckedHitmarkerEventArgs.cs
@@ -0,0 +1,47 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using PlayerStatsSystem;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerCheckedHitmarkerEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initializes a new instance for the class.
+ ///
+ /// The player that hitmarker should send.
+ /// The damage dealt to the .
+ /// The player who got hurt by .
+ /// The result of the check.
+ public PlayerCheckedHitmarkerEventArgs(ReferenceHub hub, AttackerDamageHandler adh, ReferenceHub victim, bool result)
+ {
+ Player = Player.Get(hub);
+ DamageHandler = adh;
+ Victim = Player.Get(victim);
+ Result = result;
+ }
+
+ ///
+ /// Gets the player that the hitmarker is being sent to.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the player that was hit.
+ ///
+ public Player Victim { get; }
+
+ ///
+ /// Gets the damage handler.
+ ///
+ public AttackerDamageHandler DamageHandler { get; }
+
+ ///
+ /// Gets the check result.
+ ///
+ public bool Result { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerClosedGeneratorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerClosedGeneratorEventArgs.cs
index bc30549e..ccfa2033 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerClosedGeneratorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerClosedGeneratorEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerClosedGeneratorEventArgs : EventArgs, IPlayerEvent, IGenerato
///
/// Initializes a new instance of the class.
///
- /// The player who closed the generator.
+ /// The player who closed the generator.
/// The generator.
- public PlayerClosedGeneratorEventArgs(ReferenceHub player, Scp079Generator generator)
+ public PlayerClosedGeneratorEventArgs(ReferenceHub hub, Scp079Generator generator)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Generator = Generator.Get(generator);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerClosingGeneratorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerClosingGeneratorEventArgs.cs
index 4acb3bde..8ae7bbc2 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerClosingGeneratorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerClosingGeneratorEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerClosingGeneratorEventArgs : EventArgs, IPlayerEvent, IGenerat
///
/// Initializes a new instance of the class.
///
- /// The player who is closing the generator.
+ /// The player who is closing the generator.
/// The generator.
- public PlayerClosingGeneratorEventArgs(ReferenceHub player, Scp079Generator generator)
+ public PlayerClosingGeneratorEventArgs(ReferenceHub hub, Scp079Generator generator)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Generator = Generator.Get(generator);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerCuffedEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerCuffedEventArgs.cs
index 1b7c6076..7abc3d10 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerCuffedEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerCuffedEventArgs.cs
@@ -12,11 +12,11 @@ public class PlayerCuffedEventArgs : EventArgs, IPlayerEvent, ITargetEvent
///
/// Initializes a new instance of the class.
///
- /// The player who detained another one.
+ /// The player who detained another one.
/// The player who was detained.
- public PlayerCuffedEventArgs(ReferenceHub player, ReferenceHub target)
+ public PlayerCuffedEventArgs(ReferenceHub hub, ReferenceHub target)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Target = Player.Get(target);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerCuffingEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerCuffingEventArgs.cs
index 4aafad95..16b0e9c6 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerCuffingEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerCuffingEventArgs.cs
@@ -12,12 +12,12 @@ public class PlayerCuffingEventArgs : EventArgs, IPlayerEvent, ITargetEvent, ICa
///
/// Initializes a new instance of the class.
///
- /// The player who is detaining another one.
+ /// The player who is detaining another one.
/// The player who is being detained.
- public PlayerCuffingEventArgs(ReferenceHub player, ReferenceHub target)
+ public PlayerCuffingEventArgs(ReferenceHub hub, ReferenceHub target)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Target = Player.Get(target);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDamagedShootingTargetEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDamagedShootingTargetEventArgs.cs
index cf0010f7..a2a6c88d 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerDamagedShootingTargetEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDamagedShootingTargetEventArgs.cs
@@ -14,12 +14,12 @@ public class PlayerDamagedShootingTargetEventArgs : EventArgs, IPlayerEvent, ISh
///
/// Initializes a new instance of the class.
///
- /// The player who damaged the shooting target.
+ /// The player who damaged the shooting target.
/// The shooting target.
/// The damage handler.
- public PlayerDamagedShootingTargetEventArgs(ReferenceHub player, ShootingTarget target, DamageHandlerBase damageHandler)
+ public PlayerDamagedShootingTargetEventArgs(ReferenceHub hub, ShootingTarget target, DamageHandlerBase damageHandler)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
ShootingTarget = ShootingTargetToy.Get(target);
DamageHandler = damageHandler;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDamagedWindowEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDamagedWindowEventArgs.cs
index 2a67d768..b13308cb 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerDamagedWindowEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDamagedWindowEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerDamagedWindowEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who damaged the window.
+ /// The player who damaged the window.
/// The window.
/// The damage handler.
- public PlayerDamagedWindowEventArgs(ReferenceHub player, BreakableWindow window, DamageHandlerBase damageHandler)
+ public PlayerDamagedWindowEventArgs(ReferenceHub hub, BreakableWindow window, DamageHandlerBase damageHandler)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Window = window;
DamageHandler = damageHandler;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDamagingShootingTargetEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDamagingShootingTargetEventArgs.cs
index 1a25a160..602e94e6 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerDamagingShootingTargetEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDamagingShootingTargetEventArgs.cs
@@ -14,13 +14,13 @@ public class PlayerDamagingShootingTargetEventArgs : EventArgs, IPlayerEvent, IS
///
/// Initializes a new instance of the class.
///
- /// The player who is damaging the shooting target.
+ /// The player who is damaging the shooting target.
/// The shooting target.
/// The damage handler.
- public PlayerDamagingShootingTargetEventArgs(ReferenceHub player, ShootingTarget target, DamageHandlerBase damageHandler)
+ public PlayerDamagingShootingTargetEventArgs(ReferenceHub hub, ShootingTarget target, DamageHandlerBase damageHandler)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
ShootingTarget = ShootingTargetToy.Get(target);
DamageHandler = damageHandler;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDamagingWindowEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDamagingWindowEventArgs.cs
index 3758606e..a25afb44 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerDamagingWindowEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDamagingWindowEventArgs.cs
@@ -8,18 +8,18 @@ namespace LabApi.Events.Arguments.PlayerEvents;
///
/// Represents the arguments for the event.
///
-public class PlayerDamagingWindowEventArgs : EventArgs, ICancellableEvent
+public class PlayerDamagingWindowEventArgs : EventArgs, ICancellableEvent, IPlayerEvent
{
///
/// Initializes a new instance of the class.
///
- /// The player who is damaging the window.
+ /// The player who is damaging the window.
/// The window.
/// The damage handler.
- public PlayerDamagingWindowEventArgs(ReferenceHub player, BreakableWindow window, DamageHandlerBase damageHandler)
+ public PlayerDamagingWindowEventArgs(ReferenceHub hub, BreakableWindow window, DamageHandlerBase damageHandler)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Window = window;
DamageHandler = damageHandler;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDeactivatedGeneratorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDeactivatedGeneratorEventArgs.cs
index 8fd753a4..dcfdee83 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerDeactivatedGeneratorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDeactivatedGeneratorEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerDeactivatedGeneratorEventArgs : EventArgs, IPlayerEvent, IGen
///
/// Initializes a new instance of the class.
///
- /// The player who deactivated the generator.
+ /// The player who deactivated the generator.
/// The generator.
- public PlayerDeactivatedGeneratorEventArgs(ReferenceHub player, Scp079Generator generator)
+ public PlayerDeactivatedGeneratorEventArgs(ReferenceHub hub, Scp079Generator generator)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Generator = Generator.Get(generator);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDeactivatingGeneratorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDeactivatingGeneratorEventArgs.cs
index 57bbf5b6..cd9e95fe 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerDeactivatingGeneratorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDeactivatingGeneratorEventArgs.cs
@@ -8,17 +8,17 @@ namespace LabApi.Events.Arguments.PlayerEvents;
///
/// Represents the arguments for the event.
///
-public class PlayerDeactivatingGeneratorEventArgs : EventArgs, IGeneratorEvent, ICancellableEvent
+public class PlayerDeactivatingGeneratorEventArgs : EventArgs, IGeneratorEvent, ICancellableEvent, IPlayerEvent
{
///
/// Initializes a new instance of the class.
///
- /// The player who is deactivating the generator.
+ /// The player who is deactivating the generator.
/// The generator.
- public PlayerDeactivatingGeneratorEventArgs(ReferenceHub player, Scp079Generator generator)
+ public PlayerDeactivatingGeneratorEventArgs(ReferenceHub hub, Scp079Generator generator)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Generator = Generator.Get(generator);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDeathEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDeathEventArgs.cs
index d58359eb..7278b54b 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerDeathEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDeathEventArgs.cs
@@ -15,17 +15,23 @@ public class PlayerDeathEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who died.
+ /// The player who died.
/// The player who caused the death.
/// The damage that caused the death.
/// 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)
+ public PlayerDeathEventArgs(
+ ReferenceHub hub,
+ ReferenceHub? attacker,
+ DamageHandlerBase damageHandler,
+ RoleTypeId oldRole,
+ Vector3 oldPosition,
+ Vector3 oldVelocity,
+ Quaternion oldCameraRotation)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Attacker = Player.Get(attacker);
DamageHandler = damageHandler;
OldRole = oldRole;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDetectedByScp1344EventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDetectedByScp1344EventArgs.cs
new file mode 100644
index 00000000..7fb7dd84
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDetectedByScp1344EventArgs.cs
@@ -0,0 +1,28 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerDetectedByScp1344EventArgs : EventArgs, IPlayerEvent, ITargetEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player who has SCP-1344.
+ /// The player who has been detected.
+ public PlayerDetectedByScp1344EventArgs(ReferenceHub player, ReferenceHub target)
+ {
+ Player = Player.Get(player);
+ Target = Player.Get(target);
+ }
+
+ ///
+ public Player Player { get; }
+
+ ///
+ public Player Target { get; set; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDroppedAmmoEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDroppedAmmoEventArgs.cs
index 1e9b60fd..c5a47655 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerDroppedAmmoEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDroppedAmmoEventArgs.cs
@@ -13,13 +13,13 @@ public class PlayerDroppedAmmoEventArgs : EventArgs, IPlayerEvent, IAmmoPickupEv
///
/// Initializes a new instance of the class.
///
- /// The player who is dropping the ammo.
+ /// The player who is dropping the ammo.
/// The type of ammo being dropped.
/// The amount of ammo being dropped.
/// The ammo pickup.
- public PlayerDroppedAmmoEventArgs(ReferenceHub player, ItemType type, int amount, BaseAmmoPickup pickup)
+ public PlayerDroppedAmmoEventArgs(ReferenceHub hub, ItemType type, int amount, BaseAmmoPickup pickup)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Type = type;
Amount = amount;
AmmoPickup = AmmoPickup.Get(pickup);
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDroppedItemEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDroppedItemEventArgs.cs
index 9dd3ff9e..5895c0bd 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerDroppedItemEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDroppedItemEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerDroppedItemEventArgs : EventArgs, IPlayerEvent, IPickupEvent
///
/// Initializes a new instance of the class.
///
- /// The player who dropped the item.
+ /// The player who dropped the item.
/// The item pickup.
/// Whether the item will be thrown.
- public PlayerDroppedItemEventArgs(ReferenceHub player, ItemPickupBase pickup, bool isThrowing)
+ public PlayerDroppedItemEventArgs(ReferenceHub hub, ItemPickupBase pickup, bool isThrowing)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Pickup = Pickup.Get(pickup);
Throw = isThrowing;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDroppingAmmoEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDroppingAmmoEventArgs.cs
index 73bc7a84..dda5faba 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerDroppingAmmoEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDroppingAmmoEventArgs.cs
@@ -12,13 +12,13 @@ public class PlayerDroppingAmmoEventArgs : EventArgs, ICancellableEvent, IPlayer
///
/// Initializes a new instance of the class.
///
- /// The player who is dropping the ammo.
+ /// The player who is dropping the ammo.
/// The type of ammo being dropped.
/// The amount of ammo being dropped.
- public PlayerDroppingAmmoEventArgs(ReferenceHub player, ItemType type, int amount)
+ public PlayerDroppingAmmoEventArgs(ReferenceHub hub, ItemType type, int amount)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Type = type;
Amount = amount;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDroppingItemEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDroppingItemEventArgs.cs
index dc5f3e4d..6e0a74cd 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerDroppingItemEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDroppingItemEventArgs.cs
@@ -8,18 +8,18 @@ namespace LabApi.Events.Arguments.PlayerEvents;
///
/// Represents the arguments for the event.
///
-public class PlayerDroppingItemEventArgs : EventArgs, ICancellableEvent, IItemEvent
+public class PlayerDroppingItemEventArgs : EventArgs, ICancellableEvent, IItemEvent, IPlayerEvent
{
///
/// Initializes a new instance of the class.
///
- /// The player who is dropping the item.
+ /// The player who is dropping the item.
/// The item being dropped.
/// Whether the item will be thrown.
- public PlayerDroppingItemEventArgs(ReferenceHub player, ItemBase item, bool isThrowing)
+ public PlayerDroppingItemEventArgs(ReferenceHub hub, ItemBase item, bool isThrowing)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Item = Item.Get(item);
Throw = isThrowing;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDryFiredWeaponEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDryFiredWeaponEventArgs.cs
index 67475bde..54ec7101 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerDryFiredWeaponEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDryFiredWeaponEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerDryFiredWeaponEventArgs : EventArgs, IPlayerEvent, IFirearmIt
///
/// Initializes a new instance of the class.
///
- /// The player who dry fired.
+ /// The player who dry fired.
/// The weapon item.
- public PlayerDryFiredWeaponEventArgs(ReferenceHub player, Firearm weapon)
+ public PlayerDryFiredWeaponEventArgs(ReferenceHub hub, Firearm weapon)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
FirearmItem = FirearmItem.Get(weapon);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDryFiringWeaponEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDryFiringWeaponEventArgs.cs
index 61d62ffe..b2d3a93e 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerDryFiringWeaponEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDryFiringWeaponEventArgs.cs
@@ -8,17 +8,17 @@ namespace LabApi.Events.Arguments.PlayerEvents;
///
/// Represents the arguments for the event.
///
-public class PlayerDryFiringWeaponEventArgs : EventArgs, IFirearmItemEvent, ICancellableEvent
+public class PlayerDryFiringWeaponEventArgs : EventArgs, IFirearmItemEvent, ICancellableEvent, IPlayerEvent
{
///
/// Initializes a new instance of the class.
///
- /// The player who is dry firing.
+ /// The player who is dry firing.
/// The weapon item.
- public PlayerDryFiringWeaponEventArgs(ReferenceHub player, Firearm weapon)
+ public PlayerDryFiringWeaponEventArgs(ReferenceHub hub, Firearm weapon)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
FirearmItem = FirearmItem.Get(weapon);
}
@@ -38,5 +38,4 @@ public PlayerDryFiringWeaponEventArgs(ReferenceHub player, Firearm weapon)
///
[Obsolete($"Use {nameof(FirearmItem)} instead")]
public Item Weapon => FirearmItem;
-
}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerDyingEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerDyingEventArgs.cs
index 70dafb23..6fb84cb2 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerDyingEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerDyingEventArgs.cs
@@ -13,13 +13,13 @@ public class PlayerDyingEventArgs : EventArgs, ICancellableEvent, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who is dying.
+ /// The player who is dying.
/// The player who attacked.
/// The damage handler who is causing death.
- public PlayerDyingEventArgs(ReferenceHub player, ReferenceHub? attacker, DamageHandlerBase damageHandler)
+ public PlayerDyingEventArgs(ReferenceHub hub, ReferenceHub? attacker, DamageHandlerBase damageHandler)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Attacker = Player.Get(attacker);
DamageHandler = damageHandler;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerEffectUpdatedEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerEffectUpdatedEventArgs.cs
index add1ddbb..086c0bb7 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerEffectUpdatedEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerEffectUpdatedEventArgs.cs
@@ -13,13 +13,13 @@ public class PlayerEffectUpdatedEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player whose effect has been updated.
+ /// The player whose effect has been updated.
/// The effect that is being updated.
/// Intensity of the effect.
/// Duration of the effect in seconds.
- public PlayerEffectUpdatedEventArgs(ReferenceHub player, StatusEffectBase effect, byte intensity, float duration)
+ public PlayerEffectUpdatedEventArgs(ReferenceHub hub, StatusEffectBase effect, byte intensity, float duration)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Effect = effect;
Intensity = intensity;
Duration = duration;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerEffectUpdatingEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerEffectUpdatingEventArgs.cs
index 54c84d53..40d30c2f 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerEffectUpdatingEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerEffectUpdatingEventArgs.cs
@@ -8,19 +8,19 @@ namespace LabApi.Events.Arguments.PlayerEvents;
///
/// Represents the arguments for the event.
///
-public class PlayerEffectUpdatingEventArgs : EventArgs, ICancellableEvent
+public class PlayerEffectUpdatingEventArgs : EventArgs, ICancellableEvent, IPlayerEvent
{
///
/// Initializes a new instance of the class.
///
- /// The player whose effect is being updated.
+ /// The player whose effect is being updated.
/// The effect that is being updated.
/// Intensity of the effect.
/// Duration of the effect in seconds.
- public PlayerEffectUpdatingEventArgs(ReferenceHub player, StatusEffectBase effect, byte intensity, float duration)
+ public PlayerEffectUpdatingEventArgs(ReferenceHub hub, StatusEffectBase effect, byte intensity, float duration)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Effect = effect;
Intensity = intensity;
Duration = duration;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerEnteredHazardEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerEnteredHazardEventArgs.cs
index 922a47f3..2eabbba9 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerEnteredHazardEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerEnteredHazardEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerEnteredHazardEventArgs : EventArgs, IPlayerEvent, IHazardEven
///
/// Initializes a new instance of the class.
///
- /// The player who entered the hazard.
+ /// The player who entered the hazard.
/// The hazard.
- public PlayerEnteredHazardEventArgs(ReferenceHub player, EnvironmentalHazard hazard)
+ public PlayerEnteredHazardEventArgs(ReferenceHub hub, EnvironmentalHazard hazard)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Hazard = Hazard.Get(hazard);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerEnteredPocketDimensionEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerEnteredPocketDimensionEventArgs.cs
index 33047082..64ca30ea 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerEnteredPocketDimensionEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerEnteredPocketDimensionEventArgs.cs
@@ -12,14 +12,14 @@ public class PlayerEnteredPocketDimensionEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who entered the pocket dimension.
- public PlayerEnteredPocketDimensionEventArgs(ReferenceHub player)
+ /// The player who entered the pocket dimension.
+ public PlayerEnteredPocketDimensionEventArgs(ReferenceHub hub)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
/// Gets the player who entered the pocket dimension.
///
- public Player Player { get; }
+ public Player Player { get; }
}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerEnteringHazardEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerEnteringHazardEventArgs.cs
index 65c547a2..8b695f81 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerEnteringHazardEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerEnteringHazardEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerEnteringHazardEventArgs : EventArgs, IPlayerEvent, IHazardEve
///
/// Initializes a new instance of the class.
///
- /// The player who entered the hazard.
+ /// The player who entered the hazard.
/// The hazard.
- public PlayerEnteringHazardEventArgs(ReferenceHub player, EnvironmentalHazard hazard)
+ public PlayerEnteringHazardEventArgs(ReferenceHub hub, EnvironmentalHazard hazard)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Hazard = Hazard.Get(hazard);
IsAllowed = true;
@@ -38,4 +38,3 @@ public PlayerEnteringHazardEventArgs(ReferenceHub player, EnvironmentalHazard ha
///
public bool IsAllowed { get; set; }
}
-
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerEnteringPocketDimensionEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerEnteringPocketDimensionEventArgs.cs
index a7f4c1b0..23878f1f 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerEnteringPocketDimensionEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerEnteringPocketDimensionEventArgs.cs
@@ -12,11 +12,11 @@ public class PlayerEnteringPocketDimensionEventArgs : EventArgs, IPlayerEvent, I
///
/// Initializes a new instance of the class.
///
- /// The player who is entering the pocket dimension.
- public PlayerEnteringPocketDimensionEventArgs(ReferenceHub player)
+ /// The player who is entering the pocket dimension.
+ public PlayerEnteringPocketDimensionEventArgs(ReferenceHub hub)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerEscapedEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerEscapedEventArgs.cs
index bd427268..25859366 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerEscapedEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerEscapedEventArgs.cs
@@ -2,6 +2,7 @@
using LabApi.Features.Wrappers;
using PlayerRoles;
using System;
+using UnityEngine;
using static Escape;
namespace LabApi.Events.Arguments.PlayerEvents;
@@ -14,14 +15,18 @@ public class PlayerEscapedEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who escaped.
+ /// The player who escaped.
/// The new role.
/// The scenario of the escape.
- public PlayerEscapedEventArgs(ReferenceHub player, RoleTypeId newRole, EscapeScenarioType escapeScenarioType)
+ /// The old role of the player.
+ /// The bounds of the escape zone that was triggered.
+ public PlayerEscapedEventArgs(ReferenceHub hub, RoleTypeId oldRole, RoleTypeId newRole, EscapeScenarioType escapeScenarioType, Bounds escapeZone)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
+ OldRole = oldRole;
NewRole = newRole;
EscapeScenarioType = escapeScenarioType;
+ EscapeZone = escapeZone;
}
///
@@ -29,6 +34,11 @@ public PlayerEscapedEventArgs(ReferenceHub player, RoleTypeId newRole, EscapeSce
///
public Player Player { get; }
+ ///
+ /// Gets the old role of the player.
+ ///
+ public RoleTypeId OldRole { get; }
+
///
/// Gets the new role.
///
@@ -38,4 +48,9 @@ public PlayerEscapedEventArgs(ReferenceHub player, RoleTypeId newRole, EscapeSce
/// Escape scenario of the player.
///
public EscapeScenarioType EscapeScenarioType { get; }
+
+ ///
+ /// The bounds of the escape zone that was triggered.
+ ///
+ public Bounds EscapeZone { get; }
}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerEscapingEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerEscapingEventArgs.cs
index 1634f83f..d604b16c 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerEscapingEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerEscapingEventArgs.cs
@@ -2,6 +2,7 @@
using LabApi.Features.Wrappers;
using PlayerRoles;
using System;
+using UnityEngine;
using static Escape;
namespace LabApi.Events.Arguments.PlayerEvents;
@@ -14,15 +15,19 @@ public class PlayerEscapingEventArgs : EventArgs, IPlayerEvent, ICancellableEven
///
/// Initializes a new instance of the class.
///
- /// The player who is escaping.
+ /// The player who is escaping.
/// The new role that is set after escape.
/// The scenario of the escape.
- public PlayerEscapingEventArgs(ReferenceHub player, RoleTypeId newRole, EscapeScenarioType escapeScenario)
+ /// The old role of the player.
+ /// The bounds of the escape zone that was triggered.
+ public PlayerEscapingEventArgs(ReferenceHub hub, RoleTypeId oldRole, RoleTypeId newRole, EscapeScenarioType escapeScenario, Bounds escapeZone)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
+ OldRole = oldRole;
NewRole = newRole;
EscapeScenario = escapeScenario;
+ EscapeZone = escapeZone;
}
///
@@ -30,16 +35,26 @@ public PlayerEscapingEventArgs(ReferenceHub player, RoleTypeId newRole, EscapeSc
///
public Player Player { get; }
+ ///
+ /// Gets the old role of the player.
+ ///
+ public RoleTypeId OldRole { get; }
+
///
/// Gets or sets the new role that is set after escape.
///
public RoleTypeId NewRole { get; set; }
///
- /// Gets or sets the escape scenario
+ /// Gets or sets the escape scenario.
///
public EscapeScenarioType EscapeScenario { get; set; }
+ ///
+ /// The bounds of the escape zone that was triggered.
+ ///
+ public Bounds EscapeZone { get; }
+
///
public bool IsAllowed { get; set; }
}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerFlippedCoinEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerFlippedCoinEventArgs.cs
index f2defb2d..3277f32d 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerFlippedCoinEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerFlippedCoinEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerFlippedCoinEventArgs : EventArgs, IPlayerEvent, ICoinItemEven
///
/// Initializes a new instance of the class.
///
- /// The player who flipped the coin.
+ /// The player who flipped the coin.
/// The coin that was flipped.
/// Whenever the coin flip is tails.
- public PlayerFlippedCoinEventArgs(ReferenceHub player, Coin coin, bool isTails)
+ public PlayerFlippedCoinEventArgs(ReferenceHub hub, Coin coin, bool isTails)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
CoinItem = CoinItem.Get(coin);
IsTails = isTails;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerFlippingCoinEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerFlippingCoinEventArgs.cs
index 84c1d6ad..16037336 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerFlippingCoinEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerFlippingCoinEventArgs.cs
@@ -8,17 +8,17 @@ namespace LabApi.Events.Arguments.PlayerEvents;
///
/// Represents the arguments for the event.
///
-public class PlayerFlippingCoinEventArgs : EventArgs, ICancellableEvent, ICoinItemEvent
+public class PlayerFlippingCoinEventArgs : EventArgs, ICancellableEvent, ICoinItemEvent, IPlayerEvent
{
///
/// Initializes a new instance of the class.
///
- /// The player who is flipping the coin.
+ /// The player who is flipping the coin.
/// The coin that is being flipped.
/// Whenever the coin flip is tails.
- public PlayerFlippingCoinEventArgs(ReferenceHub player, Coin coin, bool isTails)
+ public PlayerFlippingCoinEventArgs(ReferenceHub hub, Coin coin, bool isTails)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
CoinItem = CoinItem.Get(coin);
IsTails = isTails;
IsAllowed = true;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerGroupChangedEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerGroupChangedEventArgs.cs
index 7619d60f..3c311bb9 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerGroupChangedEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerGroupChangedEventArgs.cs
@@ -12,11 +12,11 @@ public class PlayerGroupChangedEventArgs : EventArgs, IPlayerEvent, IGroupEvent
///
/// Initializes a new instance of the class.
///
- /// The player whose group changed.
+ /// The player whose group changed.
/// The new group.
- public PlayerGroupChangedEventArgs(ReferenceHub player, UserGroup group)
+ public PlayerGroupChangedEventArgs(ReferenceHub hub, UserGroup group)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Group = group;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerGroupChangingEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerGroupChangingEventArgs.cs
index 5e8ab249..707d7719 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerGroupChangingEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerGroupChangingEventArgs.cs
@@ -12,11 +12,11 @@ public class PlayerGroupChangingEventArgs : EventArgs, IPlayerEvent, IGroupEvent
///
/// Initializes a new instance of the class.
///
- /// The player whose group is changing.
+ /// The player whose group is changing.
/// The new group.
- public PlayerGroupChangingEventArgs(ReferenceHub player, UserGroup? group)
+ public PlayerGroupChangingEventArgs(ReferenceHub hub, UserGroup? group)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Group = group;
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerIdledTeslaEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerIdledTeslaEventArgs.cs
index 507e2f54..ba89ff61 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerIdledTeslaEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerIdledTeslaEventArgs.cs
@@ -1,6 +1,6 @@
-using System;
-using LabApi.Events.Arguments.Interfaces;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using System;
namespace LabApi.Events.Arguments.PlayerEvents;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerIdlingTeslaEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerIdlingTeslaEventArgs.cs
index a7085862..b7276ad1 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerIdlingTeslaEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerIdlingTeslaEventArgs.cs
@@ -1,6 +1,6 @@
-using System;
-using LabApi.Events.Arguments.Interfaces;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using System;
namespace LabApi.Events.Arguments.PlayerEvents;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerInspectedKeycardEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerInspectedKeycardEventArgs.cs
new file mode 100644
index 00000000..0cee3ce8
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerInspectedKeycardEventArgs.cs
@@ -0,0 +1,33 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using BaseKeycardItem = InventorySystem.Items.Keycards.KeycardItem;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerInspectedKeycardEventArgs : EventArgs, IPlayerEvent, IKeycardItemEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player who inspected the .
+ /// The keycard item.
+ public PlayerInspectedKeycardEventArgs(ReferenceHub hub, BaseKeycardItem keycardItem)
+ {
+ Player = Player.Get(hub);
+ KeycardItem = KeycardItem.Get(keycardItem);
+ }
+
+ ///
+ /// Gets the player who inspected the .
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the keycard item.
+ ///
+ public KeycardItem KeycardItem { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerInspectingKeycardEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerInspectingKeycardEventArgs.cs
new file mode 100644
index 00000000..668d4b87
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerInspectingKeycardEventArgs.cs
@@ -0,0 +1,37 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using BaseKeycardItem = InventorySystem.Items.Keycards.KeycardItem;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerInspectingKeycardEventArgs : EventArgs, IPlayerEvent, IKeycardItemEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player who wants to inspect the .
+ /// The keycard item.
+ public PlayerInspectingKeycardEventArgs(ReferenceHub hub, BaseKeycardItem keycardItem)
+ {
+ Player = Player.Get(hub);
+ KeycardItem = KeycardItem.Get(keycardItem);
+ IsAllowed = true;
+ }
+
+ ///
+ /// Gets the player who wants to inspect .
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the keycard item.
+ ///
+ public KeycardItem KeycardItem { get; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedDoorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedDoorEventArgs.cs
index 7a18c032..b63c2119 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedDoorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedDoorEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerInteractedDoorEventArgs : EventArgs, IPlayerEvent, IDoorEvent
///
/// Initializes a new instance of the class.
///
- /// The player who is interacting with the door.
+ /// The player who is interacting with the door.
/// The door that is being interacted with.
/// Whenever player can open the door.
- public PlayerInteractedDoorEventArgs(ReferenceHub player, DoorVariant door, bool canOpen)
+ public PlayerInteractedDoorEventArgs(ReferenceHub hub, DoorVariant door, bool canOpen)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Door = Door.Get(door);
CanOpen = canOpen;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedElevatorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedElevatorEventArgs.cs
index 3f672798..06795b30 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedElevatorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedElevatorEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerInteractedElevatorEventArgs : EventArgs, IPlayerEvent, IEleva
///
/// Initializes a new instance of the class.
///
- /// The player who interacted with elevator panel.
+ /// The player who interacted with elevator panel.
/// The elevator chamber.
/// The elevator panel that was interaction done with.
- public PlayerInteractedElevatorEventArgs(ReferenceHub player, ElevatorChamber elevator, ElevatorPanel panel)
+ public PlayerInteractedElevatorEventArgs(ReferenceHub hub, ElevatorChamber elevator, ElevatorPanel panel)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Elevator = Elevator.Get(elevator);
Panel = panel;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedGeneratorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedGeneratorEventArgs.cs
index 7b85020f..dad41929 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedGeneratorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedGeneratorEventArgs.cs
@@ -14,12 +14,12 @@ public class PlayerInteractedGeneratorEventArgs : EventArgs, IPlayerEvent, IGene
///
/// Initializes a new instance of the class.
///
- /// The player who interacted with the generator.
+ /// The player who interacted with the generator.
/// The generator object.
/// The collider ID.
- public PlayerInteractedGeneratorEventArgs(ReferenceHub player, Scp079Generator generator, GeneratorColliderId colliderId)
+ public PlayerInteractedGeneratorEventArgs(ReferenceHub hub, Scp079Generator generator, GeneratorColliderId colliderId)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Generator = Generator.Get(generator);
ColliderId = colliderId;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedLockerEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedLockerEventArgs.cs
index 13348fea..50f941fa 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedLockerEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedLockerEventArgs.cs
@@ -14,13 +14,13 @@ public class PlayerInteractedLockerEventArgs : EventArgs, IPlayerEvent, ILockerE
///
/// Initializes a new instance of the class.
///
- /// The player who is interacted with the locker.
+ /// The player who is interacted with the locker.
/// The locker that was interacted with.
/// The chamber that was targeted.
/// Whether the player was allowed to open it.
- public PlayerInteractedLockerEventArgs(ReferenceHub player, BaseLocker locker, BaseLockerChamber chamber, bool canOpen)
+ public PlayerInteractedLockerEventArgs(ReferenceHub hub, BaseLocker locker, BaseLockerChamber chamber, bool canOpen)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Locker = Locker.Get(locker);
Chamber = LockerChamber.Get(chamber);
CanOpen = canOpen;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedScp330EventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedScp330EventArgs.cs
index a357d661..513166cf 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedScp330EventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedScp330EventArgs.cs
@@ -1,8 +1,8 @@
-using LabApi.Events.Arguments.Interfaces;
+using CustomPlayerEffects;
+using InventorySystem.Items.Usables.Scp330;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
using System;
-using CustomPlayerEffects;
-using InventorySystem.Items.Usables.Scp330;
namespace LabApi.Events.Arguments.PlayerEvents;
@@ -14,14 +14,14 @@ public class PlayerInteractedScp330EventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who interacted with SCP-330.
+ /// The player who interacted with SCP-330.
/// The amount of uses that target player did.
/// Whenever pickup sound should have been.
/// Whenever the effect was applied.
/// Type of the candy which was given to the player.
- public PlayerInteractedScp330EventArgs(ReferenceHub player, int uses, bool playSound, bool allowPunishment, CandyKindID type)
+ public PlayerInteractedScp330EventArgs(ReferenceHub hub, int uses, bool playSound, bool allowPunishment, CandyKindID type)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Uses = uses;
PlaySound = playSound;
AllowPunishment = allowPunishment;
@@ -49,7 +49,7 @@ public PlayerInteractedScp330EventArgs(ReferenceHub player, int uses, bool playS
public bool AllowPunishment { get; }
///
- /// Gets the type of the candy that has been given to the player.
+ /// Gets the type of the candy that has been given to the player.
///
public CandyKindID CandyType { get; }
}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedShootingTargetEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedShootingTargetEventArgs.cs
index 7ff0e14c..03f02c3f 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedShootingTargetEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedShootingTargetEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerInteractedShootingTargetEventArgs : EventArgs, IPlayerEvent,
///
/// Initializes a new instance of the class.
///
- /// The player who interacted with the target.
+ /// The player who interacted with the target.
/// The shooting target.
- public PlayerInteractedShootingTargetEventArgs(ReferenceHub player, ShootingTarget target)
+ public PlayerInteractedShootingTargetEventArgs(ReferenceHub hub, ShootingTarget target)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
ShootingTarget = ShootingTargetToy.Get(target);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedToyEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedToyEventArgs.cs
index 255d4a64..4212ff5c 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedToyEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedToyEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerInteractedToyEventArgs : EventArgs, IPlayerEvent, IInteractab
///
/// Initializes a new instance of the class.
///
- /// The player who interacted with the toy.
+ /// The player who interacted with the toy.
/// The toy instance that was interacted with.
- public PlayerInteractedToyEventArgs(ReferenceHub player, InvisibleInteractableToy toy)
+ public PlayerInteractedToyEventArgs(ReferenceHub hub, InvisibleInteractableToy toy)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Interactable = InteractableToy.Get(toy);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedWarheadLeverEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedWarheadLeverEventArgs.cs
new file mode 100644
index 00000000..2f165fd4
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractedWarheadLeverEventArgs.cs
@@ -0,0 +1,30 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerInteractedWarheadLeverEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player who interacted with the lever.
+ /// Bool whether the warhead is enabled and can be started.
+ public PlayerInteractedWarheadLeverEventArgs(ReferenceHub player, bool enabled)
+ {
+ Player = Player.Get(player);
+ Enabled = enabled;
+ }
+
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets whether the warhead is now enabled.
+ ///
+ public bool Enabled { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingDoorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingDoorEventArgs.cs
index 012e450f..b08eedf9 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingDoorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingDoorEventArgs.cs
@@ -8,18 +8,18 @@ namespace LabApi.Events.Arguments.PlayerEvents;
///
/// Represents the arguments for the event.
///
-public class PlayerInteractingDoorEventArgs : EventArgs, IDoorEvent, ICancellableEvent
+public class PlayerInteractingDoorEventArgs : EventArgs, IDoorEvent, ICancellableEvent, IPlayerEvent
{
///
/// Initializes a new instance of the class.
///
- /// The player who is interacting with the door.
+ /// The player who is interacting with the door.
/// The door that is being interacted with.
/// Whenever player can open the door.
- public PlayerInteractingDoorEventArgs(ReferenceHub player, DoorVariant door, bool canOpen)
+ public PlayerInteractingDoorEventArgs(ReferenceHub hub, DoorVariant door, bool canOpen)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Door = Door.Get(door);
CanOpen = canOpen;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingElevatorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingElevatorEventArgs.cs
index 8197b0a6..db0b6ff4 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingElevatorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingElevatorEventArgs.cs
@@ -1,7 +1,7 @@
-using LabApi.Events.Arguments.Interfaces;
+using Interactables.Interobjects;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
using System;
-using Interactables.Interobjects;
namespace LabApi.Events.Arguments.PlayerEvents;
@@ -13,13 +13,13 @@ public class PlayerInteractingElevatorEventArgs : EventArgs, IPlayerEvent, IElev
///
/// Initializes a new instance of the class.
///
- /// The player who is interacting with the elevator.
+ /// The player who is interacting with the elevator.
/// The elevator.
/// The elevator panel.
- public PlayerInteractingElevatorEventArgs(ReferenceHub player, ElevatorChamber elevator, ElevatorPanel panel)
+ public PlayerInteractingElevatorEventArgs(ReferenceHub hub, ElevatorChamber elevator, ElevatorPanel panel)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Elevator = Elevator.Get(elevator);
Panel = panel;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingGeneratorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingGeneratorEventArgs.cs
index 72d0821b..406d7911 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingGeneratorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingGeneratorEventArgs.cs
@@ -14,13 +14,13 @@ public class PlayerInteractingGeneratorEventArgs : EventArgs, IPlayerEvent, IGen
///
/// Initializes a new instance of the class.
///
- /// The player who is interacting with the generator.
+ /// The player who is interacting with the generator.
/// The generator object.
/// The collider ID.
- public PlayerInteractingGeneratorEventArgs(ReferenceHub player, Scp079Generator generator, GeneratorColliderId colliderId)
+ public PlayerInteractingGeneratorEventArgs(ReferenceHub hub, Scp079Generator generator, GeneratorColliderId colliderId)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Generator = Generator.Get(generator);
ColliderId = colliderId;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingLockerEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingLockerEventArgs.cs
index 3538eb32..7db994d4 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingLockerEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingLockerEventArgs.cs
@@ -14,14 +14,14 @@ public class PlayerInteractingLockerEventArgs : EventArgs, IPlayerEvent, ILocker
///
/// Initializes a new instance of the class.
///
- /// The player who is interacting with the locker.
+ /// The player who is interacting with the locker.
/// The locker that is being interacted with.
/// The chamber that is being targeted.
/// Whether the player is allowed to open it.
- public PlayerInteractingLockerEventArgs(ReferenceHub player, BaseLocker locker, BaseLockerChamber chamber, bool canOpen)
+ public PlayerInteractingLockerEventArgs(ReferenceHub hub, BaseLocker locker, BaseLockerChamber chamber, bool canOpen)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Locker = Locker.Get(locker);
Chamber = LockerChamber.Get(chamber);
CanOpen = canOpen;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingScp330EventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingScp330EventArgs.cs
index f3f4c54f..16e8ae00 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingScp330EventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingScp330EventArgs.cs
@@ -1,8 +1,8 @@
-using LabApi.Events.Arguments.Interfaces;
+using CustomPlayerEffects;
+using InventorySystem.Items.Usables.Scp330;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
using System;
-using CustomPlayerEffects;
-using InventorySystem.Items.Usables.Scp330;
namespace LabApi.Events.Arguments.PlayerEvents;
@@ -14,15 +14,15 @@ public class PlayerInteractingScp330EventArgs : EventArgs, IPlayerEvent, ICancel
///
/// Initializes a new instance of the class.
///
- /// The player who is interacting with SCP-330.
+ /// The player who is interacting with SCP-330.
/// The amount of uses that target player did.
/// Whenever the sound should be played of pickup up candy.
/// Whenever the effect should be applied.
/// Type of the candy which will be given to the player.
- public PlayerInteractingScp330EventArgs(ReferenceHub player, int uses, bool playSound, bool allowPunishment, CandyKindID type)
+ public PlayerInteractingScp330EventArgs(ReferenceHub hub, int uses, bool playSound, bool allowPunishment, CandyKindID type)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Uses = uses;
PlaySound = playSound;
AllowPunishment = allowPunishment;
@@ -50,7 +50,7 @@ public PlayerInteractingScp330EventArgs(ReferenceHub player, int uses, bool play
public bool AllowPunishment { get; set; }
///
- /// Gets or sets the type of the candy that is given to the player.
+ /// Gets or sets the type of the candy that is given to the player.
///
/// Set or this to if you don't want to give candy to the player.
///
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingShootingTargetEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingShootingTargetEventArgs.cs
index df6805a6..f27d42a5 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingShootingTargetEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingShootingTargetEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerInteractingShootingTargetEventArgs : EventArgs, IPlayerEvent,
///
/// Initializes a new instance of the class.
///
- /// The player who is interacting with the target.
+ /// The player who is interacting with the target.
/// The shooting target.
- public PlayerInteractingShootingTargetEventArgs(ReferenceHub player, ShootingTarget target)
+ public PlayerInteractingShootingTargetEventArgs(ReferenceHub hub, ShootingTarget target)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
ShootingTarget = ShootingTargetToy.Get(target);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingWarheadLeverEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingWarheadLeverEventArgs.cs
new file mode 100644
index 00000000..8947ad74
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerInteractingWarheadLeverEventArgs.cs
@@ -0,0 +1,35 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerInteractingWarheadLeverEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player who is interacting with the lever.
+ /// Bool whether the warhead should be enabled and can be started.
+ public PlayerInteractingWarheadLeverEventArgs(ReferenceHub player, bool enabled)
+ {
+ Player = Player.Get(player);
+ Enabled = enabled;
+
+ IsAllowed = true;
+ }
+
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets or sets whether the warhead should be enabled.
+ ///
+ public bool Enabled { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerItemUsageEffectsApplyingEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerItemUsageEffectsApplyingEventArgs.cs
new file mode 100644
index 00000000..32cf63c4
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerItemUsageEffectsApplyingEventArgs.cs
@@ -0,0 +1,42 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using BaseUsableItem = InventorySystem.Items.Usables.UsableItem;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerItemUsageEffectsApplyingEventArgs : EventArgs, IPlayerEvent, IUsableItemEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The component of the player using the item.
+ /// The item that is being used.
+ public PlayerItemUsageEffectsApplyingEventArgs(ReferenceHub hub, BaseUsableItem item)
+ {
+ IsAllowed = true;
+ Player = Player.Get(hub);
+ UsableItem = UsableItem.Get(item);
+ }
+
+ ///
+ /// Gets the player using the item.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the item that is being used.
+ ///
+ public UsableItem UsableItem { get; }
+
+ ///
+ /// Get or sets whether or not to continue the using item process when the event is canceled.
+ ///
+ public bool ContinueProcess { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerJumpedEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerJumpedEventArgs.cs
new file mode 100644
index 00000000..166fdcd9
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerJumpedEventArgs.cs
@@ -0,0 +1,30 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerJumpedEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player who jumped.
+ /// Strength of the jump.
+ public PlayerJumpedEventArgs(ReferenceHub hub, float jumpStrength)
+ {
+ Player = Player.Get(hub);
+ JumpStrength = jumpStrength;
+ }
+
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the strength of the jump.
+ ///
+ public float JumpStrength { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerKickedEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerKickedEventArgs.cs
index e0b3cc9e..731659f2 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerKickedEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerKickedEventArgs.cs
@@ -12,12 +12,12 @@ public class PlayerKickedEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who was kicked.
+ /// The player who was kicked.
/// The player who issued the kick.
/// The reason for which is player being kicked.
- public PlayerKickedEventArgs(ReferenceHub player, ReferenceHub issuer, string reason)
+ public PlayerKickedEventArgs(ReferenceHub hub, ReferenceHub issuer, string reason)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Issuer = Player.Get(issuer);
Reason = reason;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerKickingEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerKickingEventArgs.cs
index f117cc37..aa841320 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerKickingEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerKickingEventArgs.cs
@@ -12,13 +12,13 @@ public class PlayerKickingEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
///
/// Initializes a new instance of the class.
///
- /// The player who is being kicked.
+ /// The player who is being kicked.
/// The player who is issuing the kick.
/// The reason for which is player being kicked.
- public PlayerKickingEventArgs(ReferenceHub player, ReferenceHub issuer, string reason)
+ public PlayerKickingEventArgs(ReferenceHub hub, ReferenceHub issuer, string reason)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Issuer = Player.Get(issuer);
Reason = reason;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerLeavingHazardEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerLeavingHazardEventArgs.cs
index 01e06192..3e67b63d 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerLeavingHazardEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerLeavingHazardEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerLeavingHazardEventArgs : EventArgs, IPlayerEvent, IHazardEven
///
/// Initializes a new instance of the class.
///
- /// The player who is leaving.
+ /// The player who is leaving.
/// The hazard that the player is leaving.
- public PlayerLeavingHazardEventArgs(ReferenceHub player, EnvironmentalHazard hazard)
+ public PlayerLeavingHazardEventArgs(ReferenceHub hub, EnvironmentalHazard hazard)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Hazard = Hazard.Get(hazard);
IsAllowed = true;
@@ -34,7 +34,7 @@ public PlayerLeavingHazardEventArgs(ReferenceHub player, EnvironmentalHazard haz
public Hazard Hazard { get; }
///
- /// Gets or sets whether the player is allowed to leave the hazard.
+ /// Gets or sets whether the player is allowed to leave the hazard.
/// Setting this to false will result in player keeping the hazard effects and the event will be fired again until it is allowed or the player is back within the hazard's range.
///
public bool IsAllowed { get; set; }
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerLeavingPocketDimensionEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerLeavingPocketDimensionEventArgs.cs
index e480979c..f78985e6 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerLeavingPocketDimensionEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerLeavingPocketDimensionEventArgs.cs
@@ -12,13 +12,13 @@ public class PlayerLeavingPocketDimensionEventArgs : EventArgs, IPlayerEvent, IC
///
/// Initializes a new instance of the class.
///
- /// The player who is trying to leave from pocket dimension.
+ /// The player who is trying to leave from pocket dimension.
/// The teleport the player collided with.
/// Whether it is gonna be success.
- public PlayerLeavingPocketDimensionEventArgs(ReferenceHub player, PocketDimensionTeleport teleport, bool isSuccessful)
+ public PlayerLeavingPocketDimensionEventArgs(ReferenceHub hub, PocketDimensionTeleport teleport, bool isSuccessful)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Teleport = PocketTeleport.Get(teleport);
IsSuccessful = isSuccessful;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerLeftEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerLeftEventArgs.cs
index fd4ace02..a7538446 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerLeftEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerLeftEventArgs.cs
@@ -12,10 +12,10 @@ public class PlayerLeftEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who left.
- public PlayerLeftEventArgs(ReferenceHub player)
+ /// The player who left.
+ public PlayerLeftEventArgs(ReferenceHub hub)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerLeftHazardEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerLeftHazardEventArgs.cs
index 7efcc852..2f70c2ed 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerLeftHazardEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerLeftHazardEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerLeftHazardEventArgs : EventArgs, IPlayerEvent, IHazardEvent
///
/// Initializes a new instance of the class.
///
- /// The player who left the hazard.
+ /// The player who left the hazard.
/// The hazard that the player left.
- public PlayerLeftHazardEventArgs(ReferenceHub player, EnvironmentalHazard hazard)
+ public PlayerLeftHazardEventArgs(ReferenceHub hub, EnvironmentalHazard hazard)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Hazard = Hazard.Get(hazard);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerLeftPocketDimensionEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerLeftPocketDimensionEventArgs.cs
index 5eac423d..667d4650 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerLeftPocketDimensionEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerLeftPocketDimensionEventArgs.cs
@@ -12,12 +12,12 @@ public class PlayerLeftPocketDimensionEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who tried to left pocket dimension.
+ /// The player who tried to left pocket dimension.
/// The teleport the player collided with.
/// Whether the escape was successful.
- public PlayerLeftPocketDimensionEventArgs(ReferenceHub player, PocketDimensionTeleport teleport, bool isSuccessful)
+ public PlayerLeftPocketDimensionEventArgs(ReferenceHub hub, PocketDimensionTeleport teleport, bool isSuccessful)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Teleport = PocketTeleport.Get(teleport);
IsSuccessful = isSuccessful;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerMovementStateChangedEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerMovementStateChangedEventArgs.cs
new file mode 100644
index 00000000..81a69600
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerMovementStateChangedEventArgs.cs
@@ -0,0 +1,38 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using PlayerRoles.FirstPersonControl;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerMovementStateChangedEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player whose movement state has changed.
+ /// Old movement state of the player.
+ /// New movement state of the player.
+ public PlayerMovementStateChangedEventArgs(ReferenceHub hub, PlayerMovementState oldState, PlayerMovementState newState)
+ {
+ Player = Player.Get(hub);
+ OldState = oldState;
+ NewState = newState;
+ }
+
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the old movement state.
+ ///
+ public PlayerMovementState OldState { get; }
+
+ ///
+ /// Gets the new movement state.
+ ///
+ public PlayerMovementState NewState { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerMutedEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerMutedEventArgs.cs
index 9dffcbd3..1e777544 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerMutedEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerMutedEventArgs.cs
@@ -12,12 +12,12 @@ public class PlayerMutedEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who was muted.
+ /// The player who was muted.
/// The player who issued the mute.
/// Whenever mute was applied to intercom.
- public PlayerMutedEventArgs(ReferenceHub player, ReferenceHub issuer, bool isIntercom)
+ public PlayerMutedEventArgs(ReferenceHub hub, ReferenceHub issuer, bool isIntercom)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Issuer = Player.Get(issuer);
IsIntercom = isIntercom;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerMutingEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerMutingEventArgs.cs
index 77c9e5d0..af506b62 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerMutingEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerMutingEventArgs.cs
@@ -12,13 +12,13 @@ public class PlayerMutingEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
///
/// Initializes a new instance of the class.
///
- /// The player who is being muted.
+ /// The player who is being muted.
/// The player who is issuing the mute.
/// Whenever mute is being applied to intercom.
- public PlayerMutingEventArgs(ReferenceHub player, ReferenceHub issuer, bool isIntercom)
+ public PlayerMutingEventArgs(ReferenceHub hub, ReferenceHub issuer, bool isIntercom)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Issuer = Player.Get(issuer);
IsIntercom = isIntercom;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerOpenedGeneratorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerOpenedGeneratorEventArgs.cs
index ddde7e0b..9a5982a9 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerOpenedGeneratorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerOpenedGeneratorEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerOpenedGeneratorEventArgs : EventArgs, IPlayerEvent, IGenerato
///
/// Initializes a new instance of the class.
///
- /// The player who opened the generator.
+ /// The player who opened the generator.
/// The generator that was opened.
- public PlayerOpenedGeneratorEventArgs(ReferenceHub player, Scp079Generator generator)
+ public PlayerOpenedGeneratorEventArgs(ReferenceHub hub, Scp079Generator generator)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Generator = Generator.Get(generator);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerOpeningGeneratorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerOpeningGeneratorEventArgs.cs
index b7722cef..2e036678 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerOpeningGeneratorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerOpeningGeneratorEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerOpeningGeneratorEventArgs : EventArgs, IPlayerEvent, IGenerat
///
/// Initializes a new instance of the class.
///
- /// The player who is opening the generator.
+ /// The player who is opening the generator.
/// The generator.
- public PlayerOpeningGeneratorEventArgs(ReferenceHub player, Scp079Generator generator)
+ public PlayerOpeningGeneratorEventArgs(ReferenceHub hub, Scp079Generator generator)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Generator = Generator.Get(generator);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerPickedUpAmmoEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerPickedUpAmmoEventArgs.cs
index 125aeb02..4b818777 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerPickedUpAmmoEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerPickedUpAmmoEventArgs.cs
@@ -13,13 +13,13 @@ public class PlayerPickedUpAmmoEventArgs : EventArgs, IPlayerEvent, IAmmoPickupE
///
/// Initializes a new instance of the class.
///
- /// The player that picked up the ammo.
+ /// The player that picked up the ammo.
/// Type of the ammo.
/// The amount that is was picked up.
/// The pickup object.
- public PlayerPickedUpAmmoEventArgs(ReferenceHub player, ItemType ammoType, ushort ammoAmount, BaseAmmoPickup pickup)
+ public PlayerPickedUpAmmoEventArgs(ReferenceHub hub, ItemType ammoType, ushort ammoAmount, BaseAmmoPickup pickup)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
AmmoType = ammoType;
AmmoAmount = ammoAmount;
AmmoPickup = AmmoPickup.Get(pickup);
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerPickedUpArmorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerPickedUpArmorEventArgs.cs
index ddfdd6e3..7ca160b6 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerPickedUpArmorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerPickedUpArmorEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerPickedUpArmorEventArgs : EventArgs, IPlayerEvent, IBodyArmorI
///
/// Initializes a new instance of the class.
///
- /// The player who picked up armor.
+ /// The player who picked up armor.
/// The armor that was picked up.
- public PlayerPickedUpArmorEventArgs(ReferenceHub player, BodyArmor? armor)
+ public PlayerPickedUpArmorEventArgs(ReferenceHub hub, BodyArmor? armor)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
BodyArmorItem = BodyArmorItem.Get(armor);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerPickedUpItemEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerPickedUpItemEventArgs.cs
index f5c7e37f..618d429e 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerPickedUpItemEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerPickedUpItemEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerPickedUpItemEventArgs : EventArgs, IPlayerEvent, IItemEvent
///
/// Initializes a new instance of the class.
///
- /// The player who picked up the item.
+ /// The player who picked up the item.
/// The item that was picked up.
- public PlayerPickedUpItemEventArgs(ReferenceHub player, ItemBase item)
+ public PlayerPickedUpItemEventArgs(ReferenceHub hub, ItemBase item)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Item = Item.Get(item);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerPickedUpScp330EventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerPickedUpScp330EventArgs.cs
index e82caa6d..ad357475 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerPickedUpScp330EventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerPickedUpScp330EventArgs.cs
@@ -1,8 +1,8 @@
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
using System;
-using BaseScp330Pickup = InventorySystem.Items.Usables.Scp330.Scp330Pickup;
using BaseScp330Bag = InventorySystem.Items.Usables.Scp330.Scp330Bag;
+using BaseScp330Pickup = InventorySystem.Items.Usables.Scp330.Scp330Pickup;
namespace LabApi.Events.Arguments.PlayerEvents;
@@ -14,12 +14,12 @@ public class PlayerPickedUpScp330EventArgs : EventArgs, IPlayerEvent, ICandyItem
///
/// Initializes a new instance of the class.
///
- /// The player who picked up SCP-330.
+ /// The player who picked up SCP-330.
/// The pickup item.
/// SCP-330 bag item of the player.
- public PlayerPickedUpScp330EventArgs(ReferenceHub player, BaseScp330Pickup pickup, BaseScp330Bag item)
+ public PlayerPickedUpScp330EventArgs(ReferenceHub hub, BaseScp330Pickup pickup, BaseScp330Bag item)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
CandyPickup = Scp330Pickup.Get(pickup);
CandyItem = Scp330Item.Get(item);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerPickingUpAmmoEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerPickingUpAmmoEventArgs.cs
index 5117fa08..a4c6f4d6 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerPickingUpAmmoEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerPickingUpAmmoEventArgs.cs
@@ -13,14 +13,14 @@ public class PlayerPickingUpAmmoEventArgs : EventArgs, IPlayerEvent, IAmmoPickup
///
/// Initializes a new instance of the class.
///
- /// The player who is pickup the ammo pickup.
+ /// The player who is pickup the ammo pickup.
/// Type of the ammo.
/// Amount of ammo that is being picked up.
/// Ammo pickup.
- public PlayerPickingUpAmmoEventArgs(ReferenceHub player, ItemType ammoType, ushort ammoAmount, BaseAmmoPickup pickup)
+ public PlayerPickingUpAmmoEventArgs(ReferenceHub hub, ItemType ammoType, ushort ammoAmount, BaseAmmoPickup pickup)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
AmmoType = ammoType;
AmmoAmount = ammoAmount;
AmmoPickup = AmmoPickup.Get(pickup);
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerPickingUpArmorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerPickingUpArmorEventArgs.cs
index b3e39e8a..d3627f14 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerPickingUpArmorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerPickingUpArmorEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerPickingUpArmorEventArgs : EventArgs, IPlayerEvent, IBodyArmor
///
/// Initializes a new instance of the class.
///
- /// The player who picked up the armor.
+ /// The player who picked up the armor.
/// The armor pickup.
- public PlayerPickingUpArmorEventArgs(ReferenceHub player, BaseBodyArmorPickup pickup)
+ public PlayerPickingUpArmorEventArgs(ReferenceHub hub, BaseBodyArmorPickup pickup)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
BodyArmorPickup = BodyArmorPickup.Get(pickup);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerPickingUpItemEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerPickingUpItemEventArgs.cs
index 4b358e8b..ca21e90d 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerPickingUpItemEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerPickingUpItemEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerPickingUpItemEventArgs : EventArgs, IPlayerEvent, IPickupEven
///
/// Initializes a new instance of the class.
///
- /// The player who picked up the item.
+ /// The player who picked up the item.
/// The item pickup.
- public PlayerPickingUpItemEventArgs(ReferenceHub player, ItemPickupBase pickup)
+ public PlayerPickingUpItemEventArgs(ReferenceHub hub, ItemPickupBase pickup)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Pickup = Pickup.Get(pickup);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerPickingUpScp330EventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerPickingUpScp330EventArgs.cs
index 871c1048..002743de 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerPickingUpScp330EventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerPickingUpScp330EventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerPickingUpScp330EventArgs : EventArgs, IPlayerEvent, ICandyPic
///
/// Initializes a new instance of the class.
///
- /// The player who is picking up SCP-330.
+ /// The player who is picking up SCP-330.
/// The SCP-330 pickup.
- public PlayerPickingUpScp330EventArgs(ReferenceHub player, BaseScp330Pickup pickup)
+ public PlayerPickingUpScp330EventArgs(ReferenceHub hub, BaseScp330Pickup pickup)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
CandyPickup = Scp330Pickup.Get(pickup);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerPlacedBloodEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerPlacedBloodEventArgs.cs
index e4385b58..4d76ffa7 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerPlacedBloodEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerPlacedBloodEventArgs.cs
@@ -13,13 +13,13 @@ public class PlayerPlacedBloodEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player whose blood it is.
+ /// 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, ReferenceHub attacker, Vector3 hitPosition, Vector3 startRaycast)
+ public PlayerPlacedBloodEventArgs(ReferenceHub hub, ReferenceHub attacker, Vector3 hitPosition, Vector3 startRaycast)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Attacker = Player.Get(attacker);
HitPosition = hitPosition;
RaycastStart = startRaycast;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerPlacedBulletHole.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerPlacedBulletHoleEventArgs.cs
similarity index 81%
rename from LabApi/Events/Arguments/PlayerEvents/PlayerPlacedBulletHole.cs
rename to LabApi/Events/Arguments/PlayerEvents/PlayerPlacedBulletHoleEventArgs.cs
index 0c9bab18..05f4790a 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerPlacedBulletHole.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerPlacedBulletHoleEventArgs.cs
@@ -5,21 +5,23 @@
namespace LabApi.Events.Arguments.PlayerEvents;
+using Interfaces;
+
///
/// Represents the arguments for the event.
///
-public class PlayerPlacedBulletHoleEventArgs : EventArgs
+public class PlayerPlacedBulletHoleEventArgs : EventArgs, IPlayerEvent
{
///
/// Initializes a new instance of the class.
///
- /// The player who caused this bullet hole.
+ /// The player who caused this bullet hole.
/// Decal type which has spawned.
/// Position at which bullet hole has spawned.
/// Position where the bullet hole raycast has started for it to be properly attached to surface.
- public PlayerPlacedBulletHoleEventArgs(ReferenceHub player, DecalPoolType type, Vector3 hitPosition, Vector3 startRaycast)
+ public PlayerPlacedBulletHoleEventArgs(ReferenceHub hub, DecalPoolType type, Vector3 hitPosition, Vector3 startRaycast)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
DecalType = type;
HitPosition = hitPosition;
RaycastStart = startRaycast;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerPlacingBloodEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerPlacingBloodEventArgs.cs
index cf28fff4..a34c4451 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerPlacingBloodEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerPlacingBloodEventArgs.cs
@@ -13,14 +13,14 @@ public class PlayerPlacingBloodEventArgs : EventArgs, IPlayerEvent, ICancellable
///
/// Initializes a new instance of the class.
///
- /// The player whose blood it is.
+ /// 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, ReferenceHub attacker, Vector3 hitPosition, Vector3 startRaycast)
+ public PlayerPlacingBloodEventArgs(ReferenceHub hub, ReferenceHub attacker, Vector3 hitPosition, Vector3 startRaycast)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Attacker = Player.Get(attacker);
HitPosition = hitPosition;
RaycastStart = startRaycast;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerPlacingBulletHoleEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerPlacingBulletHoleEventArgs.cs
index ca82271a..a9929378 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerPlacingBulletHoleEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerPlacingBulletHoleEventArgs.cs
@@ -14,14 +14,14 @@ public class PlayerPlacingBulletHoleEventArgs : EventArgs, IPlayerEvent, ICancel
///
/// Initializes a new instance of the class.
///
- /// The player who caused it.
+ /// The player who caused it.
/// Decal type to be spawned.
/// Position at which is bullet hole being placed.
/// Position where the bullet hole raycast will start for it to be properly attached to surface.
- public PlayerPlacingBulletHoleEventArgs(ReferenceHub player, DecalPoolType type, Vector3 hitPosition, Vector3 startRaycast)
+ public PlayerPlacingBulletHoleEventArgs(ReferenceHub hub, DecalPoolType type, Vector3 hitPosition, Vector3 startRaycast)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
DecalType = type;
HitPosition = hitPosition;
RaycastStart = startRaycast;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerPreAuthenticatingEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerPreAuthenticatingEventArgs.cs
index 7eace2d9..bda0c398 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerPreAuthenticatingEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerPreAuthenticatingEventArgs.cs
@@ -37,7 +37,7 @@ public PlayerPreAuthenticatingEventArgs(bool canJoin, string userId, string ipAd
}
///
- /// Gets or sets whether the player should be able to join server. ( this value can be false if server is full )
+ /// Gets or sets whether the player should be able to join server (this value can be false if server is full).
///
public bool CanJoin { get; set; }
@@ -92,7 +92,7 @@ public PlayerPreAuthenticatingEventArgs(bool canJoin, string userId, string ipAd
///
/// Gets or sets the custom rejection writer.
///
- //TODO: Write what exactly this does and how does it work
+ // TODO: Write what exactly this does and how does it work
public NetDataWriter? CustomReject { get; set; }
///
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerProcessedJailbirdMessageEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerProcessedJailbirdMessageEventArgs.cs
new file mode 100644
index 00000000..5cd7c4b4
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerProcessedJailbirdMessageEventArgs.cs
@@ -0,0 +1,42 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Events.Arguments.Interfaces.Items;
+using LabApi.Features.Wrappers;
+using System;
+using BaseJailbirdItem = InventorySystem.Items.Jailbird.JailbirdItem;
+using JailbirdMessageType = InventorySystem.Items.Jailbird.JailbirdMessageType;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerProcessedJailbirdMessageEventArgs : EventArgs, IPlayerEvent, IJailbirdEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The component of the player that owns the jailbird.
+ /// Jailbird the message is for.
+ /// The message sent by the player for the jailbird.
+ public PlayerProcessedJailbirdMessageEventArgs(ReferenceHub hub, BaseJailbirdItem jailbird, JailbirdMessageType msg)
+ {
+ Player = Player.Get(hub);
+ JailbirdItem = JailbirdItem.Get(jailbird);
+ Message = msg;
+ }
+
+ ///
+ /// The owner of the jailbird.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The jailbird item.
+ ///
+ public JailbirdItem JailbirdItem { get; }
+
+ ///
+ /// The processed.
+ ///
+ public JailbirdMessageType Message { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerProcessingJailbirdMessageEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerProcessingJailbirdMessageEventArgs.cs
new file mode 100644
index 00000000..4e05e939
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerProcessingJailbirdMessageEventArgs.cs
@@ -0,0 +1,60 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Events.Arguments.Interfaces.Items;
+using LabApi.Features.Wrappers;
+using System;
+using BaseJailbirdItem = InventorySystem.Items.Jailbird.JailbirdItem;
+using JailbirdMessageType = InventorySystem.Items.Jailbird.JailbirdMessageType;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerProcessingJailbirdMessageEventArgs : EventArgs, IPlayerEvent, IJailbirdEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The component of the player that owns the jailbird.
+ /// Jailbird the message is for.
+ /// The message sent by the player for the jailbird.
+ /// Whether an attack is allowed to start.
+ /// Whether an inspect is allowed to start.
+ public PlayerProcessingJailbirdMessageEventArgs(ReferenceHub hub, BaseJailbirdItem jailbird, JailbirdMessageType msg, bool allowAttack, bool allowInspect)
+ {
+ Player = Player.Get(hub);
+ JailbirdItem = JailbirdItem.Get(jailbird);
+ Message = msg;
+ AllowAttack = allowAttack;
+ AllowInspect = allowInspect;
+ IsAllowed = true;
+ }
+
+ ///
+ /// The owner of the jailbird.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The jailbird item.
+ ///
+ public JailbirdItem JailbirdItem { get; }
+
+ ///
+ /// Gets or sets the sent by the player.
+ ///
+ public JailbirdMessageType Message { get; set; }
+
+ ///
+ /// Gets or sets whether starting an attack is allowed.
+ ///
+ public bool AllowAttack { get; set; }
+
+ ///
+ /// Gets or sets whether starting an inspect is allowed.
+ ///
+ public bool AllowInspect { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerRaPlayerListAddedPlayerEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerRaPlayerListAddedPlayerEventArgs.cs
new file mode 100644
index 00000000..ecc2bda7
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerRaPlayerListAddedPlayerEventArgs.cs
@@ -0,0 +1,43 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using System.Text;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerRaPlayerListAddedPlayerEventArgs : EventArgs, IPlayerEvent, ITargetEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The instance of the player that made the request for the RA player list.
+ /// The component of the player that is being added to the RA player list.
+ /// The used to build the RA player list item.
+ public PlayerRaPlayerListAddedPlayerEventArgs(CommandSender requesterHub, ReferenceHub targetHub, StringBuilder builder)
+ {
+ Player = Player.Get(requesterHub)!;
+ Target = Player.Get(targetHub);
+ TargetBuilder = builder;
+ }
+
+ ///
+ /// The player that requested the RA player list.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The player that was added to the RA player list.
+ ///
+ public Player Target { get; }
+
+ ///
+ /// The used to construct the RA player list item for the .
+ ///
+ ///
+ /// String builder is not empty in this event and contains the RA list item for the .
+ ///
+ public StringBuilder TargetBuilder { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerRaPlayerListAddingPlayerEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerRaPlayerListAddingPlayerEventArgs.cs
new file mode 100644
index 00000000..abe6a3a6
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerRaPlayerListAddingPlayerEventArgs.cs
@@ -0,0 +1,85 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using System.Text;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerRaPlayerListAddingPlayerEventArgs : EventArgs, IPlayerEvent, ITargetEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The instance of the player that made the request for the RA player list.
+ /// The component of the player that is being added to the RA player list.
+ /// The used to build the RA player list item.
+ /// The prefix string for the RA list item.
+ /// Whether to include the overwatch icon in the list item.
+ /// Whether to include the is muted icon and link in the list item.
+ /// The body string for the Ra list item.
+ public PlayerRaPlayerListAddingPlayerEventArgs(
+ CommandSender commandSender,
+ ReferenceHub targetHub,
+ StringBuilder builder,
+ string prefix,
+ bool inOverwatch,
+ bool isMuted,
+ string body)
+ {
+ Player = Player.Get(commandSender)!;
+ Target = Player.Get(targetHub);
+ TargetBuilder = builder;
+ Prefix = prefix;
+ InOverwatch = inOverwatch;
+ IsMuted = isMuted;
+ Body = body;
+ IsAllowed = true;
+ }
+
+ ///
+ /// The player that requested the RA player list.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The player being added to the RA player list.
+ ///
+ public Player Target { get; }
+
+ ///
+ /// The used to construct the RA player list item for the .
+ ///
+ ///
+ /// String builder is empty in this event.
+ ///
+ public StringBuilder TargetBuilder { get; }
+
+ ///
+ /// Gets or sets the RA player list item prefix.
+ /// Can contain a RA badge and/or link for whether the is one of either a Dummy, has RemoteAdminGlobalAccess, is NorthwoodStaff, or has RemoteAdmin.
+ /// Otherwise this is .
+ ///
+ public string Prefix { get; set; }
+
+ ///
+ /// Gets or sets whether the appears to be in overwatch on the RA player list.
+ ///
+ public bool InOverwatch { get; set; }
+
+ ///
+ /// Gets or sets whether the appears to be muted on the RA player list.
+ ///
+ public bool IsMuted { get; set; }
+
+ ///
+ /// Gets or sets the RA player list item body.
+ /// Contains the color tags, identifier as the and of the .
+ ///
+ public string Body { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerReceivedAchievementEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerReceivedAchievementEventArgs.cs
new file mode 100644
index 00000000..0f9fcdd2
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerReceivedAchievementEventArgs.cs
@@ -0,0 +1,34 @@
+using Achievements;
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using Mirror;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the argument for the event.
+///
+public class PlayerReceivedAchievementEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The component of the player.
+ /// The being granted.
+ public PlayerReceivedAchievementEventArgs(NetworkIdentity identity, AchievementName name)
+ {
+ Player = Player.Get(identity);
+ Achievement = name;
+ }
+
+ ///
+ /// The player that getting the achievement.
+ ///
+ public Player? Player { get; }
+
+ ///
+ /// The of the achievement.
+ ///
+ public AchievementName Achievement { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerReceivedLoadoutEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerReceivedLoadoutEventArgs.cs
index fd2d86c7..44fe9d79 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerReceivedLoadoutEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerReceivedLoadoutEventArgs.cs
@@ -13,13 +13,13 @@ public class PlayerReceivedLoadoutEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player instance.
+ /// The player instance.
/// The items which player received.
/// The ammo which player received.
/// If players inventory did reset.
- public PlayerReceivedLoadoutEventArgs(ReferenceHub player, List items, Dictionary ammo, bool inventoryReset)
+ public PlayerReceivedLoadoutEventArgs(ReferenceHub hub, List items, Dictionary ammo, bool inventoryReset)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Items = items;
Ammo = ammo;
InventoryReset = inventoryReset;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerReceivingLoadoutEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerReceivingLoadoutEventArgs.cs
index 9e71d4bb..7ff4b159 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerReceivingLoadoutEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerReceivingLoadoutEventArgs.cs
@@ -13,14 +13,14 @@ public class PlayerReceivingLoadoutEventArgs : EventArgs, IPlayerEvent, ICancell
///
/// Initializes a new instance of the class.
///
- /// The player instance.
+ /// The player instance.
/// The items which player received.
/// The ammo which player received.
/// If players inventory will be cleared.
- public PlayerReceivingLoadoutEventArgs(ReferenceHub player, List items, Dictionary ammo, bool inventoryReset)
+ public PlayerReceivingLoadoutEventArgs(ReferenceHub hub, List items, Dictionary ammo, bool inventoryReset)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Items = items;
Ammo = ammo;
InventoryReset = inventoryReset;
@@ -50,7 +50,7 @@ public PlayerReceivingLoadoutEventArgs(ReferenceHub player, List items
public bool IsAllowed { get; set; }
///
- /// Adds item of specifc type to this loadout.
+ /// Adds item of specific type to this loadout.
///
/// The type of item.
public void AddItem(ItemType type) => Items.Add(type);
@@ -63,9 +63,13 @@ public PlayerReceivingLoadoutEventArgs(ReferenceHub player, List items
public void AddAmmo(ItemType ammoType, ushort ammoAmount)
{
if (Ammo.ContainsKey(ammoType))
+ {
Ammo[ammoType] += ammoAmount;
+ }
else
+ {
Ammo.Add(ammoType, ammoAmount);
+ }
}
///
@@ -76,9 +80,13 @@ public void AddAmmo(ItemType ammoType, ushort ammoAmount)
public void SetAmmo(ItemType ammoType, ushort ammoAmount)
{
if (Ammo.ContainsKey(ammoType))
+ {
Ammo[ammoType] = ammoAmount;
+ }
else
+ {
Ammo.Add(ammoType, ammoAmount);
+ }
}
///
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerReceivingVoiceMessageEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerReceivingVoiceMessageEventArgs.cs
index 900b07d7..8b60ebc5 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerReceivingVoiceMessageEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerReceivingVoiceMessageEventArgs.cs
@@ -10,6 +10,8 @@ namespace LabApi.Events.Arguments.PlayerEvents;
///
public class PlayerReceivingVoiceMessageEventArgs : EventArgs, ICancellableEvent, IPlayerEvent, IVoiceMessageEvent
{
+ private VoiceMessage _message;
+
///
/// Initializes a new instance of the class.
///
@@ -45,6 +47,4 @@ public PlayerReceivingVoiceMessageEventArgs(ReferenceHub listener, ref VoiceMess
/// this will be ignored.
///
public bool IsAllowed { get; set; }
-
- private VoiceMessage _message;
}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerReloadedWeaponEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerReloadedWeaponEventArgs.cs
index 8e050093..3cbfe389 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerReloadedWeaponEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerReloadedWeaponEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerReloadedWeaponEventArgs : EventArgs, IPlayerEvent, IFirearmIt
///
/// Initializes a new instance of the class.
///
- /// The player who reloaded the weapon.
+ /// The player who reloaded the weapon.
/// The weapon that was reloaded.
- public PlayerReloadedWeaponEventArgs(ReferenceHub player, Firearm weapon)
+ public PlayerReloadedWeaponEventArgs(ReferenceHub hub, Firearm weapon)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
FirearmItem = FirearmItem.Get(weapon);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerReloadingWeaponEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerReloadingWeaponEventArgs.cs
index f98f9781..94ae6744 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerReloadingWeaponEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerReloadingWeaponEventArgs.cs
@@ -8,17 +8,17 @@ namespace LabApi.Events.Arguments.PlayerEvents;
///
/// Represents the arguments for the event.
///
-public class PlayerReloadingWeaponEventArgs : EventArgs, IFirearmItemEvent, ICancellableEvent
+public class PlayerReloadingWeaponEventArgs : EventArgs, IFirearmItemEvent, ICancellableEvent, IPlayerEvent
{
///
/// Initializes a new instance of the class.
///
- /// The player who is reloading the weapon.
+ /// The player who is reloading the weapon.
/// The weapon that is being reloaded.
- public PlayerReloadingWeaponEventArgs(ReferenceHub player, Firearm weapon)
+ public PlayerReloadingWeaponEventArgs(ReferenceHub hub, Firearm weapon)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
FirearmItem = FirearmItem.Get(weapon);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerReportedCheaterEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerReportedCheaterEventArgs.cs
index bab934f8..1fe80768 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerReportedCheaterEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerReportedCheaterEventArgs.cs
@@ -12,12 +12,12 @@ public class PlayerReportedCheaterEventArgs : EventArgs, IPlayerEvent, ITargetEv
///
/// Initializes a new instance of the class.
///
- /// The player who sent the report.
+ /// The player who sent the report.
/// The reported player.
/// The reason why is the player being reported.
- public PlayerReportedCheaterEventArgs(ReferenceHub player, ReferenceHub target, string reason)
+ public PlayerReportedCheaterEventArgs(ReferenceHub hub, ReferenceHub target, string reason)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Target = Player.Get(target);
Reason = reason;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerReportedPlayerEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerReportedPlayerEventArgs.cs
index c2fa1535..bdf4c742 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerReportedPlayerEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerReportedPlayerEventArgs.cs
@@ -12,12 +12,12 @@ public class PlayerReportedPlayerEventArgs : EventArgs, IPlayerEvent, ITargetEve
///
/// Initializes a new instance of the class.
///
- /// The player who sent reported.
+ /// The player who sent reported.
/// The player who was reported.
/// The reason why was the player reported.
- public PlayerReportedPlayerEventArgs(ReferenceHub player, ReferenceHub target, string reason)
+ public PlayerReportedPlayerEventArgs(ReferenceHub hub, ReferenceHub target, string reason)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Target = Player.Get(target);
Reason = reason;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerReportingCheaterEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerReportingCheaterEventArgs.cs
index a0415daa..8f0b4ac7 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerReportingCheaterEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerReportingCheaterEventArgs.cs
@@ -12,13 +12,13 @@ public class PlayerReportingCheaterEventArgs : EventArgs, IPlayerEvent, ITargetE
///
/// Initializes a new instance of the class.
///
- /// The player who is reporting.
+ /// The player who is reporting.
/// The reported player.
/// The reason why is the player being reported.
- public PlayerReportingCheaterEventArgs(ReferenceHub player, ReferenceHub target, string reason)
+ public PlayerReportingCheaterEventArgs(ReferenceHub hub, ReferenceHub target, string reason)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Target = Player.Get(target);
Reason = reason;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerReportingPlayerEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerReportingPlayerEventArgs.cs
index 11771f3e..aa5d5732 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerReportingPlayerEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerReportingPlayerEventArgs.cs
@@ -12,13 +12,13 @@ public class PlayerReportingPlayerEventArgs : EventArgs, IPlayerEvent, ITargetEv
///
/// Initializes a new instance of the class.
///
- /// The player who is reporting.
+ /// The player who is reporting.
/// The player who is being reported.
/// The reason why was player reported.
- public PlayerReportingPlayerEventArgs(ReferenceHub player, ReferenceHub target, string reason)
+ public PlayerReportingPlayerEventArgs(ReferenceHub hub, ReferenceHub target, string reason)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Target = Player.Get(target);
Reason = reason;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerRequestedCustomRaInfoEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerRequestedCustomRaInfoEventArgs.cs
new file mode 100644
index 00000000..c49cdd72
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerRequestedCustomRaInfoEventArgs.cs
@@ -0,0 +1,118 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+using System.Text;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerRequestedCustomRaInfoEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Max number of clipboard links that can be created with .
+ ///
+ public const int MaxClipboardCount = 3;
+
+ private string[]? _clipboardTexts = null;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The instance of the player making the request.
+ /// The request arguments.
+ /// Whether the info being requested is sensitive.
+ /// The use to build the response.
+ public PlayerRequestedCustomRaInfoEventArgs(
+ CommandSender commandSender,
+ ArraySegment selectionArgs,
+ bool isSensitiveInfo,
+ StringBuilder infoBuilder)
+ {
+ Player = Player.Get(commandSender)!;
+ SelectedIdentifiers = selectionArgs.First().Split(".");
+ IsSensitiveInfo = isSensitiveInfo;
+ InfoBuilder = infoBuilder;
+ }
+
+ ///
+ /// The player that made the request.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Array of identifiers selected by the player.
+ /// Identifiers come from items in the RA player list that have been placed by plugins .
+ ///
+ public string[] SelectedIdentifiers { get; }
+
+ ///
+ /// Gets whether the requested sensitive info.
+ ///
+ public bool IsSensitiveInfo { get; }
+
+ ///
+ /// Gets the used to construct the response message.
+ ///
+ public StringBuilder InfoBuilder { get; }
+
+ ///
+ /// Creates a clipboard link for the RA.
+ ///
+ ///
+ /// Usage ev.InfoBuilder.Append(ev.SetClipboardText("Click Me", "Text to copy to clipboard on click", 0));.
+ ///
+ /// Text to display as the link.
+ /// Text to copy to the clipboard when clicking on the link.
+ /// The id of the clipboard, must be between 0 and .
+ /// The formated clipboard link text.
+ /// Thown when id is not between 0 and .
+ public string SetClipboardText(string linkText, string clipboardText, byte id)
+ {
+ if (id >= MaxClipboardCount)
+ {
+ throw new ArgumentOutOfRangeException(nameof(id), id, $"id must be between 0 and {MaxClipboardCount}");
+ }
+
+ _clipboardTexts ??= new string[MaxClipboardCount];
+ _clipboardTexts[id] = clipboardText;
+
+ return $"{linkText}";
+ }
+
+ ///
+ /// Tries to get clipboard text for the specific id.
+ ///
+ /// The id associated with the clipboard text.
+ /// The found text, otherwise .
+ /// if set and not empty, otherwise .
+ /// Thown when id is not between 0 and .
+ public bool TryGetClipboardText(byte id, [NotNullWhen(true)] out string? text)
+ {
+ if (id >= MaxClipboardCount)
+ {
+ throw new ArgumentOutOfRangeException(nameof(id), id, $"id must be between 0 and {MaxClipboardCount}");
+ }
+
+ text = null;
+
+ if (_clipboardTexts == null)
+ {
+ return false;
+ }
+
+ text = _clipboardTexts[id];
+ return !string.IsNullOrEmpty(text);
+ }
+
+ private string LinkIdForClipboardId(byte id) => id switch
+ {
+ 0 => "CP_ID",
+ 1 => "CP_IP",
+ 2 => "CP_USERID",
+ _ => throw new ArgumentOutOfRangeException(nameof(id), id, $"id must be between 0 and {MaxClipboardCount}"),
+ };
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerRequestedRaPlayerInfoEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerRequestedRaPlayerInfoEventArgs.cs
new file mode 100644
index 00000000..2fe49664
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerRequestedRaPlayerInfoEventArgs.cs
@@ -0,0 +1,83 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using System.Text;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerRequestedRaPlayerInfoEventArgs : EventArgs, IPlayerEvent, ITargetEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The instance of the player making the request.
+ /// The component of the selected target.
+ /// Whether the info being requested is sensitive.
+ /// Whether the player has perms to view the user id of the target.
+ /// The used to construct the response message.
+ /// The used to construct the clipboard text of the targets player id.
+ /// The used to construct the clipboard text of the targets ip address.
+ /// The used to construct the clipboard text of the targets user id.
+ public PlayerRequestedRaPlayerInfoEventArgs(
+ CommandSender commandSender,
+ ReferenceHub targetHub,
+ bool isSensitiveInfo,
+ bool hasUserIdPerms,
+ StringBuilder infoBuilder,
+ StringBuilder idBuilder,
+ StringBuilder ipBuilder,
+ StringBuilder userIdBuilder)
+ {
+ Player = Player.Get(commandSender)!;
+ Target = Player.Get(targetHub);
+ IsSensitiveInfo = isSensitiveInfo;
+ HasUserIdPerms = hasUserIdPerms;
+ InfoBuilder = infoBuilder;
+ PlayerIdBuilder = idBuilder;
+ IpBuilder = ipBuilder;
+ UserIdBuilder = userIdBuilder;
+ }
+
+ ///
+ /// The player that made the request.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The target player selected.
+ ///
+ public Player Target { get; }
+
+ ///
+ /// Whether the requested sensitive info.
+ ///
+ public bool IsSensitiveInfo { get; }
+
+ ///
+ /// Whether the has permission to view the user id of the .
+ ///
+ public bool HasUserIdPerms { get; }
+
+ ///
+ /// The used to construct the response message.
+ ///
+ public StringBuilder InfoBuilder { get; }
+
+ ///
+ /// The used to construct the clipboard text of the targets player id.
+ ///
+ public StringBuilder PlayerIdBuilder { get; }
+
+ ///
+ /// The used to construct the clipboard text of the targets ip address.
+ ///
+ public StringBuilder IpBuilder { get; }
+
+ ///
+ /// The used to construct the clipboard text of the targets user id.
+ ///
+ public StringBuilder UserIdBuilder { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerRequestedRaPlayerListEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerRequestedRaPlayerListEventArgs.cs
new file mode 100644
index 00000000..319ad882
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerRequestedRaPlayerListEventArgs.cs
@@ -0,0 +1,36 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using System.Text;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerRequestedRaPlayerListEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The instance of the player that made the request for the RA player list.
+ /// The used to build the RA player list.
+ public PlayerRequestedRaPlayerListEventArgs(CommandSender commandSender, StringBuilder builder)
+ {
+ Player = Player.Get(commandSender)!;
+ ListBuilder = builder;
+ }
+
+ ///
+ /// The player that requested the RA player list.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The used to construct the RA player list.
+ ///
+ ///
+ /// String builder is not empty in this event and contains the RA list.
+ ///
+ public StringBuilder ListBuilder { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerRequestedRaPlayersInfoEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerRequestedRaPlayersInfoEventArgs.cs
new file mode 100644
index 00000000..09c01901
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerRequestedRaPlayersInfoEventArgs.cs
@@ -0,0 +1,87 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerRequestedRaPlayersInfoEventArgs : EventArgs, IPlayerEvent
+{
+ private readonly IEnumerable _targets;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The instance of the player making the request.
+ /// The reference hub components of the targets selected in the request.
+ /// Whether the info being requested is sensitive.
+ /// Whether the player has perms to view the user ids of the targets.
+ /// The used to build the response.
+ /// The used to build the clipboard text for the targets ids.
+ /// The used to build the clipboard text for the targets IPs.
+ /// The used to build the clipboard text for the targets user ids.
+ public PlayerRequestedRaPlayersInfoEventArgs(
+ CommandSender commandSender,
+ IEnumerable targets,
+ bool isSensitiveInfo,
+ bool hasUserIdPerms,
+ StringBuilder infoBuilder,
+ StringBuilder idBuilder,
+ StringBuilder ipBuilder,
+ StringBuilder userIdBuilder)
+ {
+ Player = Player.Get(commandSender)!;
+ IsSensitiveInfo = isSensitiveInfo;
+ HasUserIdPerms = hasUserIdPerms;
+ InfoBuilder = infoBuilder;
+ PlayerIdBuilder = idBuilder;
+ IpBuilder = ipBuilder;
+ UserIdBuilder = userIdBuilder;
+ _targets = targets;
+ }
+
+ ///
+ /// The player that made the request.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The target players selected.
+ ///
+ public IEnumerable Targets => _targets.Select(Player.Get)!;
+
+ ///
+ /// Gets whether the requested sensitive info.
+ ///
+ public bool IsSensitiveInfo { get; }
+
+ ///
+ /// Gets whether the has perms to view the of the .
+ ///
+ public bool HasUserIdPerms { get; }
+
+ ///
+ /// Gets the used to construct the response message.
+ ///
+ public StringBuilder InfoBuilder { get; }
+
+ ///
+ /// Gets the used to construct the clipboard text for the .
+ ///
+ public StringBuilder PlayerIdBuilder { get; }
+
+ ///
+ /// Gets the used to construct the clipboard text for the .
+ ///
+ public StringBuilder IpBuilder { get; }
+
+ ///
+ /// Gets the used to construct the clipboard text for the .
+ ///
+ public StringBuilder UserIdBuilder { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerRequestingRaPlayerInfoEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerRequestingRaPlayerInfoEventArgs.cs
new file mode 100644
index 00000000..2d43c423
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerRequestingRaPlayerInfoEventArgs.cs
@@ -0,0 +1,74 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using System.Text;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerRequestingRaPlayerInfoEventArgs : EventArgs, IPlayerEvent, ITargetEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// THe instance of the player making the request.
+ /// The component of the target player.
+ /// Whether the info being requested is sensitive.
+ /// Whether the player has perms to view sensitive info.
+ /// Whether the player has perms to view the targets user id.
+ /// The used to construct the response message.
+ public PlayerRequestingRaPlayerInfoEventArgs(
+ CommandSender commandSender,
+ ReferenceHub targetHub,
+ bool isSensitiveInfo,
+ bool hasSensitiveInfoPerms,
+ bool hasUserIdPerms,
+ StringBuilder infoBuilder)
+ {
+ Player = Player.Get(commandSender)!;
+ Target = Player.Get(targetHub);
+ IsSensitiveInfo = isSensitiveInfo;
+ HasSensitiveInfoPerms = hasSensitiveInfoPerms;
+ HasUserIdPerms = hasUserIdPerms;
+ InfoBuilder = infoBuilder;
+ IsAllowed = true;
+ }
+
+ ///
+ /// The player than made the request.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The target player selected.
+ ///
+ public Player Target { get; }
+
+ ///
+ /// Gets or sets whether the player is requesting sensitive info.
+ ///
+ public bool IsSensitiveInfo { get; set; }
+
+ ///
+ /// Gets or sets whether the player has permissions to view sensitive info.
+ ///
+ ///
+ /// If is and this is no response is sent.
+ ///
+ public bool HasSensitiveInfoPerms { get; set; }
+
+ ///
+ /// Gets or sets whether the player has permission to view the .
+ ///
+ public bool HasUserIdPerms { get; set; }
+
+ ///
+ /// The used to construct the response message.
+ ///
+ public StringBuilder InfoBuilder { get; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerRequestingRaPlayerListEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerRequestingRaPlayerListEventArgs.cs
new file mode 100644
index 00000000..069f42e1
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerRequestingRaPlayerListEventArgs.cs
@@ -0,0 +1,75 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using System.Text;
+using static RemoteAdmin.Communication.RaPlayerList;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerRequestingRaPlayerListEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The instance of the player that made the request for the RA player list.
+ /// The used to build the RA player list.
+ /// Whether to sort players by descending order.
+ /// The mode to use.
+ /// Whether the requester can view hidden local RA badges or not.
+ /// Whether the requester can view hidden global RA badges or not.
+ public PlayerRequestingRaPlayerListEventArgs(
+ CommandSender commandSender,
+ StringBuilder builder,
+ bool isDescending,
+ PlayerSorting sorting,
+ bool viewHiddenLocalBadges,
+ bool viewHiddenGlobalBadges)
+ {
+ Player = Player.Get(commandSender)!;
+ ListBuilder = builder;
+ IsDescending = isDescending;
+ Sorting = sorting;
+ ViewHiddenLocalBadges = viewHiddenLocalBadges;
+ ViewHiddenGlobalBadges = viewHiddenGlobalBadges;
+ IsAllowed = true;
+ }
+
+ ///
+ /// The player that requested the RA player list.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The used to construct the RA player list.
+ ///
+ ///
+ /// String builder is empty in this event.
+ ///
+ public StringBuilder ListBuilder { get; }
+
+ ///
+ /// Gets or set whether to sort players by descending order.
+ ///
+ public bool IsDescending { get; set; }
+
+ ///
+ /// Gets or sets the used.
+ ///
+ public PlayerSorting Sorting { get; set; }
+
+ ///
+ /// Gets or sets whether the can view hidden local RA badges.
+ ///
+ public bool ViewHiddenLocalBadges { get; set; }
+
+ ///
+ /// Gets or sets whether the can view hidden global RA badges.
+ ///
+ public bool ViewHiddenGlobalBadges { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerRequestingRaPlayersInfoEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerRequestingRaPlayersInfoEventArgs.cs
new file mode 100644
index 00000000..f35da228
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerRequestingRaPlayersInfoEventArgs.cs
@@ -0,0 +1,78 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerRequestingRaPlayersInfoEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
+{
+ private readonly IEnumerable _targets;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The instance of the player making the request.
+ /// The reference hub components of the targets selected by the player.
+ /// Whether the player requested sensitive info.
+ /// Whether the player has perms to view sensitive info.
+ /// Whether the player has perms to view the user ids of the targets.
+ /// The used to construct the response message.
+ public PlayerRequestingRaPlayersInfoEventArgs(
+ CommandSender commandSender,
+ IEnumerable targets,
+ bool isSensitiveInfo,
+ bool hasSensitiveInfoPerms,
+ bool hasUserIdPerms,
+ StringBuilder infoBuilder)
+ {
+ Player = Player.Get(commandSender)!;
+ IsSensitiveInfo = isSensitiveInfo;
+ HasSensitiveInfoPerms = hasSensitiveInfoPerms;
+ HasUserIdPerms = hasUserIdPerms;
+ InfoBuilder = infoBuilder;
+ IsAllowed = true;
+ _targets = targets;
+ }
+
+ ///
+ /// The player that made the request.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The target players selected.
+ ///
+ public IEnumerable Targets => _targets.Select(Player.Get)!;
+
+ ///
+ /// Gets or sets whether the requested sensitive info.
+ ///
+ public bool IsSensitiveInfo { get; set; }
+
+ ///
+ /// Gets or sets whether the player has permissions to view sensitive info.
+ ///
+ ///
+ /// If is and this is no response is sent.
+ ///
+ public bool HasSensitiveInfoPerms { get; set; }
+
+ ///
+ /// Gets or sets whether the has permission to view the of the .
+ ///
+ public bool HasUserIdPerms { get; set; }
+
+ ///
+ /// Gets the used to construct the response message.
+ ///
+ public StringBuilder InfoBuilder { get; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerRoomChangedEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerRoomChangedEventArgs.cs
new file mode 100644
index 00000000..8dc27940
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerRoomChangedEventArgs.cs
@@ -0,0 +1,40 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using MapGeneration;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerRoomChangedEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player whose room changed.
+ /// The old room.
+ /// The new room.
+ public PlayerRoomChangedEventArgs(ReferenceHub player, RoomIdentifier oldRoom, RoomIdentifier newRoom)
+ {
+ Player = Player.Get(player);
+ OldRoom = Room.Get(oldRoom);
+ NewRoom = Room.Get(newRoom);
+ }
+
+ ///
+ /// Gets the player whose last known room changed.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the old room. May be null if the player just spawned, went through void and such.
+ ///
+ public Room? OldRoom { get; }
+
+ ///
+ /// Gets the new room. May be null if the player went into void, died and such.
+ ///
+ public Room? NewRoom { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchToyAbortedEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchToyAbortedEventArgs.cs
index f411f07b..314ce292 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchToyAbortedEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchToyAbortedEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerSearchToyAbortedEventArgs : EventArgs, IPlayerEvent, IInterac
///
/// Initializes a new instance for the class.
///
- /// The player that canceled the search on the toy.
+ /// The player that canceled the search on the toy.
/// The toy that was being searched.
- public PlayerSearchToyAbortedEventArgs(ReferenceHub player, InvisibleInteractableToy toy)
+ public PlayerSearchToyAbortedEventArgs(ReferenceHub hub, InvisibleInteractableToy toy)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Interactable = InteractableToy.Get(toy);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchedAmmoEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchedAmmoEventArgs.cs
index 128adc66..430c46d3 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchedAmmoEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchedAmmoEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerSearchedAmmoEventArgs : EventArgs, IPlayerEvent, IAmmoPickupE
///
/// Initializes a new instance of the class.
///
- /// The player who searched for ammo pickup.
+ /// The player who searched for ammo pickup.
/// The ammo pickup.
- public PlayerSearchedAmmoEventArgs(ReferenceHub player, BaseAmmoPickup pickup)
+ public PlayerSearchedAmmoEventArgs(ReferenceHub hub, BaseAmmoPickup pickup)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
AmmoPickup = AmmoPickup.Get(pickup);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchedArmorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchedArmorEventArgs.cs
index 994d9456..9a2fc349 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchedArmorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchedArmorEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerSearchedArmorEventArgs : EventArgs, IPlayerEvent, IBodyArmorP
///
/// Initializes a new instance of the class.
///
- /// The player who searched for armor pickup.
+ /// The player who searched for armor pickup.
/// The armor pickup.
- public PlayerSearchedArmorEventArgs(ReferenceHub player, BaseBodyArmorPickup pickup)
+ public PlayerSearchedArmorEventArgs(ReferenceHub hub, BaseBodyArmorPickup pickup)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
BodyArmorPickup = BodyArmorPickup.Get(pickup);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchedPickupEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchedPickupEventArgs.cs
index 38755804..a2533a9f 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchedPickupEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchedPickupEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerSearchedPickupEventArgs : EventArgs, IPlayerEvent, IPickupEve
///
/// Initializes a new instance of the class.
///
- /// The player who searched for pickup.
+ /// The player who searched for pickup.
/// The item pickup.
- public PlayerSearchedPickupEventArgs(ReferenceHub player, ItemPickupBase pickup)
+ public PlayerSearchedPickupEventArgs(ReferenceHub hub, ItemPickupBase pickup)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Pickup = Pickup.Get(pickup);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchedToyEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchedToyEventArgs.cs
index 50ed12f0..38af42cc 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchedToyEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchedToyEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerSearchedToyEventArgs : EventArgs, IPlayerEvent, IInteractable
///
/// Initializes a new instance of the class.
///
- /// The player who searched the toy.
+ /// The player who searched the toy.
/// The toy that was searched.
- public PlayerSearchedToyEventArgs(ReferenceHub player, InvisibleInteractableToy toy)
+ public PlayerSearchedToyEventArgs(ReferenceHub hub, InvisibleInteractableToy toy)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Interactable = InteractableToy.Get(toy);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchingAmmoEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchingAmmoEventArgs.cs
index 665d3a28..ecc5545e 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchingAmmoEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchingAmmoEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerSearchingAmmoEventArgs : EventArgs, IPlayerEvent, IAmmoPickup
///
/// Initializes a new instance of the class.
///
- /// The player searching for ammo pickup.
+ /// The player searching for ammo pickup.
/// The ammo pickup.
- public PlayerSearchingAmmoEventArgs(ReferenceHub player, BaseAmmoPickup pickup)
+ public PlayerSearchingAmmoEventArgs(ReferenceHub hub, BaseAmmoPickup pickup)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
AmmoPickup = AmmoPickup.Get(pickup);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchingArmorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchingArmorEventArgs.cs
index 7b921f4a..6d758e60 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchingArmorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchingArmorEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerSearchingArmorEventArgs : EventArgs, IPlayerEvent, IBodyArmor
///
/// Initializes a new instance of the class.
///
- /// The player searching for armor.
+ /// The player searching for armor.
/// The armor pickup.
- public PlayerSearchingArmorEventArgs(ReferenceHub player, BaseBodyArmorPickup pickup)
+ public PlayerSearchingArmorEventArgs(ReferenceHub hub, BaseBodyArmorPickup pickup)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
BodyArmorPickup = BodyArmorPickup.Get(pickup);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchingPickupEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchingPickupEventArgs.cs
index dc12a500..de722ea4 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchingPickupEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchingPickupEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerSearchingPickupEventArgs : EventArgs, IPlayerEvent, IPickupEv
///
/// Initializes a new instance of the class.
///
- /// The player who is searching for the pickup.
+ /// The player who is searching for the pickup.
/// The pickup being searched.
- public PlayerSearchingPickupEventArgs(ReferenceHub player, ItemPickupBase pickup)
+ public PlayerSearchingPickupEventArgs(ReferenceHub hub, ItemPickupBase pickup)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Pickup = Pickup.Get(pickup);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchingToyEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchingToyEventArgs.cs
index d6980cea..580c28b9 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerSearchingToyEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSearchingToyEventArgs.cs
@@ -6,19 +6,19 @@
namespace LabApi.Events.Arguments.PlayerEvents;
///
-/// Represents the arguments for the
+/// Represents the arguments for the .
///
public class PlayerSearchingToyEventArgs : EventArgs, IPlayerEvent, IInteractableEvent, ICancellableEvent
{
///
/// Initializes a new instance of the class.
///
- /// The player who is searching the toy.
+ /// The player who is searching the toy.
/// The toy that is going to be searched.
- public PlayerSearchingToyEventArgs(ReferenceHub player, InvisibleInteractableToy toy)
+ public PlayerSearchingToyEventArgs(ReferenceHub hub, InvisibleInteractableToy toy)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Interactable = InteractableToy.Get(toy);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSendingAttachmentsPrefsEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSendingAttachmentsPrefsEventArgs.cs
new file mode 100644
index 00000000..59bb8401
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSendingAttachmentsPrefsEventArgs.cs
@@ -0,0 +1,48 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerSendingAttachmentsPrefsEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
+{
+ ///
+ /// Initialized a new instance of .
+ ///
+ /// The player who is changing the firearm attachments.
+ /// The firearm type whose attachments preferences are being changed.
+ /// The old attachments code.
+ /// The new attachments code requested by the player.
+ public PlayerSendingAttachmentsPrefsEventArgs(ReferenceHub player, ItemType firearm, uint oldAttachments, uint newAttachments)
+ {
+ Player = Player.Get(player);
+ FirearmType = firearm;
+ OldAttachments = oldAttachments;
+ NewAttachments = newAttachments;
+ IsAllowed = true;
+ }
+
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the of the firearm.
+ ///
+ public ItemType FirearmType { get; set; }
+
+ ///
+ /// Gets previous attachments code stored on the server.
+ ///
+ public uint OldAttachments { get; }
+
+ ///
+ /// Gets or sets new attachments code. Edited values are NOT propagated back to the client and are stored on the server for on-spawn purposes.
+ ///
+ public uint NewAttachments { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSendingHitmarkerEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSendingHitmarkerEventArgs.cs
new file mode 100644
index 00000000..cfca9f8f
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSendingHitmarkerEventArgs.cs
@@ -0,0 +1,44 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerSendingHitmarkerEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance for the class.
+ ///
+ /// The player that is sending the hitmarker.
+ /// The target size multiplier.
+ /// Whether the hitmarker sound effect should play.
+ public PlayerSendingHitmarkerEventArgs(ReferenceHub hub, float size, bool playAudio)
+ {
+ Player = Player.Get(hub);
+ Size = size;
+ PlayAudio = playAudio;
+
+ IsAllowed = true;
+ }
+
+ ///
+ /// Gets or sets the player that the hitmarker is being sent to.
+ ///
+ public Player Player { get; set; }
+
+ ///
+ /// Gets or sets the target size multiplier.
+ ///
+ public float Size { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether the hitmarker sound effect should play.
+ ///
+ public bool PlayAudio { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSendingVoiceMessageEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSendingVoiceMessageEventArgs.cs
index 30652ee1..883973c9 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerSendingVoiceMessageEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSendingVoiceMessageEventArgs.cs
@@ -10,6 +10,8 @@ namespace LabApi.Events.Arguments.PlayerEvents;
///
public class PlayerSendingVoiceMessageEventArgs : EventArgs, ICancellableEvent, IPlayerEvent, IVoiceMessageEvent
{
+ private VoiceMessage _message;
+
///
/// Initializes a new instance of the class.
///
@@ -39,6 +41,4 @@ public PlayerSendingVoiceMessageEventArgs(ref VoiceMessage message)
/// this will be ignored.
///
public bool IsAllowed { get; set; }
-
- private VoiceMessage _message;
}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSentAttachmentsPrefsEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSentAttachmentsPrefsEventArgs.cs
new file mode 100644
index 00000000..0afd29cd
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSentAttachmentsPrefsEventArgs.cs
@@ -0,0 +1,44 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerSentAttachmentsPrefsEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initialized a new instance of .
+ ///
+ /// The player who is changing the firearm attachments.
+ /// The firearm type whose attachments preferences are being changed.
+ /// The old attachments code.
+ /// The new attachments code.
+ public PlayerSentAttachmentsPrefsEventArgs(ReferenceHub player, ItemType firearm, uint oldAttachments, uint newAttachments)
+ {
+ Player = Player.Get(player);
+ FirearmType = firearm;
+ OldAttachments = oldAttachments;
+ NewAttachments = newAttachments;
+ }
+
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The of the firearm.
+ ///
+ public ItemType FirearmType { get; }
+
+ ///
+ /// Gets previous attachments code stored on the server.
+ ///
+ public uint OldAttachments { get; }
+
+ ///
+ /// Gets the new attachments code stored on the server.
+ ///
+ public uint NewAttachments { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSentHitmarkerEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSentHitmarkerEventArgs.cs
new file mode 100644
index 00000000..0532502b
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSentHitmarkerEventArgs.cs
@@ -0,0 +1,39 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerSentHitmarkerEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initializes a new instance for the class.
+ ///
+ /// The player that sent the hitmarker.
+ /// The target size multiplier.
+ /// Whether the hitmarker sound effect was played.
+ public PlayerSentHitmarkerEventArgs(ReferenceHub hub, float size, bool playedAudio)
+ {
+ Player = Player.Get(hub);
+ Size = size;
+ PlayedAudio = playedAudio;
+ }
+
+ ///
+ /// Gets the player that the hitmarker was sent to.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the target size multiplier.
+ ///
+ public float Size { get; }
+
+ ///
+ /// Gets a value indicating whether the hitmarker sound effect was played.
+ ///
+ public bool PlayedAudio { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerShootingWeaponEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerShootingWeaponEventArgs.cs
index 28047a03..859a667a 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerShootingWeaponEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerShootingWeaponEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerShootingWeaponEventArgs : EventArgs, IPlayerEvent, IFirearmIt
///
/// Initializes a new instance of the class.
///
- /// The player who is shooting.
+ /// The player who is shooting.
/// The firearm that the player shooting from.
- public PlayerShootingWeaponEventArgs(ReferenceHub player, Firearm weapon)
+ public PlayerShootingWeaponEventArgs(ReferenceHub hub, Firearm weapon)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
FirearmItem = FirearmItem.Get(weapon);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerShotWeaponEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerShotWeaponEventArgs.cs
index f502c47f..7d0e31dd 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerShotWeaponEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerShotWeaponEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerShotWeaponEventArgs : EventArgs, IPlayerEvent, IFirearmItemEv
///
/// Initializes a new instance of the class.
///
- /// The player who shot.
+ /// The player who shot.
/// The firearm that the player shot from.
- public PlayerShotWeaponEventArgs(ReferenceHub player, Firearm weapon)
+ public PlayerShotWeaponEventArgs(ReferenceHub hub, Firearm weapon)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
FirearmItem = FirearmItem.Get(weapon);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSpawnedEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSpawnedEventArgs.cs
index 5196b166..d899d140 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerSpawnedEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSpawnedEventArgs.cs
@@ -14,14 +14,14 @@ public class PlayerSpawnedEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who is being spawned.
+ /// The player who is being spawned.
/// The role that is being applied.
/// If spawnpoint should be used.
/// The default spawn location.
/// The default spawn horizontal rotation.
- public PlayerSpawnedEventArgs(ReferenceHub player, PlayerRoleBase role, bool useSpawnPoint, Vector3 spawnLocation, float horizontalRotation)
+ public PlayerSpawnedEventArgs(ReferenceHub hub, PlayerRoleBase role, bool useSpawnPoint, Vector3 spawnLocation, float horizontalRotation)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Role = role;
UseSpawnPoint = useSpawnPoint;
SpawnLocation = spawnLocation;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSpawnedRagdollEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSpawnedRagdollEventArgs.cs
index 7ccd0b9f..a5a88f48 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerSpawnedRagdollEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSpawnedRagdollEventArgs.cs
@@ -14,12 +14,12 @@ public class PlayerSpawnedRagdollEventArgs : EventArgs, IPlayerEvent, IRagdollEv
///
/// Initializes a new instance of the class.
///
- /// The player from who is ragdoll from.
+ /// The player from who is ragdoll from.
/// The spawned ragdoll.
/// The damage handler that caused the death of the player.
- public PlayerSpawnedRagdollEventArgs(ReferenceHub player, BasicRagdoll ragdoll, DamageHandlerBase damageHandler)
+ public PlayerSpawnedRagdollEventArgs(ReferenceHub hub, BasicRagdoll ragdoll, DamageHandlerBase damageHandler)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Ragdoll = Ragdoll.Get(ragdoll);
DamageHandler = damageHandler;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSpawningEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSpawningEventArgs.cs
index ba75ad34..7e023899 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerSpawningEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSpawningEventArgs.cs
@@ -11,21 +11,21 @@ namespace LabApi.Events.Arguments.PlayerEvents;
///
public class PlayerSpawningEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
{
- Vector3 _spawnLocation;
- float _horizontalRotation;
+ private Vector3 _spawnLocation;
+ private float _horizontalRotation;
///
/// Initializes a new instance of the class.
///
- /// The player who is being spawned.
+ /// The player who is being spawned.
/// The role that is being applied.
/// If spawnpoint should be used.
/// The default spawn location.
/// The default spawn horizontal rotation.
- public PlayerSpawningEventArgs(ReferenceHub player, PlayerRoleBase role, bool useSpawnPoint, Vector3 spawnLocation, float horizontalRotation)
+ public PlayerSpawningEventArgs(ReferenceHub hub, PlayerRoleBase role, bool useSpawnPoint, Vector3 spawnLocation, float horizontalRotation)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Role = role;
UseSpawnPoint = useSpawnPoint;
_spawnLocation = spawnLocation;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSpawningRagdollEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSpawningRagdollEventArgs.cs
index 811263ee..b756b921 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerSpawningRagdollEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSpawningRagdollEventArgs.cs
@@ -9,19 +9,19 @@ namespace LabApi.Events.Arguments.PlayerEvents;
///
/// Represents the arguments for the event.
///
-public class PlayerSpawningRagdollEventArgs : EventArgs, IPlayerEvent, IRagdollEvent, ICancellableEvent
+public class PlayerSpawningRagdollEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
{
///
/// Initializes a new instance of the class.
///
- /// The player from who is ragdoll from.
+ /// The player from who is ragdoll from.
/// The ragdoll which being spawned.
/// The damage handler that caused the death of the player.
- public PlayerSpawningRagdollEventArgs(ReferenceHub player, BasicRagdoll ragdoll, DamageHandlerBase damageHandler)
+ public PlayerSpawningRagdollEventArgs(ReferenceHub hub, BasicRagdoll ragdoll, DamageHandlerBase damageHandler)
{
IsAllowed = true;
- Player = Player.Get(player);
- Ragdoll = Ragdoll.Get(ragdoll);
+ Player = Player.Get(hub);
+ RagdollPrefab = Ragdoll.Get(ragdoll);
DamageHandler = damageHandler;
}
@@ -31,9 +31,15 @@ public PlayerSpawningRagdollEventArgs(ReferenceHub player, BasicRagdoll ragdoll,
public Player Player { get; }
///
- /// Gets the ragdoll which being spawned.
+ /// Gets the ragdoll prefab which will be used to instantiate the ragdoll.
///
- public Ragdoll Ragdoll { get; }
+ [Obsolete($"use {nameof(RagdollPrefab)} instead.")]
+ public Ragdoll Ragdoll => RagdollPrefab;
+
+ ///
+ /// Gets the ragdoll prefab which will be used to instantiate the ragdoll.
+ ///
+ public Ragdoll RagdollPrefab { get; }
///
/// Gets the damage handler that caused the death of the player.
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSpinnedRevolverEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSpinnedRevolverEventArgs.cs
new file mode 100644
index 00000000..89fbaae8
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSpinnedRevolverEventArgs.cs
@@ -0,0 +1,33 @@
+using InventorySystem.Items.Firearms;
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerSpinnedRevolverEventArgs : EventArgs, IPlayerEvent, IRevolverItemEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player who spinned the revolver.
+ /// The revolver firearm.
+ public PlayerSpinnedRevolverEventArgs(ReferenceHub hub, Firearm weapon)
+ {
+ Player = Player.Get(hub);
+ Revolver = (RevolverFirearm)FirearmItem.Get(weapon);
+ }
+
+ ///
+ /// Gets the player who spinned the revolver.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the revolver item.
+ ///
+ public RevolverFirearm Revolver { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerSpinningRevolverEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerSpinningRevolverEventArgs.cs
new file mode 100644
index 00000000..4fd37a6c
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerSpinningRevolverEventArgs.cs
@@ -0,0 +1,37 @@
+using InventorySystem.Items.Firearms;
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerSpinningRevolverEventArgs : EventArgs, IPlayerEvent, IRevolverItemEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player who is attempting to spin the revolver.
+ /// The revolver firearm.
+ public PlayerSpinningRevolverEventArgs(ReferenceHub hub, Firearm weapon)
+ {
+ Player = Player.Get(hub);
+ Revolver = (RevolverFirearm)FirearmItem.Get(weapon);
+ IsAllowed = true;
+ }
+
+ ///
+ /// Gets the player who is attempting to spin the revolver.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the revolver item.
+ ///
+ public RevolverFirearm Revolver { get; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerThrewItemEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerThrewItemEventArgs.cs
index 57d8fea4..45030a8d 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerThrewItemEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerThrewItemEventArgs.cs
@@ -14,12 +14,12 @@ public class PlayerThrewItemEventArgs : EventArgs, IPlayerEvent, IPickupEvent
///
/// Initializes a new instance of the class.
///
- /// The player who threw the item.
+ /// The player who threw the item.
/// The item that was thrown.
/// The rigidbody of the item.
- public PlayerThrewItemEventArgs(ReferenceHub player, ItemPickupBase item, Rigidbody rigidbody)
+ public PlayerThrewItemEventArgs(ReferenceHub hub, ItemPickupBase item, Rigidbody rigidbody)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Pickup = Pickup.Get(item);
Rigidbody = rigidbody;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerThrewProjectileEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerThrewProjectileEventArgs.cs
index 7b048f8d..e683b115 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerThrewProjectileEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerThrewProjectileEventArgs.cs
@@ -15,14 +15,14 @@ public class PlayerThrewProjectileEventArgs : EventArgs, IPlayerEvent, IThrowabl
///
/// Initializes a new instance of the class.
///
- /// The player who threw the throwable item.
+ /// The player who threw the throwable item.
/// The original item that was thrown.
/// The new projectile object created.
/// Projectile settings at which throwable was thrown.
/// Value whenever the throwable was thrown at full force (overhand).
- public PlayerThrewProjectileEventArgs(ReferenceHub player, BaseThrowableItem item, ThrownProjectile projectile, ProjectileSettings projectileSettings, bool fullForce)
+ public PlayerThrewProjectileEventArgs(ReferenceHub hub, BaseThrowableItem item, ThrownProjectile projectile, ProjectileSettings projectileSettings, bool fullForce)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
ThrowableItem = ThrowableItem.Get(item);
Projectile = Projectile.Get(projectile);
ProjectileSettings = projectileSettings;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerThrowingItemEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerThrowingItemEventArgs.cs
index 03c518fc..f44c6f5e 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerThrowingItemEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerThrowingItemEventArgs.cs
@@ -1,5 +1,4 @@
-using InventorySystem.Items;
-using InventorySystem.Items.Pickups;
+using InventorySystem.Items.Pickups;
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
using System;
@@ -15,13 +14,13 @@ public class PlayerThrowingItemEventArgs : EventArgs, IPlayerEvent, IPickupEvent
///
/// Initializes a new instance of the class.
///
- /// The player who is throwing the item.
+ /// The player who is throwing the item.
/// The item that is being thrown.
/// The rigidbody of the item.
- public PlayerThrowingItemEventArgs(ReferenceHub player, ItemPickupBase item, Rigidbody rigidbody)
+ public PlayerThrowingItemEventArgs(ReferenceHub hub, ItemPickupBase item, Rigidbody rigidbody)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Pickup = Pickup.Get(item);
Rigidbody = rigidbody;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerThrowingProjectileEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerThrowingProjectileEventArgs.cs
index f33134bc..f25c7dcb 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerThrowingProjectileEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerThrowingProjectileEventArgs.cs
@@ -14,14 +14,14 @@ public class PlayerThrowingProjectileEventArgs : EventArgs, IPlayerEvent, IThrow
///
/// Initializes a new instance of the class.
///
- /// The player who threw the projectile.
+ /// The player who threw the projectile.
/// The original throwable item.
/// Projectile settings at which is throwable being thrown.
/// Value whenever the throwable is being thrown at full force (overhand).
- public PlayerThrowingProjectileEventArgs(ReferenceHub player, BaseThrowableItem item, ProjectileSettings projectileSettings, bool fullForce)
+ public PlayerThrowingProjectileEventArgs(ReferenceHub hub, BaseThrowableItem item, ProjectileSettings projectileSettings, bool fullForce)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
ThrowableItem = ThrowableItem.Get(item);
ProjectileSettings = projectileSettings;
FullForce = fullForce;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerToggledDisruptorFiringModeEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerToggledDisruptorFiringModeEventArgs.cs
new file mode 100644
index 00000000..12b23419
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerToggledDisruptorFiringModeEventArgs.cs
@@ -0,0 +1,40 @@
+using InventorySystem.Items.Firearms;
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerToggledDisruptorFiringModeEventArgs : EventArgs, IPlayerEvent, IFirearmItemEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player who toggled the firing mode.
+ /// The weapon that the player toggled.
+ /// Whether the mode is now single shot.
+ public PlayerToggledDisruptorFiringModeEventArgs(ReferenceHub hub, Firearm weapon, bool singleShot)
+ {
+ Player = Player.Get(hub);
+ FirearmItem = FirearmItem.Get(weapon);
+ SingleShotMode = singleShot;
+ }
+
+ ///
+ /// Gets the player who toggled the firing mode.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the weapon that the player toggled.
+ ///
+ public FirearmItem FirearmItem { get; }
+
+ ///
+ /// Gets whether the disruptor is in single shot mode.
+ ///
+ public bool SingleShotMode { get; }
+}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerToggledFlashlightEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerToggledFlashlightEventArgs.cs
index 57bb3d14..90157e53 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerToggledFlashlightEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerToggledFlashlightEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerToggledFlashlightEventArgs : EventArgs, IPlayerEvent, ILightI
///
/// Initializes a new instance of the class.
///
- /// The player who toggled the flashlight.
+ /// The player who toggled the flashlight.
/// The flashlight item.
/// New state of the flashlight.
- public PlayerToggledFlashlightEventArgs(ReferenceHub player, ToggleableLightItemBase item, bool newState)
+ public PlayerToggledFlashlightEventArgs(ReferenceHub hub, ToggleableLightItemBase item, bool newState)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
LightItem = LightItem.Get(item);
NewState = newState;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerToggledNoclipEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerToggledNoclipEventArgs.cs
index a7a438bd..719aa00d 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerToggledNoclipEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerToggledNoclipEventArgs.cs
@@ -2,32 +2,31 @@
using LabApi.Features.Wrappers;
using System;
-namespace LabApi.Events.Arguments.PlayerEvents
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerToggledNoclipEventArgs : EventArgs, IPlayerEvent
{
///
- /// Represents the arguments for the event.
+ /// Initializes a new instance of the class.
///
- public class PlayerToggledNoclipEventArgs : EventArgs, IPlayerEvent
+ /// The player who has toggled the noclip.
+ /// The new state of the noclip.
+ public PlayerToggledNoclipEventArgs(ReferenceHub hub, bool isNoclipping)
{
- ///
- /// Initializes a new instance of the class.
- ///
- /// The player who has toggled the noclip.
- /// The new state of the noclip.
- public PlayerToggledNoclipEventArgs(ReferenceHub player, bool isNoclipping)
- {
- Player = Player.Get(player);
- IsNoclipping = isNoclipping;
- }
+ Player = Player.Get(hub);
+ IsNoclipping = isNoclipping;
+ }
- ///
- /// Gets the player who toggled noclip.
- ///
- public Player Player { get; }
+ ///
+ /// Gets the player who toggled noclip.
+ ///
+ public Player Player { get; }
- ///
- /// Gets whether the player now has noclip enabled or not.
- ///
- public bool IsNoclipping { get; }
- }
+ ///
+ /// Gets whether the player now has noclip enabled or not.
+ ///
+ public bool IsNoclipping { get; }
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerToggledRadioEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerToggledRadioEventArgs.cs
index 8fd0ca4a..2e9f0ea4 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerToggledRadioEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerToggledRadioEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerToggledRadioEventArgs : EventArgs, IPlayerEvent, IRadioItemEv
///
/// Initializes a new instance of the class.
///
- /// The player who toggled the radio.
+ /// The player who toggled the radio.
/// The radio item.
/// New state of the radio.
- public PlayerToggledRadioEventArgs(ReferenceHub player, BaseRadioItem radio, bool newState)
+ public PlayerToggledRadioEventArgs(ReferenceHub hub, BaseRadioItem radio, bool newState)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
RadioItem = RadioItem.Get(radio);
NewState = newState;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerToggledWeaponFlashlightEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerToggledWeaponFlashlightEventArgs.cs
index 2839f9e9..2c11ed2d 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerToggledWeaponFlashlightEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerToggledWeaponFlashlightEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerToggledWeaponFlashlightEventArgs : EventArgs, IPlayerEvent, I
///
/// Initializes a new instance of the class.
///
- /// The player who toggled the flashlight.
+ /// The player who toggled the flashlight.
/// The flashlight item.
/// The new state of the flashlight.
- public PlayerToggledWeaponFlashlightEventArgs(ReferenceHub player, Firearm item, bool newState)
+ public PlayerToggledWeaponFlashlightEventArgs(ReferenceHub hub, Firearm item, bool newState)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
FirearmItem = FirearmItem.Get(item);
NewState = newState;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerTogglingFlashlightEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerTogglingFlashlightEventArgs.cs
index 31612324..08d792d2 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerTogglingFlashlightEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerTogglingFlashlightEventArgs.cs
@@ -13,13 +13,13 @@ public class PlayerTogglingFlashlightEventArgs : EventArgs, IPlayerEvent, ILight
///
/// Initializes a new instance of the class.
///
- /// The player who is toggling the flashlight.
+ /// The player who is toggling the flashlight.
/// The flashlight that is being toggled.
/// Whenever the flashlight is being toggled to on or off state.
- public PlayerTogglingFlashlightEventArgs(ReferenceHub player, ToggleableLightItemBase item, bool newState)
+ public PlayerTogglingFlashlightEventArgs(ReferenceHub hub, ToggleableLightItemBase item, bool newState)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
LightItem = LightItem.Get(item);
NewState = newState;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerTogglingNoclipEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerTogglingNoclipEventArgs.cs
index 3257e209..1f47f831 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerTogglingNoclipEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerTogglingNoclipEventArgs.cs
@@ -10,14 +10,14 @@ namespace LabApi.Events.Arguments.PlayerEvents;
public class PlayerTogglingNoclipEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
{
///
- /// Initializes a new instance of clas.
+ /// Initializes a new instance of class.
///
- /// The player who is attempting to toggle noclip.
+ /// The player who is attempting to toggle noclip.
/// Whether the noclip state will be enabled or disabled.
- public PlayerTogglingNoclipEventArgs(ReferenceHub player, bool newState)
+ public PlayerTogglingNoclipEventArgs(ReferenceHub hub, bool newState)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
NewNoclipState = newState;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerTogglingRadioEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerTogglingRadioEventArgs.cs
index 66a25d46..93d0d11c 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerTogglingRadioEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerTogglingRadioEventArgs.cs
@@ -13,13 +13,13 @@ public class PlayerTogglingRadioEventArgs : EventArgs, IPlayerEvent, IRadioItemE
///
/// Initializes a new instance of the class.
///
- /// The player who is toggling a radio.
+ /// The player who is toggling a radio.
/// The radio item.
/// New state of the radio being turned off or on.
- public PlayerTogglingRadioEventArgs(ReferenceHub player, BaseRadioItem radio, bool newState)
+ public PlayerTogglingRadioEventArgs(ReferenceHub hub, BaseRadioItem radio, bool newState)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
RadioItem = RadioItem.Get(radio);
NewState = newState;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerTogglingWeaponFlashlightEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerTogglingWeaponFlashlightEventArgs.cs
index 7db324ab..35fb4b22 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerTogglingWeaponFlashlightEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerTogglingWeaponFlashlightEventArgs.cs
@@ -13,13 +13,13 @@ public class PlayerTogglingWeaponFlashlightEventArgs : EventArgs, IPlayerEvent,
///
/// Initializes a new instance of the class.
///
- /// The player who is toggling the flashlight.
+ /// The player who is toggling the flashlight.
/// The flashlight item.
/// The new state of the flashlight.
- public PlayerTogglingWeaponFlashlightEventArgs(ReferenceHub player, Firearm item, bool newState)
+ public PlayerTogglingWeaponFlashlightEventArgs(ReferenceHub hub, Firearm item, bool newState)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
FirearmItem = FirearmItem.Get(item);
NewState = newState;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerTriggeredTeslaEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerTriggeredTeslaEventArgs.cs
index b007c9ff..05889a0f 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerTriggeredTeslaEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerTriggeredTeslaEventArgs.cs
@@ -1,6 +1,6 @@
-using System;
-using LabApi.Events.Arguments.Interfaces;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using System;
namespace LabApi.Events.Arguments.PlayerEvents;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerTriggeringTeslaEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerTriggeringTeslaEventArgs.cs
index 9c4ccf42..9faa14b0 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerTriggeringTeslaEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerTriggeringTeslaEventArgs.cs
@@ -1,6 +1,6 @@
-using System;
-using LabApi.Events.Arguments.Interfaces;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using System;
namespace LabApi.Events.Arguments.PlayerEvents;
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerUncuffedEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerUncuffedEventArgs.cs
index ad0c759d..eb8c6f62 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerUncuffedEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerUncuffedEventArgs.cs
@@ -12,12 +12,12 @@ public class PlayerUncuffedEventArgs : EventArgs, IPlayerEvent, ITargetEvent
///
/// Initializes a new instance of the class.
///
- /// The player who uncuffed target player.
+ /// The player who uncuffed target player.
/// The player who was uncuffed.
/// Whenever the player can undetain as SCP player.
- public PlayerUncuffedEventArgs(ReferenceHub player, ReferenceHub target, bool canUnDetainAsScp)
+ public PlayerUncuffedEventArgs(ReferenceHub hub, ReferenceHub target, bool canUnDetainAsScp)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Target = Player.Get(target);
CanUnDetainAsScp = canUnDetainAsScp;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerUncuffingEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerUncuffingEventArgs.cs
index 478b2a38..88b9f29c 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerUncuffingEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerUncuffingEventArgs.cs
@@ -12,13 +12,13 @@ public class PlayerUncuffingEventArgs : EventArgs, IPlayerEvent, ITargetEvent, I
///
/// Initializes a new instance of the class.
///
- /// The player who is uncuffing another player.
+ /// The player who is uncuffing another player.
/// The player who is being uncuffed.
- /// Whenever the player can undetain as SCP player
- public PlayerUncuffingEventArgs(ReferenceHub player, ReferenceHub target, bool canUnDetainAsScp)
+ /// Whenever the player can undetain as SCP player.
+ public PlayerUncuffingEventArgs(ReferenceHub hub, ReferenceHub target, bool canUnDetainAsScp)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Target = Player.Get(target);
CanUnDetainAsScp = canUnDetainAsScp;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerUnloadedWeaponEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerUnloadedWeaponEventArgs.cs
index 06fadf1d..894cdb89 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerUnloadedWeaponEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerUnloadedWeaponEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerUnloadedWeaponEventArgs : EventArgs, IPlayerEvent, IFirearmIt
///
/// Initializes a new instance of the class.
///
- /// The player who unloaded the weapon.
+ /// The player who unloaded the weapon.
/// The weapon that was unloaded.
- public PlayerUnloadedWeaponEventArgs(ReferenceHub player, Firearm weapon)
+ public PlayerUnloadedWeaponEventArgs(ReferenceHub hub, Firearm weapon)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
FirearmItem = FirearmItem.Get(weapon);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerUnloadingWeaponEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerUnloadingWeaponEventArgs.cs
index 17c3a9df..aae73d46 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerUnloadingWeaponEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerUnloadingWeaponEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerUnloadingWeaponEventArgs : EventArgs, IPlayerEvent, IFirearmI
///
/// Initializes a new instance of the class.
///
- /// The player who is unloading a weapon.
+ /// The player who is unloading a weapon.
/// The weapon that is being unloaded.
- public PlayerUnloadingWeaponEventArgs(ReferenceHub player, Firearm weapon)
+ public PlayerUnloadingWeaponEventArgs(ReferenceHub hub, Firearm weapon)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
FirearmItem = FirearmItem.Get(weapon);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockedGeneratorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockedGeneratorEventArgs.cs
index dfa00707..984b533d 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockedGeneratorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockedGeneratorEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerUnlockedGeneratorEventArgs : EventArgs, IPlayerEvent, IGenera
///
/// Initializes a new instance of the class.
///
- /// The player who unlocked the generator.
+ /// The player who unlocked the generator.
/// The generator that the player has unlocked.
- public PlayerUnlockedGeneratorEventArgs(ReferenceHub player, Scp079Generator generator)
+ public PlayerUnlockedGeneratorEventArgs(ReferenceHub hub, Scp079Generator generator)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Generator = Generator.Get(generator);
}
@@ -29,4 +29,3 @@ public PlayerUnlockedGeneratorEventArgs(ReferenceHub player, Scp079Generator gen
///
public Generator Generator { get; }
}
-
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockedWarheadButtonEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockedWarheadButtonEventArgs.cs
index 445d543e..75bdc67b 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockedWarheadButtonEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockedWarheadButtonEventArgs.cs
@@ -12,10 +12,10 @@ public class PlayerUnlockedWarheadButtonEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who has unlocked the warhead button.
- public PlayerUnlockedWarheadButtonEventArgs(ReferenceHub player)
+ /// The player who has unlocked the warhead button.
+ public PlayerUnlockedWarheadButtonEventArgs(ReferenceHub hub)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
@@ -23,4 +23,3 @@ public PlayerUnlockedWarheadButtonEventArgs(ReferenceHub player)
///
public Player Player { get; }
}
-
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockingGeneratorEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockingGeneratorEventArgs.cs
index 9cb18a10..fdde7102 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockingGeneratorEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockingGeneratorEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerUnlockingGeneratorEventArgs : EventArgs, IPlayerEvent, IGener
///
/// Initializes a new instance of the class.
///
- /// The player who is unlocking the generator.
+ /// The player who is unlocking the generator.
/// The generator that the player is unlocking.
/// Whether the generator can be opened.
- public PlayerUnlockingGeneratorEventArgs(ReferenceHub player, Scp079Generator generator, bool canOpen)
+ public PlayerUnlockingGeneratorEventArgs(ReferenceHub hub, Scp079Generator generator, bool canOpen)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Generator = Generator.Get(generator);
IsAllowed = true;
CanOpen = canOpen;
@@ -42,4 +42,3 @@ public PlayerUnlockingGeneratorEventArgs(ReferenceHub player, Scp079Generator ge
///
public bool IsAllowed { get; set; }
}
-
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockingWarheadButtonEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockingWarheadButtonEventArgs.cs
index 8e6a3980..f3bbfedf 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockingWarheadButtonEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerUnlockingWarheadButtonEventArgs.cs
@@ -12,10 +12,10 @@ public class PlayerUnlockingWarheadButtonEventArgs : EventArgs, IPlayerEvent, IC
///
/// Initializes a new instance of the class.
///
- /// The player who unlocking the warhead button.
- public PlayerUnlockingWarheadButtonEventArgs(ReferenceHub player)
+ /// The player who unlocking the warhead button.
+ public PlayerUnlockingWarheadButtonEventArgs(ReferenceHub hub)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerUnmutedEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerUnmutedEventArgs.cs
index a6056c27..948931a0 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerUnmutedEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerUnmutedEventArgs.cs
@@ -12,12 +12,12 @@ public class PlayerUnmutedEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who was unmuted.
+ /// The player who was unmuted.
/// The player who issued the unmute.
/// Whenever the unmute was for intercom.
- public PlayerUnmutedEventArgs(ReferenceHub player, ReferenceHub issuer, bool isIntercom)
+ public PlayerUnmutedEventArgs(ReferenceHub hub, ReferenceHub issuer, bool isIntercom)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Issuer = Player.Get(issuer);
IsIntercom = isIntercom;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerUnmutingEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerUnmutingEventArgs.cs
index f731e090..9b0d15e9 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerUnmutingEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerUnmutingEventArgs.cs
@@ -12,13 +12,13 @@ public class PlayerUnmutingEventArgs : EventArgs, IPlayerEvent, ICancellableEven
///
/// Initializes a new instance of the class.
///
- /// The player who is being unmuted.
+ /// The player who is being unmuted.
/// The player who issued the unmute action.
/// Whenever is unmute for intercom.
- public PlayerUnmutingEventArgs(ReferenceHub player, ReferenceHub issuer, bool isIntercom)
+ public PlayerUnmutingEventArgs(ReferenceHub hub, ReferenceHub issuer, bool isIntercom)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Issuer = Player.Get(issuer);
IsIntercom = isIntercom;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerUsedIntercomEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerUsedIntercomEventArgs.cs
index e037a2de..cec2c8be 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerUsedIntercomEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerUsedIntercomEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerUsedIntercomEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who used the intercom.
+ /// The player who used the intercom.
/// State of the intercom.
- public PlayerUsedIntercomEventArgs(ReferenceHub? player, IntercomState state)
+ public PlayerUsedIntercomEventArgs(ReferenceHub? hub, IntercomState state)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
State = state;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerUsedItemEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerUsedItemEventArgs.cs
index 63766d64..885cc193 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerUsedItemEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerUsedItemEventArgs.cs
@@ -13,11 +13,11 @@ public class PlayerUsedItemEventArgs : EventArgs, IPlayerEvent, IUsableItemEvent
///
/// Initializes a new instance of the class.
///
- /// The player who used the item.
+ /// The player who used the item.
/// Item that was used.
- public PlayerUsedItemEventArgs(ReferenceHub player, BaseUsableItem item)
+ public PlayerUsedItemEventArgs(ReferenceHub hub, BaseUsableItem item)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
UsableItem = UsableItem.Get(item);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerUsedRadioEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerUsedRadioEventArgs.cs
index 2d7ab251..b7d2a960 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerUsedRadioEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerUsedRadioEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerUsedRadioEventArgs : EventArgs, IPlayerEvent, IRadioItemEvent
///
/// Initializes a new instance of the class.
///
- /// Player that used the radio.
+ /// Player that used the radio.
/// Radio that was being used.
/// Drain amount of the battery per second.
- public PlayerUsedRadioEventArgs(ReferenceHub player, BaseRadioItem radio, float drain)
+ public PlayerUsedRadioEventArgs(ReferenceHub hub, BaseRadioItem radio, float drain)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
RadioItem = RadioItem.Get(radio);
Drain = drain;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerUsingIntercomEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerUsingIntercomEventArgs.cs
index ec7f93bb..4bc1974d 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerUsingIntercomEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerUsingIntercomEventArgs.cs
@@ -13,13 +13,13 @@ public class PlayerUsingIntercomEventArgs : EventArgs, IPlayerEvent, ICancellabl
///
/// Initializes a new instance of the class.
///
- /// The player that is using the intercom.
+ /// The player that is using the intercom.
/// State of the intercom.
- //TODO: Add intercom class and ref it docs
- public PlayerUsingIntercomEventArgs(ReferenceHub player, IntercomState state)
+ // TODO: Add intercom class and ref it docs
+ public PlayerUsingIntercomEventArgs(ReferenceHub hub, IntercomState state)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
State = state;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerUsingItemEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerUsingItemEventArgs.cs
index 48158bdf..9e08bb98 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerUsingItemEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerUsingItemEventArgs.cs
@@ -13,12 +13,12 @@ public class PlayerUsingItemEventArgs : EventArgs, IPlayerEvent, IUsableItemEven
///
/// Initializes a new instance of the class.
///
- /// The player using the item.
+ /// The player using the item.
/// The item that is being used.
- public PlayerUsingItemEventArgs(ReferenceHub player, BaseUsableItem item)
+ public PlayerUsingItemEventArgs(ReferenceHub hub, BaseUsableItem item)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
UsableItem = UsableItem.Get(item);
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerUsingRadioEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerUsingRadioEventArgs.cs
index af5787ac..1e5abf67 100644
--- a/LabApi/Events/Arguments/PlayerEvents/PlayerUsingRadioEventArgs.cs
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerUsingRadioEventArgs.cs
@@ -13,13 +13,13 @@ public class PlayerUsingRadioEventArgs : EventArgs, IPlayerEvent, IRadioItemEven
///
/// Initializes a new instance of the class.
///
- /// The player who is using the radio.
+ /// The player who is using the radio.
/// Radio item that is being used.
/// Battery drain amount per second.
- public PlayerUsingRadioEventArgs(ReferenceHub player, BaseRadioItem radio, float drain)
+ public PlayerUsingRadioEventArgs(ReferenceHub hub, BaseRadioItem radio, float drain)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
RadioItem = RadioItem.Get(radio);
Drain = drain;
}
diff --git a/LabApi/Events/Arguments/PlayerEvents/PlayerZoneChangedEventArgs.cs b/LabApi/Events/Arguments/PlayerEvents/PlayerZoneChangedEventArgs.cs
new file mode 100644
index 00000000..6fc7fc2b
--- /dev/null
+++ b/LabApi/Events/Arguments/PlayerEvents/PlayerZoneChangedEventArgs.cs
@@ -0,0 +1,40 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using MapGeneration;
+using System;
+
+namespace LabApi.Events.Arguments.PlayerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class PlayerZoneChangedEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player whose zone changed.
+ /// The old zone.
+ /// The new zone.
+ public PlayerZoneChangedEventArgs(ReferenceHub player, FacilityZone oldZone, FacilityZone newZone)
+ {
+ Player = Player.Get(player);
+ OldZone = oldZone;
+ NewZone = newZone;
+ }
+
+ ///
+ /// Gets the player whose last known room changed.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the old zone. May be if the player just spawned, went through void and such.
+ ///
+ public FacilityZone OldZone { get; }
+
+ ///
+ /// Gets the new zone. May be if the player went into void, died and such.
+ ///
+ public FacilityZone NewZone { get; }
+}
diff --git a/LabApi/Events/Arguments/Scp0492Events/Scp0492ConsumedCorpseEventArgs.cs b/LabApi/Events/Arguments/Scp0492Events/Scp0492ConsumedCorpseEventArgs.cs
index cbb3b2ae..62019aec 100644
--- a/LabApi/Events/Arguments/Scp0492Events/Scp0492ConsumedCorpseEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp0492Events/Scp0492ConsumedCorpseEventArgs.cs
@@ -1,7 +1,7 @@
-using System;
-using LabApi.Events.Arguments.Interfaces;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
using PlayerRoles.Ragdolls;
+using System;
namespace LabApi.Events.Arguments.Scp0492Events;
diff --git a/LabApi/Events/Arguments/Scp0492Events/Scp0492ConsumingCorpseEventArgs.cs b/LabApi/Events/Arguments/Scp0492Events/Scp0492ConsumingCorpseEventArgs.cs
index fd87c9f9..ce42bd82 100644
--- a/LabApi/Events/Arguments/Scp0492Events/Scp0492ConsumingCorpseEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp0492Events/Scp0492ConsumingCorpseEventArgs.cs
@@ -1,7 +1,7 @@
-using System;
-using LabApi.Events.Arguments.Interfaces;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
using PlayerRoles.Ragdolls;
+using System;
namespace LabApi.Events.Arguments.Scp0492Events;
diff --git a/LabApi/Events/Arguments/Scp0492Events/Scp0492StartedConsumingCorpseEventArgs.cs b/LabApi/Events/Arguments/Scp0492Events/Scp0492StartedConsumingCorpseEventArgs.cs
index 09b4374d..640188ae 100644
--- a/LabApi/Events/Arguments/Scp0492Events/Scp0492StartedConsumingCorpseEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp0492Events/Scp0492StartedConsumingCorpseEventArgs.cs
@@ -1,7 +1,7 @@
-using System;
-using LabApi.Events.Arguments.Interfaces;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
using PlayerRoles.Ragdolls;
+using System;
namespace LabApi.Events.Arguments.Scp0492Events;
diff --git a/LabApi/Events/Arguments/Scp0492Events/Scp0492StartingConsumingCorpseEventArgs.cs b/LabApi/Events/Arguments/Scp0492Events/Scp0492StartingConsumingCorpseEventArgs.cs
index b696c4a2..fa3b9d47 100644
--- a/LabApi/Events/Arguments/Scp0492Events/Scp0492StartingConsumingCorpseEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp0492Events/Scp0492StartingConsumingCorpseEventArgs.cs
@@ -1,8 +1,8 @@
-using System;
-using LabApi.Events.Arguments.Interfaces;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
using PlayerRoles.PlayableScps.Scp049.Zombies;
using PlayerRoles.Ragdolls;
+using System;
namespace LabApi.Events.Arguments.Scp0492Events;
diff --git a/LabApi/Events/Arguments/Scp049Events/Scp049AttackedEventArgs.cs b/LabApi/Events/Arguments/Scp049Events/Scp049AttackedEventArgs.cs
new file mode 100644
index 00000000..0a227784
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp049Events/Scp049AttackedEventArgs.cs
@@ -0,0 +1,46 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp049Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp049AttackedEventArgs : EventArgs, IPlayerEvent, ITargetEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The SCP-049 player instance.
+ /// The player that SCP-049 has attacked.
+ /// The attack was an instant kill.
+ /// The was a sense target.
+ public Scp049AttackedEventArgs(ReferenceHub hub, ReferenceHub target, bool instantKill, bool isSenseTarget)
+ {
+ Player = Player.Get(hub);
+ Target = Player.Get(target);
+ InstantKill = instantKill;
+ IsSenseTarget = isSenseTarget;
+ }
+
+ ///
+ /// The SCP-049 player instance.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The player that SCP-049 has attacked.
+ ///
+ public Player Target { get; }
+
+ ///
+ /// Gets whether the attack was an instant kill.
+ ///
+ public bool InstantKill { get; }
+
+ ///
+ /// Gets whether the is a sense target.
+ ///
+ public bool IsSenseTarget { get; }
+}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/Scp049Events/Scp049AttackingEventArgs.cs b/LabApi/Events/Arguments/Scp049Events/Scp049AttackingEventArgs.cs
new file mode 100644
index 00000000..8568470b
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp049Events/Scp049AttackingEventArgs.cs
@@ -0,0 +1,58 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp049Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp049AttackingEventArgs : EventArgs, IPlayerEvent, ITargetEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The SCP-049 player instance.
+ /// The player that SCP-049 is attacking.
+ /// The attack is an instant kill.
+ /// The is a sense target.
+ /// The attack cooldown.
+ public Scp049AttackingEventArgs(ReferenceHub hub, ReferenceHub target, bool instantKill, bool isSenseTarget, float cooldownTime)
+ {
+ Player = Player.Get(hub);
+ Target = Player.Get(target);
+ InstantKill = instantKill;
+ IsSenseTarget = isSenseTarget;
+ CooldownTime = cooldownTime;
+
+ IsAllowed = true;
+ }
+
+ ///
+ /// The SCP-049 player instance.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The player that SCP-049 is attacking.
+ ///
+ public Player Target { get; }
+
+ ///
+ /// Gets or sets whether the attack is an instant kill.
+ ///
+ public bool InstantKill { get; set; }
+
+ ///
+ /// Gets or sets whether the is a sense target.
+ ///
+ public bool IsSenseTarget { get; set; }
+
+ ///
+ /// Gets or sets the cooldown for the attack ability.
+ ///
+ public float CooldownTime { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/Scp049Events/Scp049ResurrectedBodyEventArgs.cs b/LabApi/Events/Arguments/Scp049Events/Scp049ResurrectedBodyEventArgs.cs
index 7eba4f2d..2a4359d1 100644
--- a/LabApi/Events/Arguments/Scp049Events/Scp049ResurrectedBodyEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp049Events/Scp049ResurrectedBodyEventArgs.cs
@@ -13,11 +13,11 @@ public class Scp049ResurrectedBodyEventArgs : EventArgs, IPlayerEvent, ITargetEv
/// Initializes a new instance of the class.
///
/// The player that SCP-049 has resurrected.
- /// The SCP-049 player instance.
- public Scp049ResurrectedBodyEventArgs(ReferenceHub target, ReferenceHub player)
+ /// The SCP-049 player instance.
+ public Scp049ResurrectedBodyEventArgs(ReferenceHub target, ReferenceHub hub)
{
Target = Player.Get(target);
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp049Events/Scp049ResurrectingBodyEventArgs.cs b/LabApi/Events/Arguments/Scp049Events/Scp049ResurrectingBodyEventArgs.cs
index dac207f0..0e54e263 100644
--- a/LabApi/Events/Arguments/Scp049Events/Scp049ResurrectingBodyEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp049Events/Scp049ResurrectingBodyEventArgs.cs
@@ -14,12 +14,12 @@ public class Scp049ResurrectingBodyEventArgs : EventArgs, ICancellableEvent, IPl
///
/// The ragdoll that SCP-049 is resurrecting.
/// The player that SCP-049 is resurrecting.
- /// The SCP-049 player instance.
- public Scp049ResurrectingBodyEventArgs(Ragdoll ragdoll, ReferenceHub target, ReferenceHub player)
+ /// The SCP-049 player instance.
+ public Scp049ResurrectingBodyEventArgs(Ragdoll ragdoll, ReferenceHub target, ReferenceHub hub)
{
Ragdoll = ragdoll;
Target = Player.Get(target);
- Player = Player.Get(player);
+ Player = Player.Get(hub);
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp049Events/Scp049SenseKilledTargetEventArgs.cs b/LabApi/Events/Arguments/Scp049Events/Scp049SenseKilledTargetEventArgs.cs
new file mode 100644
index 00000000..96e557ad
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp049Events/Scp049SenseKilledTargetEventArgs.cs
@@ -0,0 +1,32 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp049Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp049SenseKilledTargetEventArgs : EventArgs, IPlayerEvent, ITargetEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The SCP-049 player instance.
+ /// The player that SCP-049 killed.
+ public Scp049SenseKilledTargetEventArgs(ReferenceHub hub, ReferenceHub target)
+ {
+ Player = Player.Get(hub);
+ Target = Player.Get(target);
+ }
+
+ ///
+ /// The SCP-049 player instance.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The player that SCP-049 has killed.
+ ///
+ public Player Target { get; }
+}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/Scp049Events/Scp049SenseLostTargetEventArgs.cs b/LabApi/Events/Arguments/Scp049Events/Scp049SenseLostTargetEventArgs.cs
new file mode 100644
index 00000000..89b564e3
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp049Events/Scp049SenseLostTargetEventArgs.cs
@@ -0,0 +1,32 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp049Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp049SenseLostTargetEventArgs : EventArgs, IPlayerEvent, ITargetEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The SCP-049 player instance.
+ /// The player that SCP-049 has targeted.
+ public Scp049SenseLostTargetEventArgs(ReferenceHub hub, ReferenceHub target)
+ {
+ Player = Player.Get(hub);
+ Target = Player.Get(target);
+ }
+
+ ///
+ /// The SCP-049 player instance.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The player that SCP-049 has targeted.
+ ///
+ public Player? Target { get; }
+}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/Scp049Events/Scp049StartingResurrectionEventArgs.cs b/LabApi/Events/Arguments/Scp049Events/Scp049StartingResurrectionEventArgs.cs
index a8f04cf8..8775f681 100644
--- a/LabApi/Events/Arguments/Scp049Events/Scp049StartingResurrectionEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp049Events/Scp049StartingResurrectionEventArgs.cs
@@ -16,13 +16,13 @@ public class Scp049StartingResurrectionEventArgs : EventArgs, ICancellableEvent,
/// Whether SCP-049 can resurrect the ragdoll.
/// The ragdoll that SCP-049 is resurrecting.
/// The owner of the ragdoll that SCP-049 is resurrecting.
- /// The SCP-049 player instance.
- public Scp049StartingResurrectionEventArgs(bool canResurrect, BasicRagdoll ragdoll, ReferenceHub? target, ReferenceHub player)
+ /// The SCP-049 player instance.
+ public Scp049StartingResurrectionEventArgs(bool canResurrect, BasicRagdoll ragdoll, ReferenceHub? target, ReferenceHub hub)
{
CanResurrect = canResurrect;
Ragdoll = Ragdoll.Get(ragdoll);
Target = Player.Get(target);
- Player = Player.Get(player);
+ Player = Player.Get(hub);
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp049Events/Scp049UsedDoctorsCallEventArgs.cs b/LabApi/Events/Arguments/Scp049Events/Scp049UsedDoctorsCallEventArgs.cs
index d358388a..78ca5252 100644
--- a/LabApi/Events/Arguments/Scp049Events/Scp049UsedDoctorsCallEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp049Events/Scp049UsedDoctorsCallEventArgs.cs
@@ -12,10 +12,10 @@ public class Scp049UsedDoctorsCallEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-049 player instance.
- public Scp049UsedDoctorsCallEventArgs(ReferenceHub player)
+ /// The SCP-049 player instance.
+ public Scp049UsedDoctorsCallEventArgs(ReferenceHub hub)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp049Events/Scp049UsedSenseEventArgs.cs b/LabApi/Events/Arguments/Scp049Events/Scp049UsedSenseEventArgs.cs
index 14c13d37..2d116944 100644
--- a/LabApi/Events/Arguments/Scp049Events/Scp049UsedSenseEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp049Events/Scp049UsedSenseEventArgs.cs
@@ -12,11 +12,11 @@ public class Scp049UsedSenseEventArgs : EventArgs, IPlayerEvent, ITargetEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-049 player instance.
+ /// The SCP-049 player instance.
/// The player that SCP-049 has used sense on.
- public Scp049UsedSenseEventArgs(ReferenceHub player, ReferenceHub target)
+ public Scp049UsedSenseEventArgs(ReferenceHub hub, ReferenceHub target)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Target = Player.Get(target);
}
diff --git a/LabApi/Events/Arguments/Scp049Events/Scp049UsingDoctorsCallEventArgs.cs b/LabApi/Events/Arguments/Scp049Events/Scp049UsingDoctorsCallEventArgs.cs
index a737c994..c3fbcb5a 100644
--- a/LabApi/Events/Arguments/Scp049Events/Scp049UsingDoctorsCallEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp049Events/Scp049UsingDoctorsCallEventArgs.cs
@@ -12,10 +12,10 @@ public class Scp049UsingDoctorsCallEventArgs : EventArgs, IPlayerEvent, ICancell
///
/// Initializes a new instance of the class.
///
- /// The SCP-049 player instance.
- public Scp049UsingDoctorsCallEventArgs(ReferenceHub player)
+ /// The SCP-049 player instance.
+ public Scp049UsingDoctorsCallEventArgs(ReferenceHub hub)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp049Events/Scp049UsingSenseEventArgs.cs b/LabApi/Events/Arguments/Scp049Events/Scp049UsingSenseEventArgs.cs
index 57bb77cc..89f0b8db 100644
--- a/LabApi/Events/Arguments/Scp049Events/Scp049UsingSenseEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp049Events/Scp049UsingSenseEventArgs.cs
@@ -12,11 +12,11 @@ public class Scp049UsingSenseEventArgs : EventArgs, IPlayerEvent, ITargetEvent,
///
/// Initializes a new instance of the class.
///
- /// The SCP-049 player instance.
+ /// The SCP-049 player instance.
/// The player that SCP-049 is using sense on.
- public Scp049UsingSenseEventArgs(ReferenceHub player, ReferenceHub target)
+ public Scp049UsingSenseEventArgs(ReferenceHub hub, ReferenceHub target)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Target = Player.Get(target);
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079BlackedOutRoomEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079BlackedOutRoomEventArgs.cs
index 1bc79797..7c8616a8 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079BlackedOutRoomEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079BlackedOutRoomEventArgs.cs
@@ -1,7 +1,7 @@
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
-using System;
using MapGeneration;
+using System;
namespace LabApi.Events.Arguments.Scp079Events;
@@ -13,11 +13,11 @@ public class Scp079BlackedOutRoomEventArgs : EventArgs, IPlayerEvent, IRoomEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The affected room instance.
- public Scp079BlackedOutRoomEventArgs(ReferenceHub player, RoomIdentifier room)
+ public Scp079BlackedOutRoomEventArgs(ReferenceHub hub, RoomIdentifier room)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Room = Room.Get(room);
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079BlackedOutZoneEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079BlackedOutZoneEventArgs.cs
index 112c7fe6..b2e17fa6 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079BlackedOutZoneEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079BlackedOutZoneEventArgs.cs
@@ -13,11 +13,11 @@ public class Scp079BlackedOutZoneEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The affected zone instance.
- public Scp079BlackedOutZoneEventArgs(ReferenceHub player, FacilityZone zone)
+ public Scp079BlackedOutZoneEventArgs(ReferenceHub hub, FacilityZone zone)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Zone = zone;
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079BlackingOutRoomEventsArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079BlackingOutRoomEventsArgs.cs
index c65a59cd..9d409f33 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079BlackingOutRoomEventsArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079BlackingOutRoomEventsArgs.cs
@@ -1,7 +1,7 @@
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
-using System;
using MapGeneration;
+using System;
namespace LabApi.Events.Arguments.Scp079Events;
@@ -13,11 +13,11 @@ public class Scp079BlackingOutRoomEventsArgs : EventArgs, IPlayerEvent, IRoomEve
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The affected room instance.
- public Scp079BlackingOutRoomEventsArgs(ReferenceHub player, RoomIdentifier room)
+ public Scp079BlackingOutRoomEventsArgs(ReferenceHub hub, RoomIdentifier room)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Room = Room.Get(room);
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079BlackingOutZoneEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079BlackingOutZoneEventArgs.cs
index 2c67fd05..aad04ab5 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079BlackingOutZoneEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079BlackingOutZoneEventArgs.cs
@@ -13,11 +13,11 @@ public class Scp079BlackingOutZoneEventArgs : EventArgs, IPlayerEvent, ICancella
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The affected zone instance.
- public Scp079BlackingOutZoneEventArgs(ReferenceHub player, FacilityZone zone)
+ public Scp079BlackingOutZoneEventArgs(ReferenceHub hub, FacilityZone zone)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Zone = zone;
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079CancelledRoomLockdownEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079CancelledRoomLockdownEventArgs.cs
index 5a0399e9..9ea59d04 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079CancelledRoomLockdownEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079CancelledRoomLockdownEventArgs.cs
@@ -1,7 +1,7 @@
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
-using System;
using MapGeneration;
+using System;
namespace LabApi.Events.Arguments.Scp079Events;
@@ -13,11 +13,11 @@ public class Scp079CancelledRoomLockdownEventArgs : EventArgs, IPlayerEvent, IRo
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The affected room instance.
- public Scp079CancelledRoomLockdownEventArgs(ReferenceHub player, RoomIdentifier room)
+ public Scp079CancelledRoomLockdownEventArgs(ReferenceHub hub, RoomIdentifier room)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Room = Room.Get(room);
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079CancellingRoomLockdownEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079CancellingRoomLockdownEventArgs.cs
index 756326e0..173bbab0 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079CancellingRoomLockdownEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079CancellingRoomLockdownEventArgs.cs
@@ -1,7 +1,7 @@
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
-using System;
using MapGeneration;
+using System;
namespace LabApi.Events.Arguments.Scp079Events;
@@ -13,11 +13,11 @@ public class Scp079CancellingRoomLockdownEventArgs : EventArgs, IPlayerEvent, IR
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The affected room instance.
- public Scp079CancellingRoomLockdownEventArgs(ReferenceHub player, RoomIdentifier room)
+ public Scp079CancellingRoomLockdownEventArgs(ReferenceHub hub, RoomIdentifier room)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Room = Room.Get(room);
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079ChangedCameraEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079ChangedCameraEventArgs.cs
index 743ccef1..856dacbd 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079ChangedCameraEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079ChangedCameraEventArgs.cs
@@ -13,11 +13,11 @@ public class Scp079ChangedCameraEventArgs : EventArgs, IPlayerEvent, ICameraEven
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The affected camera instance.
- public Scp079ChangedCameraEventArgs(ReferenceHub player, Scp079Camera camera)
+ public Scp079ChangedCameraEventArgs(ReferenceHub hub, Scp079Camera camera)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Camera = Camera.Get(camera);
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079ChangingCameraEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079ChangingCameraEventArgs.cs
index b6f14833..eab7b391 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079ChangingCameraEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079ChangingCameraEventArgs.cs
@@ -13,11 +13,11 @@ public class Scp079ChangingCameraEventArgs : EventArgs, IPlayerEvent, ICameraEve
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The affected camera instance.
- public Scp079ChangingCameraEventArgs(ReferenceHub player, Scp079Camera camera)
+ public Scp079ChangingCameraEventArgs(ReferenceHub hub, Scp079Camera camera)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Camera = Camera.Get(camera);
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079GainedExperienceEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079GainedExperienceEventArgs.cs
index be6aba7a..d000e3ad 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079GainedExperienceEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079GainedExperienceEventArgs.cs
@@ -1,7 +1,9 @@
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using PlayerRoles;
using PlayerRoles.PlayableScps.Scp079;
using System;
+using UnityEngine;
namespace LabApi.Events.Arguments.Scp079Events;
@@ -13,14 +15,16 @@ public class Scp079GainedExperienceEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The amount of experience gained.
/// The reason of experience gain shown in HUD.
- public Scp079GainedExperienceEventArgs(ReferenceHub player, float amount, Scp079HudTranslation reason)
+ /// The optional subject of the notification, used as replacement to display which class has been terminated.
+ public Scp079GainedExperienceEventArgs(ReferenceHub hub, float amount, Scp079HudTranslation reason, RoleTypeId subject)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Amount = amount;
Reason = reason;
+ Subject = subject;
}
///
@@ -37,4 +41,9 @@ public Scp079GainedExperienceEventArgs(ReferenceHub player, float amount, Scp079
/// The reason of experience gain shown in HUD.
///
public Scp079HudTranslation Reason { get; }
+
+ ///
+ /// Gets optional subject of the notification, used as replacement to display which class has been terminated.
+ ///
+ public RoleTypeId Subject { get; }
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079GainingExperienceEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079GainingExperienceEventArgs.cs
index 787811a1..33435d7e 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079GainingExperienceEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079GainingExperienceEventArgs.cs
@@ -1,5 +1,6 @@
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using PlayerRoles;
using PlayerRoles.PlayableScps.Scp079;
using System;
@@ -13,31 +14,38 @@ public class Scp079GainingExperienceEventArgs : EventArgs, IPlayerEvent, ICancel
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The amount of experience that is going to be gained.
/// The reason of experience gain that is going to be shown in HUD.
- public Scp079GainingExperienceEventArgs(ReferenceHub player, float amount, Scp079HudTranslation reason)
+ /// The optional subject of the notification, used as replacement to display which class has been terminated.
+ public Scp079GainingExperienceEventArgs(ReferenceHub hub, float amount, Scp079HudTranslation reason, RoleTypeId subject)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Amount = amount;
Reason = reason;
+ Subject = subject;
IsAllowed = true;
}
///
- /// The SCP-079 player instance.
+ /// Gets the SCP-079 player instance.
///
public Player Player { get; }
///
- /// The amount of experience that is going to be gained.
+ /// Gets or sets the amount of experience that is going to be gained.
///
- public float Amount { get; }
+ public float Amount { get; set; }
///
- /// The reason of experience gain that is going to be shown in HUD.
+ /// Gets or sets the reason of experience gain that is going to be shown in HUD.
///
- public Scp079HudTranslation Reason { get; }
+ public Scp079HudTranslation Reason { get; set; }
+
+ ///
+ /// Gets or sets the optional subject of the notification, used as replacement to display which class has been terminated.
+ ///
+ public RoleTypeId Subject { get; set; }
///
public bool IsAllowed { get; set; }
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079LeveledUpEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079LeveledUpEventArgs.cs
index 2dfabc9a..c7611315 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079LeveledUpEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079LeveledUpEventArgs.cs
@@ -12,11 +12,11 @@ public class Scp079LeveledUpEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The new SCP-079's tier.
- public Scp079LeveledUpEventArgs(ReferenceHub player, int tier)
+ public Scp079LeveledUpEventArgs(ReferenceHub hub, int tier)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Tier = tier;
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079LevelingUpEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079LevelingUpEventArgs.cs
index 704f5dd1..12988e42 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079LevelingUpEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079LevelingUpEventArgs.cs
@@ -12,11 +12,11 @@ public class Scp079LevelingUpEventArgs : EventArgs, IPlayerEvent, ICancellableEv
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The new SCP-079's tier.
- public Scp079LevelingUpEventArgs(ReferenceHub player, int tier)
+ public Scp079LevelingUpEventArgs(ReferenceHub hub, int tier)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Tier = tier;
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079LockedDoorEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079LockedDoorEventArgs.cs
index 112e5afe..03157713 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079LockedDoorEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079LockedDoorEventArgs.cs
@@ -1,7 +1,7 @@
-using LabApi.Events.Arguments.Interfaces;
+using Interactables.Interobjects.DoorUtils;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
using System;
-using Interactables.Interobjects.DoorUtils;
namespace LabApi.Events.Arguments.Scp079Events;
@@ -13,11 +13,11 @@ public class Scp079LockedDoorEventArgs : EventArgs, IPlayerEvent, IDoorEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The affected door instance.
- public Scp079LockedDoorEventArgs(ReferenceHub player, DoorVariant door)
+ public Scp079LockedDoorEventArgs(ReferenceHub hub, DoorVariant door)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Door = Door.Get(door);
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079LockedDownRoomEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079LockedDownRoomEventArgs.cs
index 91279f7f..ced4a88b 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079LockedDownRoomEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079LockedDownRoomEventArgs.cs
@@ -1,7 +1,7 @@
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
-using System;
using MapGeneration;
+using System;
namespace LabApi.Events.Arguments.Scp079Events;
@@ -13,11 +13,11 @@ public class Scp079LockedDownRoomEventArgs : EventArgs, IPlayerEvent, IRoomEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The affected room instance.
- public Scp079LockedDownRoomEventArgs(ReferenceHub player, RoomIdentifier room)
+ public Scp079LockedDownRoomEventArgs(ReferenceHub hub, RoomIdentifier room)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Room = Room.Get(room);
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079LockingDoorEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079LockingDoorEventArgs.cs
index ee1e7802..d63d8cbe 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079LockingDoorEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079LockingDoorEventArgs.cs
@@ -1,7 +1,7 @@
-using LabApi.Events.Arguments.Interfaces;
+using Interactables.Interobjects.DoorUtils;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
using System;
-using Interactables.Interobjects.DoorUtils;
namespace LabApi.Events.Arguments.Scp079Events;
@@ -13,11 +13,11 @@ public class Scp079LockingDoorEventArgs : EventArgs, IPlayerEvent, IDoorEvent, I
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The affected door instance.
- public Scp079LockingDoorEventArgs(ReferenceHub player, DoorVariant door)
+ public Scp079LockingDoorEventArgs(ReferenceHub hub, DoorVariant door)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Door = Door.Get(door);
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079LockingDownRoomEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079LockingDownRoomEventArgs.cs
index a0aaa940..b0cd31a0 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079LockingDownRoomEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079LockingDownRoomEventArgs.cs
@@ -1,7 +1,7 @@
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
-using System;
using MapGeneration;
+using System;
namespace LabApi.Events.Arguments.Scp079Events;
@@ -13,11 +13,11 @@ public class Scp079LockingDownRoomEventArgs : EventArgs, IPlayerEvent, IRoomEven
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The affected room instance.
- public Scp079LockingDownRoomEventArgs(ReferenceHub player, RoomIdentifier room)
+ public Scp079LockingDownRoomEventArgs(ReferenceHub hub, RoomIdentifier room)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Room = Room.Get(room);
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079RecontainedEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079RecontainedEventArgs.cs
index d519be81..7f542f49 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079RecontainedEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079RecontainedEventArgs.cs
@@ -12,11 +12,11 @@ public class Scp079RecontainedEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The player who activated the recontainment procedure.
- public Scp079RecontainedEventArgs(ReferenceHub player, ReferenceHub? activator)
+ public Scp079RecontainedEventArgs(ReferenceHub hub, ReferenceHub? activator)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Activator = Player.Get(activator);
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079RecontainingEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079RecontainingEventArgs.cs
index 9557b55d..e9bb3311 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079RecontainingEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079RecontainingEventArgs.cs
@@ -12,12 +12,12 @@ public class Scp079RecontainingEventArgs : EventArgs, IPlayerEvent, ICancellable
///
/// Initializes a new instance of the class.
///
- /// THe SCP-079 player instance.
+ /// THe SCP-079 player instance.
/// The player who activated the recontainment procedure.
- public Scp079RecontainingEventArgs(ReferenceHub player, ReferenceHub? activator)
+ public Scp079RecontainingEventArgs(ReferenceHub hub, ReferenceHub? activator)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Activator = Player.Get(activator);
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079UnlockedDoorEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079UnlockedDoorEventArgs.cs
index ac2b2128..3dc1b3c2 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079UnlockedDoorEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079UnlockedDoorEventArgs.cs
@@ -1,7 +1,7 @@
-using LabApi.Events.Arguments.Interfaces;
+using Interactables.Interobjects.DoorUtils;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
using System;
-using Interactables.Interobjects.DoorUtils;
namespace LabApi.Events.Arguments.Scp079Events;
@@ -13,11 +13,11 @@ public class Scp079UnlockedDoorEventArgs : EventArgs, IPlayerEvent, IDoorEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The affected door instance.
- public Scp079UnlockedDoorEventArgs(ReferenceHub player, DoorVariant door)
+ public Scp079UnlockedDoorEventArgs(ReferenceHub hub, DoorVariant door)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Door = Door.Get(door);
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079UnlockingDoorEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079UnlockingDoorEventArgs.cs
index 9d55ab03..6bfa3e9e 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079UnlockingDoorEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079UnlockingDoorEventArgs.cs
@@ -1,7 +1,7 @@
-using LabApi.Events.Arguments.Interfaces;
+using Interactables.Interobjects.DoorUtils;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
using System;
-using Interactables.Interobjects.DoorUtils;
namespace LabApi.Events.Arguments.Scp079Events;
@@ -13,11 +13,11 @@ public class Scp079UnlockingDoorEventArgs : EventArgs, IPlayerEvent, IDoorEvent,
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The affected door instance.
- public Scp079UnlockingDoorEventArgs(ReferenceHub player, DoorVariant door)
+ public Scp079UnlockingDoorEventArgs(ReferenceHub hub, DoorVariant door)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Door = Door.Get(door);
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079UsedTeslaEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079UsedTeslaEventArgs.cs
index ff26e05d..ee07d1c9 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079UsedTeslaEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079UsedTeslaEventArgs.cs
@@ -12,11 +12,11 @@ public class Scp079UsedTeslaEventArgs : EventArgs, IPlayerEvent, ITeslaEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The affected tesla instance.
- public Scp079UsedTeslaEventArgs(ReferenceHub player, TeslaGate tesla)
+ public Scp079UsedTeslaEventArgs(ReferenceHub hub, TeslaGate tesla)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Tesla = Tesla.Get(tesla);
}
@@ -24,7 +24,7 @@ public Scp079UsedTeslaEventArgs(ReferenceHub player, TeslaGate tesla)
/// The SCP-079 player instance.
///
public Player Player { get; }
-
+
///
public Tesla Tesla { get; }
}
diff --git a/LabApi/Events/Arguments/Scp079Events/Scp079UsingTeslaEventArgs.cs b/LabApi/Events/Arguments/Scp079Events/Scp079UsingTeslaEventArgs.cs
index fc4da733..41c31b69 100644
--- a/LabApi/Events/Arguments/Scp079Events/Scp079UsingTeslaEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp079Events/Scp079UsingTeslaEventArgs.cs
@@ -12,11 +12,11 @@ public class Scp079UsingTeslaEventArgs : EventArgs, IPlayerEvent, ITeslaEvent, I
///
/// Initializes a new instance of the class.
///
- /// The SCP-079 player instance.
+ /// The SCP-079 player instance.
/// The affected tesla instance.
- public Scp079UsingTeslaEventArgs(ReferenceHub player, TeslaGate tesla)
+ public Scp079UsingTeslaEventArgs(ReferenceHub hub, TeslaGate tesla)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Tesla = Tesla.Get(tesla);
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp096Events/Scp096AddedTargetEventArgs.cs b/LabApi/Events/Arguments/Scp096Events/Scp096AddedTargetEventArgs.cs
index b90adbe1..a17c23fb 100644
--- a/LabApi/Events/Arguments/Scp096Events/Scp096AddedTargetEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp096Events/Scp096AddedTargetEventArgs.cs
@@ -12,12 +12,12 @@ public class Scp096AddedTargetEventArgs : EventArgs, IPlayerEvent, ITargetEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-096 player instance.
+ /// The SCP-096 player instance.
/// The target player instance.
/// Whether the target looked at SCP-096.
- public Scp096AddedTargetEventArgs(ReferenceHub player, ReferenceHub target, bool wasLooking)
+ public Scp096AddedTargetEventArgs(ReferenceHub hub, ReferenceHub target, bool wasLooking)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Target = Player.Get(target);
WasLooking = wasLooking;
}
@@ -33,7 +33,7 @@ public Scp096AddedTargetEventArgs(ReferenceHub player, ReferenceHub target, bool
public Player Target { get; }
///
- /// Whether the target was looking at SCP-096
+ /// Whether the target was looking at SCP-096.
///
public bool WasLooking { get; }
}
diff --git a/LabApi/Events/Arguments/Scp096Events/Scp096AddingTargetEventArgs.cs b/LabApi/Events/Arguments/Scp096Events/Scp096AddingTargetEventArgs.cs
index afc74b28..2bbc125b 100644
--- a/LabApi/Events/Arguments/Scp096Events/Scp096AddingTargetEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp096Events/Scp096AddingTargetEventArgs.cs
@@ -12,12 +12,12 @@ public class Scp096AddingTargetEventArgs : EventArgs, IPlayerEvent, ITargetEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-096 player instance.
+ /// The SCP-096 player instance.
/// The target player instance.
/// Whether the target looked at SCP-096.
- public Scp096AddingTargetEventArgs(ReferenceHub player, ReferenceHub target, bool wasLooking)
+ public Scp096AddingTargetEventArgs(ReferenceHub hub, ReferenceHub target, bool wasLooking)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Target = Player.Get(target);
WasLooking = wasLooking;
IsAllowed = true;
@@ -34,7 +34,7 @@ public Scp096AddingTargetEventArgs(ReferenceHub player, ReferenceHub target, boo
public Player Target { get; }
///
- /// Whether the target was looking at SCP-096
+ /// Whether the target was looking at SCP-096.
///
public bool WasLooking { get; }
diff --git a/LabApi/Events/Arguments/Scp096Events/Scp096ChangedStateEventArgs.cs b/LabApi/Events/Arguments/Scp096Events/Scp096ChangedStateEventArgs.cs
index ac457100..eaa7c5f9 100644
--- a/LabApi/Events/Arguments/Scp096Events/Scp096ChangedStateEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp096Events/Scp096ChangedStateEventArgs.cs
@@ -13,11 +13,11 @@ public class Scp096ChangedStateEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-096 player instance.
+ /// The SCP-096 player instance.
/// The SCP-096's new rage state.
- public Scp096ChangedStateEventArgs(ReferenceHub player, Scp096RageState state)
+ public Scp096ChangedStateEventArgs(ReferenceHub hub, Scp096RageState state)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
State = state;
}
diff --git a/LabApi/Events/Arguments/Scp096Events/Scp096ChangingStateEventArgs.cs b/LabApi/Events/Arguments/Scp096Events/Scp096ChangingStateEventArgs.cs
index d0e984f2..00304ecd 100644
--- a/LabApi/Events/Arguments/Scp096Events/Scp096ChangingStateEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp096Events/Scp096ChangingStateEventArgs.cs
@@ -13,11 +13,11 @@ public class Scp096ChangingStateEventArgs : EventArgs, IPlayerEvent, ICancellabl
///
/// Initializes a new instance of the class.
///
- /// The SCP-096 player instance.
+ /// The SCP-096 player instance.
/// The SCP-096's new rage state.
- public Scp096ChangingStateEventArgs(ReferenceHub player, Scp096RageState state)
+ public Scp096ChangingStateEventArgs(ReferenceHub hub, Scp096RageState state)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
State = state;
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp096Events/Scp096ChargedEventArgs.cs b/LabApi/Events/Arguments/Scp096Events/Scp096ChargedEventArgs.cs
index 013ba81c..88affc05 100644
--- a/LabApi/Events/Arguments/Scp096Events/Scp096ChargedEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp096Events/Scp096ChargedEventArgs.cs
@@ -12,10 +12,10 @@ public class Scp096ChargedEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-096 player instance.
- public Scp096ChargedEventArgs(ReferenceHub player)
+ /// The SCP-096 player instance.
+ public Scp096ChargedEventArgs(ReferenceHub hub)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp096Events/Scp096ChargingEventArgs.cs b/LabApi/Events/Arguments/Scp096Events/Scp096ChargingEventArgs.cs
index b5849b11..1fd348da 100644
--- a/LabApi/Events/Arguments/Scp096Events/Scp096ChargingEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp096Events/Scp096ChargingEventArgs.cs
@@ -12,10 +12,10 @@ public class Scp096ChargingEventArgs : EventArgs, IPlayerEvent, ICancellableEven
///
/// Initializes a new instance of the class.
///
- /// The SCP-096 player instance.
- public Scp096ChargingEventArgs(ReferenceHub player)
+ /// The SCP-096 player instance.
+ public Scp096ChargingEventArgs(ReferenceHub hub)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp096Events/Scp096EnragedEventArgs.cs b/LabApi/Events/Arguments/Scp096Events/Scp096EnragedEventArgs.cs
index 330472a5..19709ebf 100644
--- a/LabApi/Events/Arguments/Scp096Events/Scp096EnragedEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp096Events/Scp096EnragedEventArgs.cs
@@ -12,11 +12,11 @@ public class Scp096EnragedEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-096 player instance.
+ /// The SCP-096 player instance.
/// The initial duration of the rage.
- public Scp096EnragedEventArgs(ReferenceHub player, float initialDuration)
+ public Scp096EnragedEventArgs(ReferenceHub hub, float initialDuration)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
InitialDuration = initialDuration;
}
diff --git a/LabApi/Events/Arguments/Scp096Events/Scp096EnragingEventArgs.cs b/LabApi/Events/Arguments/Scp096Events/Scp096EnragingEventArgs.cs
index 21ff5fce..8b51af12 100644
--- a/LabApi/Events/Arguments/Scp096Events/Scp096EnragingEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp096Events/Scp096EnragingEventArgs.cs
@@ -12,11 +12,11 @@ public class Scp096EnragingEventArgs : EventArgs, IPlayerEvent, ICancellableEven
///
/// Initializes a new instance of the class.
///
- /// The SCP-096 player instance.
+ /// The SCP-096 player instance.
/// The initial duration of the rage.
- public Scp096EnragingEventArgs(ReferenceHub player, float initialDuration)
+ public Scp096EnragingEventArgs(ReferenceHub hub, float initialDuration)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
InitialDuration = initialDuration;
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp096Events/Scp096PriedGateEventArgs.cs b/LabApi/Events/Arguments/Scp096Events/Scp096PriedGateEventArgs.cs
index c7315e6d..f7c5fd06 100644
--- a/LabApi/Events/Arguments/Scp096Events/Scp096PriedGateEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp096Events/Scp096PriedGateEventArgs.cs
@@ -13,11 +13,11 @@ public class Scp096PriedGateEventArgs : EventArgs, IPlayerEvent, IGateEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-096 player instance.
+ /// The SCP-096 player instance.
/// The affected pryable door instance.
- public Scp096PriedGateEventArgs(ReferenceHub player, PryableDoor gate)
+ public Scp096PriedGateEventArgs(ReferenceHub hub, PryableDoor gate)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Gate = Gate.Get(gate);
}
diff --git a/LabApi/Events/Arguments/Scp096Events/Scp096PryingGateEventArgs.cs b/LabApi/Events/Arguments/Scp096Events/Scp096PryingGateEventArgs.cs
index aab475f7..2e225423 100644
--- a/LabApi/Events/Arguments/Scp096Events/Scp096PryingGateEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp096Events/Scp096PryingGateEventArgs.cs
@@ -13,11 +13,11 @@ public class Scp096PryingGateEventArgs : EventArgs, IPlayerEvent, IGateEvent, IC
///
/// Initializes a new instance of the class.
///
- /// The SCP-096 player instance.
+ /// The SCP-096 player instance.
/// The affected pryable door instance.
- public Scp096PryingGateEventArgs(ReferenceHub player, PryableDoor gate)
+ public Scp096PryingGateEventArgs(ReferenceHub hub, PryableDoor gate)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Gate = Gate.Get(gate);
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp096Events/Scp096StartCryingEventArgs.cs b/LabApi/Events/Arguments/Scp096Events/Scp096StartCryingEventArgs.cs
index 8b50efaf..82580883 100644
--- a/LabApi/Events/Arguments/Scp096Events/Scp096StartCryingEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp096Events/Scp096StartCryingEventArgs.cs
@@ -12,10 +12,10 @@ public class Scp096StartCryingEventArgs : EventArgs, IPlayerEvent, ICancellableE
///
/// Initializes a new instance of the class.
///
- /// The SCP-096 player instance.
- public Scp096StartCryingEventArgs(ReferenceHub player)
+ /// The SCP-096 player instance.
+ public Scp096StartCryingEventArgs(ReferenceHub hub)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp096Events/Scp096StartedCryingEventArgs.cs b/LabApi/Events/Arguments/Scp096Events/Scp096StartedCryingEventArgs.cs
index e1dcede8..69aedd7a 100644
--- a/LabApi/Events/Arguments/Scp096Events/Scp096StartedCryingEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp096Events/Scp096StartedCryingEventArgs.cs
@@ -12,10 +12,10 @@ public class Scp096StartedCryingEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-096 player instance.
- public Scp096StartedCryingEventArgs(ReferenceHub player)
+ /// The SCP-096 player instance.
+ public Scp096StartedCryingEventArgs(ReferenceHub hub)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp096Events/Scp096TriedNotToCryEventArgs.cs b/LabApi/Events/Arguments/Scp096Events/Scp096TriedNotToCryEventArgs.cs
index 22fe4195..76b72dee 100644
--- a/LabApi/Events/Arguments/Scp096Events/Scp096TriedNotToCryEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp096Events/Scp096TriedNotToCryEventArgs.cs
@@ -12,10 +12,10 @@ public class Scp096TriedNotToCryEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-096 player instance.
- public Scp096TriedNotToCryEventArgs(ReferenceHub player)
+ /// The SCP-096 player instance.
+ public Scp096TriedNotToCryEventArgs(ReferenceHub hub)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp096Events/Scp096TryingNotToCryEventArgs.cs b/LabApi/Events/Arguments/Scp096Events/Scp096TryingNotToCryEventArgs.cs
index 7fb220b1..73428db7 100644
--- a/LabApi/Events/Arguments/Scp096Events/Scp096TryingNotToCryEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp096Events/Scp096TryingNotToCryEventArgs.cs
@@ -12,10 +12,10 @@ public class Scp096TryingNotToCryEventArgs : EventArgs, IPlayerEvent, ICancellab
///
/// Initializes a new instance of the class.
///
- /// The SCP-096 player instance.
- public Scp096TryingNotToCryEventArgs(ReferenceHub player)
+ /// The SCP-096 player instance.
+ public Scp096TryingNotToCryEventArgs(ReferenceHub hub)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp106Events/Scp106ChangedStalkModeEventArgs.cs b/LabApi/Events/Arguments/Scp106Events/Scp106ChangedStalkModeEventArgs.cs
index 0fdca5de..8a4d8bc4 100644
--- a/LabApi/Events/Arguments/Scp106Events/Scp106ChangedStalkModeEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp106Events/Scp106ChangedStalkModeEventArgs.cs
@@ -1,6 +1,6 @@
-using System;
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using System;
namespace LabApi.Events.Arguments.Scp106Events;
@@ -12,19 +12,19 @@ public class Scp106ChangedStalkModeEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-106 player instance.
+ /// The SCP-106 player instance.
/// Whether the ability was activated or deactivated.
- public Scp106ChangedStalkModeEventArgs(ReferenceHub player, bool active)
+ public Scp106ChangedStalkModeEventArgs(ReferenceHub hub, bool active)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
IsStalkActive = active;
}
-
+
///
/// Whether the ability was activated or deactivated.
///
public bool IsStalkActive { get; }
-
+
///
/// The SCP-106 player instance.
///
diff --git a/LabApi/Events/Arguments/Scp106Events/Scp106ChangedSubmersionStatusEventArgs.cs b/LabApi/Events/Arguments/Scp106Events/Scp106ChangedSubmersionStatusEventArgs.cs
index d2645590..7414dee0 100644
--- a/LabApi/Events/Arguments/Scp106Events/Scp106ChangedSubmersionStatusEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp106Events/Scp106ChangedSubmersionStatusEventArgs.cs
@@ -1,6 +1,6 @@
-using System;
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using System;
namespace LabApi.Events.Arguments.Scp106Events;
@@ -12,19 +12,19 @@ public class Scp106ChangedSubmersionStatusEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-106 player instance.
+ /// The SCP-106 player instance.
/// Whether the SCP-106 is submerging or emerging.
- public Scp106ChangedSubmersionStatusEventArgs(ReferenceHub player, bool isSubmerging)
+ public Scp106ChangedSubmersionStatusEventArgs(ReferenceHub hub, bool isSubmerging)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
IsSubmerging = isSubmerging;
}
-
+
///
/// Whether the SCP-106 is submerging or emerging.
///
public bool IsSubmerging { get; }
-
+
///
/// The SCP-106 player instance.
///
diff --git a/LabApi/Events/Arguments/Scp106Events/Scp106ChangedVigorEventArgs.cs b/LabApi/Events/Arguments/Scp106Events/Scp106ChangedVigorEventArgs.cs
index a94ed84b..fc65953b 100644
--- a/LabApi/Events/Arguments/Scp106Events/Scp106ChangedVigorEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp106Events/Scp106ChangedVigorEventArgs.cs
@@ -1,6 +1,6 @@
-using System;
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using System;
namespace LabApi.Events.Arguments.Scp106Events;
@@ -12,12 +12,12 @@ public class Scp106ChangedVigorEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-106 player instance.
+ /// The SCP-106 player instance.
/// The previous vigor value.
/// The new vigor value.
- public Scp106ChangedVigorEventArgs(ReferenceHub player, float oldVigor, float newVigor)
+ public Scp106ChangedVigorEventArgs(ReferenceHub hub, float oldVigor, float newVigor)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
OldValue = oldVigor;
Value = newVigor;
}
diff --git a/LabApi/Events/Arguments/Scp106Events/Scp106ChangingStalkModeEventArgs.cs b/LabApi/Events/Arguments/Scp106Events/Scp106ChangingStalkModeEventArgs.cs
index dbf5be08..cbe7ac71 100644
--- a/LabApi/Events/Arguments/Scp106Events/Scp106ChangingStalkModeEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp106Events/Scp106ChangingStalkModeEventArgs.cs
@@ -1,6 +1,6 @@
-using System;
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using System;
namespace LabApi.Events.Arguments.Scp106Events;
@@ -12,25 +12,25 @@ public class Scp106ChangingStalkModeEventArgs : EventArgs, IPlayerEvent, ICancel
///
/// Initializes a new instance of the class.
///
- /// The SCP-106 player instance.
+ /// The SCP-106 player instance.
/// Whether the ability is being activated or deactivated.
- public Scp106ChangingStalkModeEventArgs(ReferenceHub player, bool active)
+ public Scp106ChangingStalkModeEventArgs(ReferenceHub hub, bool active)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
IsStalkActive = active;
}
-
+
///
/// Whether the ability is being activated or deactivated.
///
public bool IsStalkActive { get; }
-
+
///
/// The SCP-106 player instance.
///
public Player Player { get; }
-
+
///
public bool IsAllowed { get; set; }
}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/Scp106Events/Scp106ChangingSubmersionStatusEventArgs.cs b/LabApi/Events/Arguments/Scp106Events/Scp106ChangingSubmersionStatusEventArgs.cs
index ad9b800f..3dfe5fea 100644
--- a/LabApi/Events/Arguments/Scp106Events/Scp106ChangingSubmersionStatusEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp106Events/Scp106ChangingSubmersionStatusEventArgs.cs
@@ -1,6 +1,6 @@
-using System;
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using System;
namespace LabApi.Events.Arguments.Scp106Events;
@@ -12,11 +12,11 @@ public class Scp106ChangingSubmersionStatusEventArgs : EventArgs, IPlayerEvent,
///
/// Initializes a new instance of the class.
///
- /// The SCP-106 player instance.
+ /// The SCP-106 player instance.
/// Whether the SCP-106 is submerging or emerging.
- public Scp106ChangingSubmersionStatusEventArgs(ReferenceHub player, bool isSubmerging)
+ public Scp106ChangingSubmersionStatusEventArgs(ReferenceHub hub, bool isSubmerging)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
IsSubmerging = isSubmerging;
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp106Events/Scp106ChangingVigorEventArgs.cs b/LabApi/Events/Arguments/Scp106Events/Scp106ChangingVigorEventArgs.cs
index bc174da0..19ddee11 100644
--- a/LabApi/Events/Arguments/Scp106Events/Scp106ChangingVigorEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp106Events/Scp106ChangingVigorEventArgs.cs
@@ -1,6 +1,6 @@
-using System;
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using System;
namespace LabApi.Events.Arguments.Scp106Events;
@@ -12,12 +12,12 @@ public class Scp106ChangingVigorEventArgs : EventArgs, IPlayerEvent, ICancellabl
///
/// Initializes a new instance of the class.
///
- /// The SCP-106 player instance.
+ /// The SCP-106 player instance.
/// The previous vigor value.
/// The new vigor value.
- public Scp106ChangingVigorEventArgs(ReferenceHub player, float oldValue, float value)
+ public Scp106ChangingVigorEventArgs(ReferenceHub hub, float oldValue, float value)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
OldValue = oldValue;
Value = value;
IsAllowed = true;
diff --git a/LabApi/Events/Arguments/Scp106Events/Scp106TeleportedPlayerEvent.cs b/LabApi/Events/Arguments/Scp106Events/Scp106TeleportedPlayerEvent.cs
index a8e2f397..5041bbb4 100644
--- a/LabApi/Events/Arguments/Scp106Events/Scp106TeleportedPlayerEvent.cs
+++ b/LabApi/Events/Arguments/Scp106Events/Scp106TeleportedPlayerEvent.cs
@@ -1,6 +1,6 @@
-using System;
-using LabApi.Events.Arguments.Interfaces;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using System;
namespace LabApi.Events.Arguments.Scp106Events;
@@ -12,11 +12,11 @@ public class Scp106TeleportedPlayerEvent : EventArgs, IPlayerEvent, ITargetEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-106 player instance.
+ /// The SCP-106 player instance.
/// The player that was teleported.
- public Scp106TeleportedPlayerEvent(ReferenceHub player, ReferenceHub target)
+ public Scp106TeleportedPlayerEvent(ReferenceHub hub, ReferenceHub target)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Target = Player.Get(target);
}
diff --git a/LabApi/Events/Arguments/Scp106Events/Scp106TeleportingPlayerEvent.cs b/LabApi/Events/Arguments/Scp106Events/Scp106TeleportingPlayerEvent.cs
index 29de2333..2c9bf1d1 100644
--- a/LabApi/Events/Arguments/Scp106Events/Scp106TeleportingPlayerEvent.cs
+++ b/LabApi/Events/Arguments/Scp106Events/Scp106TeleportingPlayerEvent.cs
@@ -1,6 +1,6 @@
-using System;
-using LabApi.Events.Arguments.Interfaces;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using System;
namespace LabApi.Events.Arguments.Scp106Events;
@@ -12,12 +12,12 @@ public class Scp106TeleportingPlayerEvent : EventArgs, IPlayerEvent, ITargetEven
///
/// Initializes a new instance of the class.
///
- /// The SCP-106 player instance.
+ /// The SCP-106 player instance.
/// The player that is being teleported.
- public Scp106TeleportingPlayerEvent(ReferenceHub player, ReferenceHub target)
+ public Scp106TeleportingPlayerEvent(ReferenceHub hub, ReferenceHub target)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Target = Player.Get(target);
}
diff --git a/LabApi/Events/Arguments/Scp106Events/Scp106UsedHunterAtlasEventArgs.cs b/LabApi/Events/Arguments/Scp106Events/Scp106UsedHunterAtlasEventArgs.cs
index 7fac8b7c..82ad3d05 100644
--- a/LabApi/Events/Arguments/Scp106Events/Scp106UsedHunterAtlasEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp106Events/Scp106UsedHunterAtlasEventArgs.cs
@@ -1,6 +1,6 @@
-using System;
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using System;
using UnityEngine;
namespace LabApi.Events.Arguments.Scp106Events;
@@ -13,11 +13,11 @@ public class Scp106UsedHunterAtlasEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-106 player instance.
+ /// The SCP-106 player instance.
/// The original position.
- public Scp106UsedHunterAtlasEventArgs(ReferenceHub player, Vector3 originalPosition)
+ public Scp106UsedHunterAtlasEventArgs(ReferenceHub hub, Vector3 originalPosition)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
OriginalPosition = originalPosition;
}
diff --git a/LabApi/Events/Arguments/Scp106Events/Scp106UsingHunterAtlasEventArgs.cs b/LabApi/Events/Arguments/Scp106Events/Scp106UsingHunterAtlasEventArgs.cs
index 294699da..7cad26d6 100644
--- a/LabApi/Events/Arguments/Scp106Events/Scp106UsingHunterAtlasEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp106Events/Scp106UsingHunterAtlasEventArgs.cs
@@ -1,6 +1,6 @@
-using System;
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using System;
using UnityEngine;
namespace LabApi.Events.Arguments.Scp106Events;
@@ -13,11 +13,11 @@ public class Scp106UsingHunterAtlasEventArgs : EventArgs, IPlayerEvent, ICancell
///
/// Initializes a new instance of the class.
///
- /// The SCP-106 player instance.
+ /// The SCP-106 player instance.
/// The destination position.
- public Scp106UsingHunterAtlasEventArgs(ReferenceHub player, Vector3 destinationPosition)
+ public Scp106UsingHunterAtlasEventArgs(ReferenceHub hub, Vector3 destinationPosition)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
DestinationPosition = destinationPosition;
IsAllowed = true;
}
diff --git a/LabApi/Events/Arguments/Scp127Events/Scp127GainExperienceEventArgs.cs b/LabApi/Events/Arguments/Scp127Events/Scp127GainExperienceEventArgs.cs
new file mode 100644
index 00000000..2e15869f
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp127Events/Scp127GainExperienceEventArgs.cs
@@ -0,0 +1,34 @@
+using InventorySystem.Items.Firearms;
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Events.Arguments.Scp127Events;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp127Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp127GainExperienceEventArgs : EventArgs, IScp127ItemEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The Scp-127 firearm.
+ /// The gained experience.
+ public Scp127GainExperienceEventArgs(Firearm weapon, float exp)
+ {
+ Scp127Item = (Scp127Firearm)FirearmItem.Get(weapon);
+ ExperienceGain = exp;
+ }
+
+ ///
+ /// Gets the SCP-127 firearm.
+ ///
+ public Scp127Firearm Scp127Item { get; }
+
+ ///
+ /// Gets the amount of experience the SCP-127 gained.
+ ///
+ public float ExperienceGain { get; }
+}
diff --git a/LabApi/Events/Arguments/Scp127Events/Scp127GainingExperienceEventArgs.cs b/LabApi/Events/Arguments/Scp127Events/Scp127GainingExperienceEventArgs.cs
new file mode 100644
index 00000000..2bec197f
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp127Events/Scp127GainingExperienceEventArgs.cs
@@ -0,0 +1,37 @@
+using InventorySystem.Items.Firearms;
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp127Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp127GainingExperienceEventArgs : EventArgs, IScp127ItemEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The Scp-127 firearm.
+ /// The experience to be gained.
+ public Scp127GainingExperienceEventArgs(Firearm weapon, float exp)
+ {
+ Scp127Item = (Scp127Firearm)FirearmItem.Get(weapon);
+ ExperienceGain = exp;
+ IsAllowed = true;
+ }
+
+ ///
+ /// Gets the SCP-127 firearm.
+ ///
+ public Scp127Firearm Scp127Item { get; }
+
+ ///
+ /// Gets or sets the amount of experience the SCP-127 will gain.
+ ///
+ public float ExperienceGain { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/Scp127Events/Scp127LevelUpEventArgs.cs b/LabApi/Events/Arguments/Scp127Events/Scp127LevelUpEventArgs.cs
new file mode 100644
index 00000000..2fd9baf5
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp127Events/Scp127LevelUpEventArgs.cs
@@ -0,0 +1,34 @@
+using InventorySystem.Items.Firearms;
+using InventorySystem.Items.Firearms.Modules.Scp127;
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp127Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp127LevelUpEventArgs : EventArgs, IScp127ItemEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The Scp-127 firearm.
+ /// The new tier.
+ public Scp127LevelUpEventArgs(Firearm weapon, Scp127Tier tier)
+ {
+ Scp127Item = (Scp127Firearm)FirearmItem.Get(weapon);
+ Tier = tier;
+ }
+
+ ///
+ /// Gets the SCP-127 firearm.
+ ///
+ public Scp127Firearm Scp127Item { get; }
+
+ ///
+ /// Gets the new tier of SCP-127.
+ ///
+ public Scp127Tier Tier { get; }
+}
diff --git a/LabApi/Events/Arguments/Scp127Events/Scp127LevellingUpEventArgs.cs b/LabApi/Events/Arguments/Scp127Events/Scp127LevellingUpEventArgs.cs
new file mode 100644
index 00000000..f412e379
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp127Events/Scp127LevellingUpEventArgs.cs
@@ -0,0 +1,38 @@
+using InventorySystem.Items.Firearms;
+using InventorySystem.Items.Firearms.Modules.Scp127;
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp127Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp127LevellingUpEventArgs : EventArgs, IScp127ItemEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The Scp-127 firearm.
+ /// The new tier.
+ public Scp127LevellingUpEventArgs(Firearm weapon, Scp127Tier tier)
+ {
+ Scp127Item = (Scp127Firearm)FirearmItem.Get(weapon);
+ Tier = tier;
+ IsAllowed = true;
+ }
+
+ ///
+ /// Gets the SCP-127 firearm.
+ ///
+ public Scp127Firearm Scp127Item { get; }
+
+ ///
+ /// Gets the new tier of SCP-127.
+ ///
+ public Scp127Tier Tier { get; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/Scp127Events/Scp127TalkedEventArgs.cs b/LabApi/Events/Arguments/Scp127Events/Scp127TalkedEventArgs.cs
new file mode 100644
index 00000000..b3593573
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp127Events/Scp127TalkedEventArgs.cs
@@ -0,0 +1,42 @@
+using InventorySystem.Items.Firearms;
+using InventorySystem.Items.Firearms.Modules.Scp127;
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using static InventorySystem.Items.Firearms.Modules.Scp127.Scp127VoiceTriggerBase;
+
+namespace LabApi.Events.Arguments.Scp127Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp127TalkedEventArgs : EventArgs, IScp127ItemEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The Scp-127 firearm.
+ /// The voiceline to be played.
+ /// The priority of the voiceline.
+ public Scp127TalkedEventArgs(Firearm weapon, Scp127VoiceLinesTranslation voiceLine, VoiceLinePriority priority)
+ {
+ Scp127Item = (Scp127Firearm)FirearmItem.Get(weapon);
+ VoiceLine = voiceLine;
+ Priority = priority;
+ }
+
+ ///
+ /// Gets the SCP-127 firearm.
+ ///
+ public Scp127Firearm Scp127Item { get; }
+
+ ///
+ /// Gets the voiceline the SCP-127 played.
+ ///
+ public Scp127VoiceLinesTranslation VoiceLine { get; }
+
+ ///
+ /// Gets the priority the voiceline has been played with.
+ ///
+ public VoiceLinePriority Priority { get; }
+}
diff --git a/LabApi/Events/Arguments/Scp127Events/Scp127TalkingEventArgs.cs b/LabApi/Events/Arguments/Scp127Events/Scp127TalkingEventArgs.cs
new file mode 100644
index 00000000..72500cf4
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp127Events/Scp127TalkingEventArgs.cs
@@ -0,0 +1,46 @@
+using InventorySystem.Items.Firearms;
+using InventorySystem.Items.Firearms.Modules.Scp127;
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using static InventorySystem.Items.Firearms.Modules.Scp127.Scp127VoiceTriggerBase;
+
+namespace LabApi.Events.Arguments.Scp127Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp127TalkingEventArgs : EventArgs, IScp127ItemEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The Scp-127 firearm.
+ /// The voiceline to be played.
+ /// The priority of the voiceline.
+ public Scp127TalkingEventArgs(Firearm weapon, Scp127VoiceLinesTranslation voiceLine, VoiceLinePriority priority)
+ {
+ Scp127Item = (Scp127Firearm)FirearmItem.Get(weapon);
+ VoiceLine = voiceLine;
+ Priority = priority;
+ IsAllowed = true;
+ }
+
+ ///
+ /// Gets the SCP-127 firearm.
+ ///
+ public Scp127Firearm Scp127Item { get; }
+
+ ///
+ /// Gets or sets the voiceline the SCP-127 will play.
+ ///
+ public Scp127VoiceLinesTranslation VoiceLine { get; set; }
+
+ ///
+ /// Gets or sets the priority the voiceline will be played with.
+ ///
+ public VoiceLinePriority Priority { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/Scp173Events/Scp173AddedObserverEventArgs.cs b/LabApi/Events/Arguments/Scp173Events/Scp173AddedObserverEventArgs.cs
index c81cf17b..0c2e8535 100644
--- a/LabApi/Events/Arguments/Scp173Events/Scp173AddedObserverEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp173Events/Scp173AddedObserverEventArgs.cs
@@ -13,11 +13,11 @@ public class Scp173AddedObserverEventArgs : EventArgs, IPlayerEvent, ITargetEven
/// Initializes a new instance of the class.
///
/// The player that is observing the SCP-173 player.
- /// The SCP-173 player instance.
- public Scp173AddedObserverEventArgs(ReferenceHub target, ReferenceHub player)
+ /// The SCP-173 player instance.
+ public Scp173AddedObserverEventArgs(ReferenceHub target, ReferenceHub hub)
{
Target = Player.Get(target);
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp173Events/Scp173AddingObserverEventArgs.cs b/LabApi/Events/Arguments/Scp173Events/Scp173AddingObserverEventArgs.cs
index d1ab49b4..711b0ccb 100644
--- a/LabApi/Events/Arguments/Scp173Events/Scp173AddingObserverEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp173Events/Scp173AddingObserverEventArgs.cs
@@ -13,12 +13,12 @@ public class Scp173AddingObserverEventArgs : EventArgs, IPlayerEvent, ITargetEve
/// Initializes a new instance of the class.
///
/// The player that is observing the SCP-173 player.
- /// The SCP-173 player instance.
- public Scp173AddingObserverEventArgs(ReferenceHub target, ReferenceHub player)
+ /// The SCP-173 player instance.
+ public Scp173AddingObserverEventArgs(ReferenceHub target, ReferenceHub hub)
{
IsAllowed = true;
Target = Player.Get(target);
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp173Events/Scp173BreakneckSpeedChangedEventArgs.cs b/LabApi/Events/Arguments/Scp173Events/Scp173BreakneckSpeedChangedEventArgs.cs
index 1fde5556..8fdfcf00 100644
--- a/LabApi/Events/Arguments/Scp173Events/Scp173BreakneckSpeedChangedEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp173Events/Scp173BreakneckSpeedChangedEventArgs.cs
@@ -12,11 +12,11 @@ public class Scp173BreakneckSpeedChangedEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-173 player instance.
+ /// The SCP-173 player instance.
/// The new breakneck speed state.
- public Scp173BreakneckSpeedChangedEventArgs(ReferenceHub player, bool active)
+ public Scp173BreakneckSpeedChangedEventArgs(ReferenceHub hub, bool active)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Active = active;
}
diff --git a/LabApi/Events/Arguments/Scp173Events/Scp173BreakneckSpeedChangingEventArgs.cs b/LabApi/Events/Arguments/Scp173Events/Scp173BreakneckSpeedChangingEventArgs.cs
index 2d55a31d..f625325a 100644
--- a/LabApi/Events/Arguments/Scp173Events/Scp173BreakneckSpeedChangingEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp173Events/Scp173BreakneckSpeedChangingEventArgs.cs
@@ -12,12 +12,12 @@ public class Scp173BreakneckSpeedChangingEventArgs : EventArgs, IPlayerEvent, IC
///
/// Initializes a new instance of the class.
///
- /// The SCP-173 player instance.
+ /// The SCP-173 player instance.
/// The new breakneck speed state.
- public Scp173BreakneckSpeedChangingEventArgs(ReferenceHub player, bool active)
+ public Scp173BreakneckSpeedChangingEventArgs(ReferenceHub hub, bool active)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Active = active;
}
@@ -27,7 +27,7 @@ public Scp173BreakneckSpeedChangingEventArgs(ReferenceHub player, bool active)
public bool Active { get; }
///
- /// The SCP-173 player instance.
+ /// The SCP-173 player instance.
///
public Player Player { get; }
diff --git a/LabApi/Events/Arguments/Scp173Events/Scp173CreatedTantrumEventArgs.cs b/LabApi/Events/Arguments/Scp173Events/Scp173CreatedTantrumEventArgs.cs
index 96381655..b7e12947 100644
--- a/LabApi/Events/Arguments/Scp173Events/Scp173CreatedTantrumEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp173Events/Scp173CreatedTantrumEventArgs.cs
@@ -14,11 +14,11 @@ public class Scp173CreatedTantrumEventArgs : EventArgs, IPlayerEvent, ITantrumEv
/// Initializes a new instance of the class.
///
/// The tantrum instance.
- /// The SCP-173 player instance.
- public Scp173CreatedTantrumEventArgs(TantrumEnvironmentalHazard tantrumInstance, ReferenceHub player)
+ /// The SCP-173 player instance.
+ public Scp173CreatedTantrumEventArgs(TantrumEnvironmentalHazard tantrumInstance, ReferenceHub hub)
{
Tantrum = TantrumHazard.Get(tantrumInstance);
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp173Events/Scp173CreatingTantrumEventArgs.cs b/LabApi/Events/Arguments/Scp173Events/Scp173CreatingTantrumEventArgs.cs
index 0fed36a0..e4d65fdb 100644
--- a/LabApi/Events/Arguments/Scp173Events/Scp173CreatingTantrumEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp173Events/Scp173CreatingTantrumEventArgs.cs
@@ -12,11 +12,11 @@ public class Scp173CreatingTantrumEventArgs : EventArgs, IPlayerEvent, ICancella
///
/// Initializes a new instance of the class.
///
- /// The SCP-173 player instance.
- public Scp173CreatingTantrumEventArgs(ReferenceHub player)
+ /// The SCP-173 player instance.
+ public Scp173CreatingTantrumEventArgs(ReferenceHub hub)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp173Events/Scp173PlayedSoundEventArgs.cs b/LabApi/Events/Arguments/Scp173Events/Scp173PlayedSoundEventArgs.cs
index a53571f7..17dba443 100644
--- a/LabApi/Events/Arguments/Scp173Events/Scp173PlayedSoundEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp173Events/Scp173PlayedSoundEventArgs.cs
@@ -13,11 +13,11 @@ public class Scp173PlayedSoundEventArgs : EventArgs, IPlayerEvent
///
/// The sound id that is being played.
///
- /// The SCP-173 player instance.
- /// The sound id that is being played.
- public Scp173PlayedSoundEventArgs(ReferenceHub player, Scp173AudioPlayer.Scp173SoundId soundId)
+ /// The SCP-173 player instance.
+ /// The sound id being played.
+ public Scp173PlayedSoundEventArgs(ReferenceHub hub, Scp173AudioPlayer.Scp173SoundId soundId)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
SoundId = soundId;
}
@@ -30,5 +30,4 @@ public Scp173PlayedSoundEventArgs(ReferenceHub player, Scp173AudioPlayer.Scp173S
/// The SCP-173 player instance.
///
public Player Player { get; }
-
}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/Scp173Events/Scp173PlayingSoundEventArgs.cs b/LabApi/Events/Arguments/Scp173Events/Scp173PlayingSoundEventArgs.cs
index 2d704082..f1fc4f63 100644
--- a/LabApi/Events/Arguments/Scp173Events/Scp173PlayingSoundEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp173Events/Scp173PlayingSoundEventArgs.cs
@@ -13,12 +13,12 @@ public class Scp173PlayingSoundEventArgs : EventArgs, IPlayerEvent, ICancellable
///
/// The sound id that is going to be played.
///
- /// The SCP-173 player instance.
- /// The sound id that is going to be played.
- public Scp173PlayingSoundEventArgs(ReferenceHub player, Scp173AudioPlayer.Scp173SoundId soundId)
+ /// The SCP-173 player instance.
+ /// The sound id going to be played.
+ public Scp173PlayingSoundEventArgs(ReferenceHub hub, Scp173AudioPlayer.Scp173SoundId soundId)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
SoundId = soundId;
}
diff --git a/LabApi/Events/Arguments/Scp173Events/Scp173RemovedObserverEventArgs.cs b/LabApi/Events/Arguments/Scp173Events/Scp173RemovedObserverEventArgs.cs
index 788e5264..5f51f5a4 100644
--- a/LabApi/Events/Arguments/Scp173Events/Scp173RemovedObserverEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp173Events/Scp173RemovedObserverEventArgs.cs
@@ -13,11 +13,11 @@ public class Scp173RemovedObserverEventArgs : EventArgs, IPlayerEvent, ITargetEv
/// Initializes a new instance of the class.
///
/// The player that was observing the SCP-173 player.
- /// The SCP-173 player instance.
- public Scp173RemovedObserverEventArgs(ReferenceHub target, ReferenceHub player)
+ /// The SCP-173 player instance.
+ public Scp173RemovedObserverEventArgs(ReferenceHub target, ReferenceHub hub)
{
Target = Player.Get(target);
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp173Events/Scp173RemovingObserverEventArgs.cs b/LabApi/Events/Arguments/Scp173Events/Scp173RemovingObserverEventArgs.cs
index 31a08021..d3d1a19a 100644
--- a/LabApi/Events/Arguments/Scp173Events/Scp173RemovingObserverEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp173Events/Scp173RemovingObserverEventArgs.cs
@@ -13,12 +13,12 @@ public class Scp173RemovingObserverEventArgs : EventArgs, IPlayerEvent, ITargetE
/// Initializes a new instance of the class.
///
/// The player that was observing the SCP-173 player.
- /// The SCP-173 player instance.
- public Scp173RemovingObserverEventArgs(ReferenceHub target, ReferenceHub player)
+ /// The SCP-173 player instance.
+ public Scp173RemovingObserverEventArgs(ReferenceHub target, ReferenceHub hub)
{
IsAllowed = true;
Target = Player.Get(target);
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp173Events/Scp173SnappedEventArgs.cs b/LabApi/Events/Arguments/Scp173Events/Scp173SnappedEventArgs.cs
new file mode 100644
index 00000000..bc97f889
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp173Events/Scp173SnappedEventArgs.cs
@@ -0,0 +1,32 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp173Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp173SnappedEventArgs : EventArgs, IPlayerEvent, ITargetEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The SCP-173 player.
+ /// The player that has been snapped.
+ public Scp173SnappedEventArgs(ReferenceHub hub, ReferenceHub target)
+ {
+ Player = Player.Get(hub);
+ Target = Player.Get(target);
+ }
+
+ ///
+ /// Gets the SCP-173 player instance.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the player that has been snapped.
+ ///
+ public Player Target { get; }
+}
diff --git a/LabApi/Events/Arguments/Scp173Events/Scp173SnappingEventArgs.cs b/LabApi/Events/Arguments/Scp173Events/Scp173SnappingEventArgs.cs
new file mode 100644
index 00000000..d05edee4
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp173Events/Scp173SnappingEventArgs.cs
@@ -0,0 +1,38 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp173Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp173SnappingEventArgs : EventArgs, IPlayerEvent, ITargetEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The SCP-173 player.
+ /// The player to snap.
+ public Scp173SnappingEventArgs(ReferenceHub hub, ReferenceHub target)
+ {
+ IsAllowed = true;
+ Player = Player.Get(hub);
+ Target = Player.Get(target);
+ }
+
+ ///
+ /// Gets the SCP-173 player instance.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets or sets the player to snap.
+ ///
+ public Player Target { get; set; }
+
+ ///
+ /// Gets or sets whether the SCP-173 player can snap the target.
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/Scp173Events/Scp173TeleportedEventArgs.cs b/LabApi/Events/Arguments/Scp173Events/Scp173TeleportedEventArgs.cs
new file mode 100644
index 00000000..e77a7e5b
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp173Events/Scp173TeleportedEventArgs.cs
@@ -0,0 +1,41 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using UnityEngine;
+
+namespace LabApi.Events.Arguments.Scp173Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp173TeleportedEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The SCP-173 player.
+ /// The target position to teleport to.
+ public Scp173TeleportedEventArgs(ReferenceHub hub, Vector3 position)
+ {
+ IsAllowed = true;
+ Player = Player.Get(hub);
+ Position = position;
+ }
+
+ ///
+ /// Gets the SCP-173 player instance.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the target player position that the SCP-173 has teleported to.
+ /// Note that this position is on the floor and the has been teleported 1/2 of its character height up to prevent clipping through floor.
+ ///
+ public Vector3 Position { get; }
+
+ ///
+ /// Gets or sets whether the SCP-173 player can teleport.
+ /// This even is fired even if the charge ability is not ready so you may override it on the server aswell.
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/Scp173Events/Scp173TeleportingEventArgs.cs b/LabApi/Events/Arguments/Scp173Events/Scp173TeleportingEventArgs.cs
new file mode 100644
index 00000000..461814b9
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp173Events/Scp173TeleportingEventArgs.cs
@@ -0,0 +1,38 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using UnityEngine;
+
+namespace LabApi.Events.Arguments.Scp173Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp173TeleportingEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The SCP-173 player.
+ /// The target position to teleport to.
+ public Scp173TeleportingEventArgs(ReferenceHub hub, Vector3 position)
+ {
+ Player = Player.Get(hub);
+ Position = position;
+ IsAllowed = true;
+ }
+
+ ///
+ /// Gets the SCP-173 player instance.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets or sets the target player position to teleport SCP-173 player to.
+ /// Note that this position is on the floor and the is then teleported 1/2 of its character height up to prevent clipping through floor.
+ ///
+ public Vector3 Position { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/Scp3114Events/Scp3114DisguisedEventArgs.cs b/LabApi/Events/Arguments/Scp3114Events/Scp3114DisguisedEventArgs.cs
new file mode 100644
index 00000000..2efb3651
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp3114Events/Scp3114DisguisedEventArgs.cs
@@ -0,0 +1,29 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using PlayerRoles.Ragdolls;
+using System;
+
+namespace LabApi.Events.Arguments.Scp3114Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp3114DisguisedEventArgs : EventArgs, IPlayerEvent, IRagdollEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player SCP who disguised.
+ /// The ragdoll used for disguising purposes.
+ public Scp3114DisguisedEventArgs(ReferenceHub player, BasicRagdoll ragdoll)
+ {
+ Player = Player.Get(player);
+ Ragdoll = Ragdoll.Get(ragdoll);
+ }
+
+ ///
+ public Player Player { get; }
+
+ ///
+ public Ragdoll Ragdoll { get; }
+}
diff --git a/LabApi/Events/Arguments/Scp3114Events/Scp3114DisguisingEventArgs.cs b/LabApi/Events/Arguments/Scp3114Events/Scp3114DisguisingEventArgs.cs
new file mode 100644
index 00000000..d5f2e7a5
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp3114Events/Scp3114DisguisingEventArgs.cs
@@ -0,0 +1,33 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using PlayerRoles.Ragdolls;
+using System;
+
+namespace LabApi.Events.Arguments.Scp3114Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp3114DisguisingEventArgs : EventArgs, IPlayerEvent, IRagdollEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player SCP who is disguising.
+ /// The ragdoll used for disguising purposes.
+ public Scp3114DisguisingEventArgs(ReferenceHub player, BasicRagdoll ragdoll)
+ {
+ Player = Player.Get(player);
+ Ragdoll = Ragdoll.Get(ragdoll);
+ IsAllowed = true;
+ }
+
+ ///
+ public Player Player { get; }
+
+ ///
+ public Ragdoll Ragdoll { get; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/Scp3114Events/Scp3114RevealedEventArgs.cs b/LabApi/Events/Arguments/Scp3114Events/Scp3114RevealedEventArgs.cs
new file mode 100644
index 00000000..8c17004d
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp3114Events/Scp3114RevealedEventArgs.cs
@@ -0,0 +1,30 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp3114Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp3114RevealedEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player SCP so is undisguised.
+ /// Bool whether the reveal is forced by timer running out or if it was player's request.
+ public Scp3114RevealedEventArgs(ReferenceHub player, bool forced)
+ {
+ Player = Player.Get(player);
+ Forced = forced;
+ }
+
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets whether the reveal was forced by timer running out or if it was player's request.
+ ///
+ public bool Forced { get; }
+}
diff --git a/LabApi/Events/Arguments/Scp3114Events/Scp3114RevealingEventArgs.cs b/LabApi/Events/Arguments/Scp3114Events/Scp3114RevealingEventArgs.cs
new file mode 100644
index 00000000..9bba6944
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp3114Events/Scp3114RevealingEventArgs.cs
@@ -0,0 +1,34 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp3114Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp3114RevealingEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player SCP who is undisguising.
+ /// Bool whether the reveal is forced by timer running out or if it was player's request.
+ public Scp3114RevealingEventArgs(ReferenceHub player, bool forced)
+ {
+ Player = Player.Get(player);
+ Forced = forced;
+ IsAllowed = true;
+ }
+
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets whether the reveal is forced by timer running out or if it was player's request.
+ ///
+ public bool Forced { get; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/Scp3114Events/Scp3114StartedDanceEventArgs.cs b/LabApi/Events/Arguments/Scp3114Events/Scp3114StartedDanceEventArgs.cs
new file mode 100644
index 00000000..431a4784
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp3114Events/Scp3114StartedDanceEventArgs.cs
@@ -0,0 +1,30 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp3114Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp3114StartedDanceEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player who is starting to dance.
+ /// The index of the animation to play.
+ public Scp3114StartedDanceEventArgs(ReferenceHub player, byte danceId)
+ {
+ Player = Player.Get(player);
+ DanceId = danceId;
+ }
+
+ ///
+ /// Gets or sets the index of the animation to play.
+ ///
+ public byte DanceId { get; }
+
+ ///
+ public Player Player { get; }
+}
diff --git a/LabApi/Events/Arguments/Scp3114Events/Scp3114StartingDanceEventArgs.cs b/LabApi/Events/Arguments/Scp3114Events/Scp3114StartingDanceEventArgs.cs
new file mode 100644
index 00000000..9f3a8099
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp3114Events/Scp3114StartingDanceEventArgs.cs
@@ -0,0 +1,36 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp3114Events;
+
+///
+/// Represents the arguments for the event.
+///
+public class Scp3114StartingDanceEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player who is starting to dance.
+ /// The index of the animation to play.
+ public Scp3114StartingDanceEventArgs(ReferenceHub player, byte danceId)
+ {
+ Player = Player.Get(player);
+ DanceId = danceId;
+ IsAllowed = true;
+ }
+
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets or sets the index of the animation to play.
+ /// Currently there are 7 dance variants in game.
+ /// Any value above max length will be moved to equal index via modulo (%) operator.
+ ///
+ public byte DanceId { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/Scp3114Events/Scp3114StrangleAbortedEventArgs.cs b/LabApi/Events/Arguments/Scp3114Events/Scp3114StrangleAbortedEventArgs.cs
new file mode 100644
index 00000000..fbd89912
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp3114Events/Scp3114StrangleAbortedEventArgs.cs
@@ -0,0 +1,32 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp3114Events;
+
+///
+/// Represents the arguments for the events.
+///
+public class Scp3114StrangleAbortedEventArgs : EventArgs, IPlayerEvent, ITargetEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The component of the SCP-3114 player.
+ /// The component of the target player.
+ public Scp3114StrangleAbortedEventArgs(ReferenceHub scp3114Hub, ReferenceHub targetHub)
+ {
+ Player = Player.Get(scp3114Hub);
+ Target = Player.Get(targetHub);
+ }
+
+ ///
+ /// The SCP-3114 player.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The strangle target.
+ ///
+ public Player Target { get; }
+}
diff --git a/LabApi/Events/Arguments/Scp3114Events/Scp3114StrangleAbortingEventArgs.cs b/LabApi/Events/Arguments/Scp3114Events/Scp3114StrangleAbortingEventArgs.cs
new file mode 100644
index 00000000..b1543bbf
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp3114Events/Scp3114StrangleAbortingEventArgs.cs
@@ -0,0 +1,36 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp3114Events;
+
+///
+/// Represents the arguments for the events.
+///
+public class Scp3114StrangleAbortingEventArgs : EventArgs, IPlayerEvent, ITargetEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The component of the SCP-3114 player.
+ /// The component of the target player.
+ public Scp3114StrangleAbortingEventArgs(ReferenceHub scp3114Hub, ReferenceHub targetHub)
+ {
+ Player = Player.Get(scp3114Hub);
+ Target = Player.Get(targetHub);
+ IsAllowed = true;
+ }
+
+ ///
+ /// The SCP-3114 player.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The strangle target.
+ ///
+ public Player Target { get; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/Scp3114Events/Scp3114StrangleStartedEventArgs.cs b/LabApi/Events/Arguments/Scp3114Events/Scp3114StrangleStartedEventArgs.cs
new file mode 100644
index 00000000..b784b4a6
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp3114Events/Scp3114StrangleStartedEventArgs.cs
@@ -0,0 +1,32 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp3114Events;
+
+///
+/// Represents the arguments for the events.
+///
+public class Scp3114StrangleStartedEventArgs : EventArgs, IPlayerEvent, ITargetEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The component of the SCP-3114 player.
+ /// The component of the target player.
+ public Scp3114StrangleStartedEventArgs(ReferenceHub scp3114Hub, ReferenceHub targetHub)
+ {
+ Player = Player.Get(scp3114Hub);
+ Target = Player.Get(targetHub);
+ }
+
+ ///
+ /// The SCP-3114 player.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The strangle target.
+ ///
+ public Player Target { get; }
+}
diff --git a/LabApi/Events/Arguments/Scp3114Events/Scp3114StrangleStartingEventArgs.cs b/LabApi/Events/Arguments/Scp3114Events/Scp3114StrangleStartingEventArgs.cs
new file mode 100644
index 00000000..96193a0c
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp3114Events/Scp3114StrangleStartingEventArgs.cs
@@ -0,0 +1,36 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp3114Events;
+
+///
+/// Represents the arguments for the events.
+///
+public class Scp3114StrangleStartingEventArgs : EventArgs, IPlayerEvent, ITargetEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The component of the SCP-3114 player.
+ /// The component of the target player.
+ public Scp3114StrangleStartingEventArgs(ReferenceHub scp3114Hub, ReferenceHub targetHub)
+ {
+ Player = Player.Get(scp3114Hub);
+ Target = Player.Get(targetHub);
+ IsAllowed = true;
+ }
+
+ ///
+ /// The SCP-3114 player.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// The strangle target.
+ ///
+ public Player Target { get; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/Scp914Events/Scp914ActivatedEventArgs.cs b/LabApi/Events/Arguments/Scp914Events/Scp914ActivatedEventArgs.cs
index a740f898..60df6840 100644
--- a/LabApi/Events/Arguments/Scp914Events/Scp914ActivatedEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp914Events/Scp914ActivatedEventArgs.cs
@@ -14,11 +14,11 @@ public class Scp914ActivatedEventArgs : EventArgs, IScp914Event, IPlayerEvent
/// Initializes a new instance of the class.
///
/// The knob setting of SCP-914.
- /// The player that activated SCP-914.
- public Scp914ActivatedEventArgs(Scp914KnobSetting knobSetting, ReferenceHub player)
+ /// The player that activated SCP-914.
+ public Scp914ActivatedEventArgs(Scp914KnobSetting knobSetting, ReferenceHub hub)
{
KnobSetting = knobSetting;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp914Events/Scp914ActivatingEventArgs.cs b/LabApi/Events/Arguments/Scp914Events/Scp914ActivatingEventArgs.cs
index 67edee0c..1b4f5973 100644
--- a/LabApi/Events/Arguments/Scp914Events/Scp914ActivatingEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp914Events/Scp914ActivatingEventArgs.cs
@@ -14,12 +14,12 @@ public class Scp914ActivatingEventArgs : EventArgs, IScp914Event, IPlayerEvent,
/// Initializes a new instance of the class.
///
/// The knob setting of SCP-914.
- /// The player that is activating SCP-914.
- public Scp914ActivatingEventArgs(Scp914KnobSetting knobSetting, ReferenceHub player)
+ /// The player that is activating SCP-914.
+ public Scp914ActivatingEventArgs(Scp914KnobSetting knobSetting, ReferenceHub hub)
{
IsAllowed = true;
KnobSetting = knobSetting;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp914Events/Scp914KnobChangedEventArgs.cs b/LabApi/Events/Arguments/Scp914Events/Scp914KnobChangedEventArgs.cs
index bcb0f4f9..e9ccec50 100644
--- a/LabApi/Events/Arguments/Scp914Events/Scp914KnobChangedEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp914Events/Scp914KnobChangedEventArgs.cs
@@ -15,12 +15,12 @@ public class Scp914KnobChangedEventArgs : EventArgs, IScp914Event, IPlayerEvent
///
/// The old knob setting of SCP-914.
/// The new knob setting of SCP-914.
- /// The player that has changed the knob.
- public Scp914KnobChangedEventArgs(Scp914KnobSetting oldKnobSetting, Scp914KnobSetting knobSetting, ReferenceHub player)
+ /// The player that has changed the knob.
+ public Scp914KnobChangedEventArgs(Scp914KnobSetting oldKnobSetting, Scp914KnobSetting knobSetting, ReferenceHub hub)
{
OldKnobSetting = oldKnobSetting;
KnobSetting = knobSetting;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp914Events/Scp914KnobChangingEventArgs.cs b/LabApi/Events/Arguments/Scp914Events/Scp914KnobChangingEventArgs.cs
index 371740aa..fe89d86a 100644
--- a/LabApi/Events/Arguments/Scp914Events/Scp914KnobChangingEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp914Events/Scp914KnobChangingEventArgs.cs
@@ -15,13 +15,13 @@ public class Scp914KnobChangingEventArgs : EventArgs, IScp914Event, IPlayerEvent
///
/// The old knob setting of SCP-914.
/// The new knob setting of SCP-914.
- /// The player that is changing the knob.
- public Scp914KnobChangingEventArgs(Scp914KnobSetting oldKnobSetting, Scp914KnobSetting knobSetting, ReferenceHub player)
+ /// The player that is changing the knob.
+ public Scp914KnobChangingEventArgs(Scp914KnobSetting oldKnobSetting, Scp914KnobSetting knobSetting, ReferenceHub hub)
{
IsAllowed = true;
OldKnobSetting = oldKnobSetting;
KnobSetting = knobSetting;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp914Events/Scp914ProcessedInventoryItemEventArgs.cs b/LabApi/Events/Arguments/Scp914Events/Scp914ProcessedInventoryItemEventArgs.cs
index ceddecfe..a6842c98 100644
--- a/LabApi/Events/Arguments/Scp914Events/Scp914ProcessedInventoryItemEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp914Events/Scp914ProcessedInventoryItemEventArgs.cs
@@ -1,8 +1,8 @@
+using InventorySystem.Items;
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
using Scp914;
using System;
-using InventorySystem.Items;
namespace LabApi.Events.Arguments.Scp914Events;
@@ -17,13 +17,13 @@ public class Scp914ProcessedInventoryItemEventArgs : EventArgs, IScp914Event, II
/// The old item type.
/// The new item that has been processed by SCP-914.
/// The knob setting of SCP-914.
- /// The owner of the item.
- public Scp914ProcessedInventoryItemEventArgs(ItemType oldItemType, ItemBase item, Scp914KnobSetting knobSetting, ReferenceHub player)
+ /// The owner of the item.
+ public Scp914ProcessedInventoryItemEventArgs(ItemType oldItemType, ItemBase item, Scp914KnobSetting knobSetting, ReferenceHub hub)
{
OldItemType = oldItemType;
Item = Item.Get(item);
KnobSetting = knobSetting;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp914Events/Scp914ProcessedPickupEventArgs.cs b/LabApi/Events/Arguments/Scp914Events/Scp914ProcessedPickupEventArgs.cs
index 441cc636..d8cd03d1 100644
--- a/LabApi/Events/Arguments/Scp914Events/Scp914ProcessedPickupEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp914Events/Scp914ProcessedPickupEventArgs.cs
@@ -1,8 +1,8 @@
-using System;
using InventorySystem.Items.Pickups;
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
using Scp914;
+using System;
using UnityEngine;
namespace LabApi.Events.Arguments.Scp914Events;
diff --git a/LabApi/Events/Arguments/Scp914Events/Scp914ProcessedPlayerEventArgs.cs b/LabApi/Events/Arguments/Scp914Events/Scp914ProcessedPlayerEventArgs.cs
index a982ef84..d7915df9 100644
--- a/LabApi/Events/Arguments/Scp914Events/Scp914ProcessedPlayerEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp914Events/Scp914ProcessedPlayerEventArgs.cs
@@ -16,12 +16,12 @@ public class Scp914ProcessedPlayerEventArgs : EventArgs, IScp914Event, IPlayerEv
///
/// The knob setting of SCP-914.
/// The new position that the player has been processed into.
- /// The player that has been processed by SCP-914.
- public Scp914ProcessedPlayerEventArgs(Vector3 newPosition, Scp914KnobSetting knobSetting, ReferenceHub player)
+ /// The player that has been processed by SCP-914.
+ public Scp914ProcessedPlayerEventArgs(Vector3 newPosition, Scp914KnobSetting knobSetting, ReferenceHub hub)
{
NewPosition = newPosition;
KnobSetting = knobSetting;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp914Events/Scp914ProcessingInventoryItemEventArgs.cs b/LabApi/Events/Arguments/Scp914Events/Scp914ProcessingInventoryItemEventArgs.cs
index 6e3dd7fd..761429f2 100644
--- a/LabApi/Events/Arguments/Scp914Events/Scp914ProcessingInventoryItemEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp914Events/Scp914ProcessingInventoryItemEventArgs.cs
@@ -1,7 +1,7 @@
+using InventorySystem.Items;
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
using Scp914;
-using InventorySystem.Items;
using System;
namespace LabApi.Events.Arguments.Scp914Events;
@@ -16,13 +16,13 @@ public class Scp914ProcessingInventoryItemEventArgs : EventArgs, IScp914Event, I
///
/// The item that is being processed by SCP-914.
/// The knob setting of SCP-914.
- /// The owner of the item.
- public Scp914ProcessingInventoryItemEventArgs(ItemBase item, Scp914KnobSetting knobSetting, ReferenceHub player)
+ /// The owner of the item.
+ public Scp914ProcessingInventoryItemEventArgs(ItemBase item, Scp914KnobSetting knobSetting, ReferenceHub hub)
{
IsAllowed = true;
Item = Item.Get(item);
KnobSetting = knobSetting;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp914Events/Scp914ProcessingPickupEventArgs.cs b/LabApi/Events/Arguments/Scp914Events/Scp914ProcessingPickupEventArgs.cs
index 05cdf2b1..0939f9d5 100644
--- a/LabApi/Events/Arguments/Scp914Events/Scp914ProcessingPickupEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp914Events/Scp914ProcessingPickupEventArgs.cs
@@ -1,9 +1,9 @@
-using System;
+using InventorySystem.Items.Pickups;
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
using Scp914;
+using System;
using UnityEngine;
-using InventorySystem.Items.Pickups;
namespace LabApi.Events.Arguments.Scp914Events;
diff --git a/LabApi/Events/Arguments/Scp914Events/Scp914ProcessingPlayerEventArgs.cs b/LabApi/Events/Arguments/Scp914Events/Scp914ProcessingPlayerEventArgs.cs
index 8887d521..8920020f 100644
--- a/LabApi/Events/Arguments/Scp914Events/Scp914ProcessingPlayerEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp914Events/Scp914ProcessingPlayerEventArgs.cs
@@ -16,13 +16,13 @@ public class Scp914ProcessingPlayerEventArgs : EventArgs, IScp914Event, IPlayerE
///
/// The new position that the player will be processed into.
/// The knob setting of SCP-914.
- /// The player that is being processed by SCP-914.
- public Scp914ProcessingPlayerEventArgs(Vector3 newPosition, Scp914KnobSetting knobSetting, ReferenceHub player)
+ /// The player that is being processed by SCP-914.
+ public Scp914ProcessingPlayerEventArgs(Vector3 newPosition, Scp914KnobSetting knobSetting, ReferenceHub hub)
{
IsAllowed = true;
NewPosition = newPosition;
KnobSetting = knobSetting;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp939Events/Scp939AttackedEventArgs.cs b/LabApi/Events/Arguments/Scp939Events/Scp939AttackedEventArgs.cs
index 530a0efa..570d8226 100644
--- a/LabApi/Events/Arguments/Scp939Events/Scp939AttackedEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp939Events/Scp939AttackedEventArgs.cs
@@ -12,12 +12,12 @@ public class Scp939AttackedEventArgs : EventArgs, IPlayerEvent, ITargetEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-939 player instance.
+ /// The SCP-939 player instance.
/// The destructible that was attacked.
/// The damage dealt.
- public Scp939AttackedEventArgs(ReferenceHub player, ReferenceHub target, float damage)
+ public Scp939AttackedEventArgs(ReferenceHub hub, ReferenceHub target, float damage)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Target = Player.Get(target);
Damage = damage;
}
diff --git a/LabApi/Events/Arguments/Scp939Events/Scp939AttackingEventArgs.cs b/LabApi/Events/Arguments/Scp939Events/Scp939AttackingEventArgs.cs
index 847686da..fe9692b9 100644
--- a/LabApi/Events/Arguments/Scp939Events/Scp939AttackingEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp939Events/Scp939AttackingEventArgs.cs
@@ -12,13 +12,13 @@ public class Scp939AttackingEventArgs : EventArgs, IPlayerEvent, ITargetEvent, I
///
/// Initializes a new instance of the class.
///
- /// The SCP-939 player instance.
+ /// The SCP-939 player instance.
/// The destructible that is being attacked.
/// The damage dealt.
- public Scp939AttackingEventArgs(ReferenceHub player, ReferenceHub target, float damage)
+ public Scp939AttackingEventArgs(ReferenceHub hub, ReferenceHub target, float damage)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Target = Player.Get(target);
Damage = damage;
}
diff --git a/LabApi/Events/Arguments/Scp939Events/Scp939CreatedAmnesticCloudEventArgs.cs b/LabApi/Events/Arguments/Scp939Events/Scp939CreatedAmnesticCloudEventArgs.cs
index e3d03225..5fbd6700 100644
--- a/LabApi/Events/Arguments/Scp939Events/Scp939CreatedAmnesticCloudEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp939Events/Scp939CreatedAmnesticCloudEventArgs.cs
@@ -13,11 +13,11 @@ public class Scp939CreatedAmnesticCloudEventArgs : EventArgs, IPlayerEvent, IAmn
///
/// Initializes a new instance of the class.
///
- /// The SCP-939 player instance.
+ /// The SCP-939 player instance.
/// The created amnestic cloud instance.
- public Scp939CreatedAmnesticCloudEventArgs(ReferenceHub player, Scp939AmnesticCloudInstance amnesticCloudInstance)
+ public Scp939CreatedAmnesticCloudEventArgs(ReferenceHub hub, Scp939AmnesticCloudInstance amnesticCloudInstance)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
AmnesticCloud = AmnesticCloudHazard.Get(amnesticCloudInstance);
}
diff --git a/LabApi/Events/Arguments/Scp939Events/Scp939CreatingAmnesticCloudEventArgs.cs b/LabApi/Events/Arguments/Scp939Events/Scp939CreatingAmnesticCloudEventArgs.cs
index 3b11555a..823b3af6 100644
--- a/LabApi/Events/Arguments/Scp939Events/Scp939CreatingAmnesticCloudEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp939Events/Scp939CreatingAmnesticCloudEventArgs.cs
@@ -12,11 +12,11 @@ public class Scp939CreatingAmnesticCloudEventArgs : EventArgs, IPlayerEvent, ICa
///
/// Initializes a new instance of the class.
///
- /// The SCP-939 player instance.
- public Scp939CreatingAmnesticCloudEventArgs(ReferenceHub player)
+ /// The SCP-939 player instance.
+ public Scp939CreatingAmnesticCloudEventArgs(ReferenceHub hub)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/Scp939Events/Scp939FocusedEventArgs.cs b/LabApi/Events/Arguments/Scp939Events/Scp939FocusedEventArgs.cs
new file mode 100644
index 00000000..67400b06
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp939Events/Scp939FocusedEventArgs.cs
@@ -0,0 +1,32 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp939Events;
+
+///
+/// Represents the event arguments for when SCP-939 has focused.
+///
+public class Scp939FocusedEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The SCP-939 player instance.
+ /// A value indicating whether SCP-939 is in the focus state.
+ public Scp939FocusedEventArgs(ReferenceHub hub, bool focusState)
+ {
+ Player = Player.Get(hub);
+ FocusState = focusState;
+ }
+
+ ///
+ /// Gets the 939 player instance.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the current state of the SCP-939 focus ability.
+ ///
+ public bool FocusState { get; }
+}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/Scp939Events/Scp939LungedEventArgs.cs b/LabApi/Events/Arguments/Scp939Events/Scp939LungedEventArgs.cs
index 971aac77..e22cf2f3 100644
--- a/LabApi/Events/Arguments/Scp939Events/Scp939LungedEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp939Events/Scp939LungedEventArgs.cs
@@ -13,11 +13,11 @@ public class Scp939LungedEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-939 player instance.
+ /// The SCP-939 player instance.
/// The SCP-939 lunge state.
- public Scp939LungedEventArgs(ReferenceHub player, Scp939LungeState lungeState)
+ public Scp939LungedEventArgs(ReferenceHub hub, Scp939LungeState lungeState)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
LungeState = lungeState;
}
diff --git a/LabApi/Events/Arguments/Scp939Events/Scp939LungingEventArgs.cs b/LabApi/Events/Arguments/Scp939Events/Scp939LungingEventArgs.cs
index d10c4759..d5e2678c 100644
--- a/LabApi/Events/Arguments/Scp939Events/Scp939LungingEventArgs.cs
+++ b/LabApi/Events/Arguments/Scp939Events/Scp939LungingEventArgs.cs
@@ -13,12 +13,12 @@ public class Scp939LungingEventArgs : EventArgs, ICancellableEvent, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP-939 player instance.
+ /// The SCP-939 player instance.
/// The SCP-939 lunge state.
- public Scp939LungingEventArgs(ReferenceHub player, Scp939LungeState lungeState)
+ public Scp939LungingEventArgs(ReferenceHub hub, Scp939LungeState lungeState)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
LungeState = lungeState;
}
diff --git a/LabApi/Events/Arguments/Scp939Events/Scp939MimickedEnvironmentEventArgs.cs b/LabApi/Events/Arguments/Scp939Events/Scp939MimickedEnvironmentEventArgs.cs
new file mode 100644
index 00000000..cb49c1e2
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp939Events/Scp939MimickedEnvironmentEventArgs.cs
@@ -0,0 +1,32 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp939Events;
+
+///
+/// Represents the event arguments for when SCP-939 has mimicked the environment.
+///
+public class Scp939MimickedEnvironmentEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The SCP-939 player instance.
+ /// The played environmental sequence.
+ public Scp939MimickedEnvironmentEventArgs(ReferenceHub hub, byte playedSequence)
+ {
+ Player = Player.Get(hub);
+ PlayedSequence = playedSequence;
+ }
+
+ ///
+ /// Gets the 939 player instance.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the played environmental sequence.
+ ///
+ public byte PlayedSequence { get; }
+}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/Scp939Events/Scp939MimickingEnvironmentEventArgs.cs b/LabApi/Events/Arguments/Scp939Events/Scp939MimickingEnvironmentEventArgs.cs
new file mode 100644
index 00000000..c2381769
--- /dev/null
+++ b/LabApi/Events/Arguments/Scp939Events/Scp939MimickingEnvironmentEventArgs.cs
@@ -0,0 +1,44 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.Scp939Events;
+
+///
+/// Represents the event arguments for when SCP-939 is mimicking the environment.
+///
+public class Scp939MimickingEnvironmentEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The SCP-939 player instance.
+ /// The selected environmental sequence to play.
+ /// The cooldown for mimicking the environment.
+ public Scp939MimickingEnvironmentEventArgs(ReferenceHub hub, byte selectedSequence, float cooldownTime)
+ {
+ Player = Player.Get(hub);
+ SelectedSequence = selectedSequence;
+ CooldownTime = cooldownTime;
+
+ IsAllowed = true;
+ }
+
+ ///
+ /// Gets the 939 player instance.
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets or sets the selected sequence to play.
+ ///
+ public byte SelectedSequence { get; set; }
+
+ ///
+ /// Gets or sets the cooldown for mimicking the environment.
+ ///
+ public float CooldownTime { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/ScpEvents/ScpHumeShieldBrokenEventArgs.cs b/LabApi/Events/Arguments/ScpEvents/ScpHumeShieldBrokenEventArgs.cs
new file mode 100644
index 00000000..0c3f14de
--- /dev/null
+++ b/LabApi/Events/Arguments/ScpEvents/ScpHumeShieldBrokenEventArgs.cs
@@ -0,0 +1,23 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.ScpEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class ScpHumeShieldBrokenEventArgs : EventArgs, IPlayerEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player SCP whom hume shield broke.
+ public ScpHumeShieldBrokenEventArgs(ReferenceHub player)
+ {
+ Player = Player.Get(player);
+ }
+
+ ///
+ public Player Player { get; }
+}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/ServerEvents/AchievedMilestoneEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/AchievedMilestoneEventArgs.cs
new file mode 100644
index 00000000..1dd99dd7
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/AchievedMilestoneEventArgs.cs
@@ -0,0 +1,38 @@
+using PlayerRoles;
+using System;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class AchievedMilestoneEventArgs : EventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The faction that achieved this milestone.
+ /// The influence threshold for this milestone.
+ /// The index of the achieved milestone.
+ public AchievedMilestoneEventArgs(Faction faction, int threshold, int milestoneIndex)
+ {
+ Faction = faction;
+ Threshold = threshold;
+ MilestoneIndex = milestoneIndex;
+ }
+
+ ///
+ /// Gets the faction that achieved this milestone.
+ ///
+ public Faction Faction { get; }
+
+ ///
+ /// Gets the influence threshold for this milestone.
+ ///
+ public int Threshold { get; }
+
+ ///
+ /// Gets the index of the achieved milestone.
+ ///
+ public int MilestoneIndex { get; }
+}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/ServerEvents/AchievingMilestoneEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/AchievingMilestoneEventArgs.cs
new file mode 100644
index 00000000..3a9992ee
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/AchievingMilestoneEventArgs.cs
@@ -0,0 +1,44 @@
+using LabApi.Events.Arguments.Interfaces;
+using PlayerRoles;
+using System;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class AchievingMilestoneEventArgs : EventArgs, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The faction that achieved this milestone.
+ /// The influence threshold for this milestone.
+ /// The index of the achieved milestone.
+ public AchievingMilestoneEventArgs(Faction faction, int threshold, int milestoneIndex)
+ {
+ Faction = faction;
+ Threshold = threshold;
+ MilestoneIndex = milestoneIndex;
+
+ IsAllowed = true;
+ }
+
+ ///
+ /// Gets the faction that achieved this milestone.
+ ///
+ public Faction Faction { get; }
+
+ ///
+ /// Gets the influence threshold for this milestone.
+ ///
+ public int Threshold { get; }
+
+ ///
+ /// Gets the index of the achieved milestone.
+ ///
+ public int MilestoneIndex { get; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/ServerEvents/BlastDoorChangedEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/BlastDoorChangedEventArgs.cs
new file mode 100644
index 00000000..9038df7d
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/BlastDoorChangedEventArgs.cs
@@ -0,0 +1,30 @@
+using System;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class BlastDoorChangedEventArgs : EventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The door that is chaning it's state.
+ /// The 's new state.
+ public BlastDoorChangedEventArgs(BlastDoor blastDoor, bool newState)
+ {
+ BlastDoor = blastDoor;
+ NewState = newState;
+ }
+
+ ///
+ /// Gets the current Blast Door.
+ ///
+ public BlastDoor BlastDoor { get; }
+
+ ///
+ /// Gets the new state.
+ ///
+ public bool NewState { get; }
+}
diff --git a/LabApi/Events/Arguments/ServerEvents/BlastDoorChangingEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/BlastDoorChangingEventArgs.cs
new file mode 100644
index 00000000..bd0e8f86
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/BlastDoorChangingEventArgs.cs
@@ -0,0 +1,36 @@
+using LabApi.Events.Arguments.Interfaces;
+using System;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class BlastDoorChangingEventArgs : EventArgs, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The door that is changing it's state.
+ /// The 's new state.
+ public BlastDoorChangingEventArgs(BlastDoor blastDoor, bool newState)
+ {
+ BlastDoor = blastDoor;
+ NewState = newState;
+
+ IsAllowed = true;
+ }
+
+ ///
+ /// Gets the current Blast Door.
+ ///
+ public BlastDoor BlastDoor { get; }
+
+ ///
+ /// Gets or sets the new state.
+ ///
+ public bool NewState { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/ServerEvents/CassieAnnouncedEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/CassieAnnouncedEventArgs.cs
index 2aff367f..b6f3dcf9 100644
--- a/LabApi/Events/Arguments/ServerEvents/CassieAnnouncedEventArgs.cs
+++ b/LabApi/Events/Arguments/ServerEvents/CassieAnnouncedEventArgs.cs
@@ -13,7 +13,7 @@ public class CassieAnnouncedEventArgs : EventArgs
/// The sentence C.A.S.S.I.E. is supposed to say.
/// For most cases you wanna keep it true. Sets a minimal 3-second moment of silence before the announcement.
/// The background noises before playing.
- /// If thats custom announcement? Custom announcements show subtitles
+ /// If thats custom announcement? Custom announcements show subtitles.
/// Custom subtitles text.
public CassieAnnouncedEventArgs(string words, bool makeHold, bool makeNoise, bool customAnnouncement, string customSubtitles)
{
@@ -25,7 +25,7 @@ public CassieAnnouncedEventArgs(string words, bool makeHold, bool makeNoise, boo
}
///
- /// Gets sentece which C.A.S.S.I.E. said.
+ /// Gets sentence which C.A.S.S.I.E. said.
///
public string Words { get; }
diff --git a/LabApi/Events/Arguments/ServerEvents/CassieAnnouncingEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/CassieAnnouncingEventArgs.cs
index 0ceb04ad..aac4eda1 100644
--- a/LabApi/Events/Arguments/ServerEvents/CassieAnnouncingEventArgs.cs
+++ b/LabApi/Events/Arguments/ServerEvents/CassieAnnouncingEventArgs.cs
@@ -14,7 +14,7 @@ public class CassieAnnouncingEventArgs : EventArgs, ICancellableEvent
/// The sentence C.A.S.S.I.E. is supposed to say.
/// For most cases you wanna keep it true. Sets a minimal 3-second moment of silence before the announcement.
/// The background noises before playing.
- /// If thats custom announcement? Custom announcements show subtitles
+ /// If thats custom announcement? Custom announcements show subtitles.
/// Custom subtitles text to appear instead of original text.
public CassieAnnouncingEventArgs(string words, bool makeHold, bool makeNoise, bool customAnnouncement, string customSubtitles)
{
@@ -27,7 +27,7 @@ public CassieAnnouncingEventArgs(string words, bool makeHold, bool makeNoise, bo
}
///
- /// Gets or sets sentece which C.A.S.S.I.E. will say.
+ /// Gets or sets sentence which C.A.S.S.I.E. will say.
///
public string Words { get; set; }
diff --git a/LabApi/Events/Arguments/ServerEvents/CassieQueuedScpTerminationEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/CassieQueuedScpTerminationEventArgs.cs
index 43d888b2..8ed5dad8 100644
--- a/LabApi/Events/Arguments/ServerEvents/CassieQueuedScpTerminationEventArgs.cs
+++ b/LabApi/Events/Arguments/ServerEvents/CassieQueuedScpTerminationEventArgs.cs
@@ -1,5 +1,6 @@
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using PlayerStatsSystem;
using Subtitles;
using System;
@@ -13,14 +14,16 @@ public class CassieQueuedScpTerminationEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The SCP player the C.A.S.S.I.E termination announcement is for.
+ /// The SCP player the C.A.S.S.I.E termination announcement is for.
/// The message C.A.S.S.I.E is supposed to say.
/// The subtitle part array of the message.
- public CassieQueuedScpTerminationEventArgs(ReferenceHub player, string announcement, SubtitlePart[] subtitles)
+ /// The damage handler that caused the termination of the SCP.
+ public CassieQueuedScpTerminationEventArgs(ReferenceHub hub, string announcement, SubtitlePart[] subtitles, DamageHandlerBase damageHandler)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Announcement = announcement;
SubtitleParts = subtitles;
+ DamageHandler = damageHandler;
}
///
@@ -37,4 +40,9 @@ public CassieQueuedScpTerminationEventArgs(ReferenceHub player, string announcem
/// Gets or sets the subtitle parts of the message.
///
public SubtitlePart[] SubtitleParts { get; }
+
+ ///
+ /// The Damage Handler responsible for the SCP Termination.
+ ///
+ public DamageHandlerBase DamageHandler { get; }
}
diff --git a/LabApi/Events/Arguments/ServerEvents/CassieQueuingScpTerminationEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/CassieQueuingScpTerminationEventArgs.cs
index f94c3e76..437947e5 100644
--- a/LabApi/Events/Arguments/ServerEvents/CassieQueuingScpTerminationEventArgs.cs
+++ b/LabApi/Events/Arguments/ServerEvents/CassieQueuingScpTerminationEventArgs.cs
@@ -1,5 +1,6 @@
using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Wrappers;
+using PlayerStatsSystem;
using Subtitles;
using System;
@@ -13,15 +14,17 @@ public class CassieQueuingScpTerminationEventArgs : EventArgs, IPlayerEvent, ICa
///
/// Initializes a new instance of the class.
///
- /// The SCP player the C.A.S.S.I.E termination announcement is for.
+ /// The SCP player the C.A.S.S.I.E termination announcement is for.
/// The message C.A.S.S.I.E is supposed to say.
/// The subtitle part array of the message.
- public CassieQueuingScpTerminationEventArgs(ReferenceHub player, string announcement, SubtitlePart[] subtitles)
+ /// The damage handler that caused the termination of the SCP.
+ public CassieQueuingScpTerminationEventArgs(ReferenceHub hub, string announcement, SubtitlePart[] subtitles, DamageHandlerBase damageHandler)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Announcement = announcement;
SubtitleParts = [.. subtitles];
+ DamageHandler = damageHandler;
}
///
@@ -37,8 +40,13 @@ public CassieQueuingScpTerminationEventArgs(ReferenceHub player, string announce
///
/// Gets or sets the subtitle parts of the message.
///
- public SubtitlePart[] SubtitleParts { get; set; }
+ public SubtitlePart[] SubtitleParts { get; set; }
///
public bool IsAllowed { get; set; }
+
+ ///
+ /// The Damage Handler responsible for the SCP Termination.
+ ///
+ public DamageHandlerBase DamageHandler { get; }
}
diff --git a/LabApi/Events/Arguments/ServerEvents/CheckpointDoorSequenceChangedEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/CheckpointDoorSequenceChangedEventArgs.cs
new file mode 100644
index 00000000..1d1261e0
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/CheckpointDoorSequenceChangedEventArgs.cs
@@ -0,0 +1,32 @@
+using LabApi.Features.Wrappers;
+using System;
+using static Interactables.Interobjects.CheckpointDoor;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class CheckpointDoorSequenceChangedEventArgs : EventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The current checkpoint door.
+ /// The current state this checkpoint is.
+ public CheckpointDoorSequenceChangedEventArgs(Interactables.Interobjects.CheckpointDoor door, SequenceState sequenceState)
+ {
+ CheckpointDoor = CheckpointDoor.Get(door);
+ CurrentSequence = sequenceState;
+ }
+
+ ///
+ /// Gets the current Checkpoint Door.
+ ///
+ public CheckpointDoor CheckpointDoor { get; }
+
+ ///
+ /// Gets the damage value.
+ ///
+ public SequenceState CurrentSequence { get; }
+}
diff --git a/LabApi/Events/Arguments/ServerEvents/CheckpointDoorSequenceChangingEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/CheckpointDoorSequenceChangingEventArgs.cs
new file mode 100644
index 00000000..2f436c79
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/CheckpointDoorSequenceChangingEventArgs.cs
@@ -0,0 +1,45 @@
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using static Interactables.Interobjects.CheckpointDoor;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class CheckpointDoorSequenceChangingEventArgs : EventArgs, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The current checkpoint door.
+ /// The current state this checkpoint is.
+ /// The new state this checkpoint changing.
+ public CheckpointDoorSequenceChangingEventArgs(Interactables.Interobjects.CheckpointDoor door, SequenceState oldState, SequenceState sequenceState)
+ {
+ CheckpointDoor = CheckpointDoor.Get(door);
+ CurrentSequence = oldState;
+ NewSequence = sequenceState;
+
+ IsAllowed = true;
+ }
+
+ ///
+ /// Gets the current Checkpoint Door.
+ ///
+ public CheckpointDoor CheckpointDoor { get; }
+
+ ///
+ /// Gets the current sequence state.
+ ///
+ public SequenceState CurrentSequence { get; }
+
+ ///
+ /// Gets or sets the new sequence state.
+ ///
+ public SequenceState NewSequence { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/ServerEvents/CommandExecutedEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/CommandExecutedEventArgs.cs
index c14e0a37..af6d7f31 100644
--- a/LabApi/Events/Arguments/ServerEvents/CommandExecutedEventArgs.cs
+++ b/LabApi/Events/Arguments/ServerEvents/CommandExecutedEventArgs.cs
@@ -1,7 +1,7 @@
using CommandSystem;
+using LabApi.Events.Arguments.Interfaces;
using LabApi.Features.Enums;
using System;
-using LabApi.Events.Arguments.Interfaces;
namespace LabApi.Events.Arguments.ServerEvents;
@@ -18,7 +18,7 @@ public class CommandExecutedEventArgs : EventArgs, ICommandSenderEvent
/// The command.
/// The arguments of the command.
/// Whether the command was executed successfully.
- /// The response of the command
+ /// The response of the command.
public CommandExecutedEventArgs(CommandSender? sender, CommandType commandType, ICommand command, ArraySegment arguments, bool successful, string response)
{
Sender = sender;
diff --git a/LabApi/Events/Arguments/ServerEvents/DeadmanSequenceActivatingEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/DeadmanSequenceActivatingEventArgs.cs
new file mode 100644
index 00000000..446482a0
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/DeadmanSequenceActivatingEventArgs.cs
@@ -0,0 +1,14 @@
+using LabApi.Events.Arguments.Interfaces;
+using System;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class DeadmanSequenceActivatingEventArgs : EventArgs, ICancellableEvent
+{
+ ///
+ /// Will reset Deadman Sequence timer back to 0 if .
+ public bool IsAllowed { get; set; } = true;
+}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/ServerEvents/DoorDamagedEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/DoorDamagedEventArgs.cs
new file mode 100644
index 00000000..dc6ce212
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/DoorDamagedEventArgs.cs
@@ -0,0 +1,39 @@
+using Interactables.Interobjects.DoorUtils;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class DoorDamagedEventArgs : EventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The door that was damaged.
+ /// The damage to apply this door.
+ /// The type of damage this door received.
+ public DoorDamagedEventArgs(DoorVariant door, float hp, DoorDamageType type)
+ {
+ Door = Door.Get(door);
+ Damage = hp;
+ DamageType = type;
+ }
+
+ ///
+ /// Gets the current Door.
+ ///
+ public Door Door { get; }
+
+ ///
+ /// Gets the damage value.
+ ///
+ public float Damage { get; }
+
+ ///
+ /// Gets the damage type.
+ ///
+ public DoorDamageType DamageType { get; }
+}
diff --git a/LabApi/Events/Arguments/ServerEvents/DoorDamagingEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/DoorDamagingEventArgs.cs
new file mode 100644
index 00000000..9114da41
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/DoorDamagingEventArgs.cs
@@ -0,0 +1,45 @@
+using Interactables.Interobjects.DoorUtils;
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class DoorDamagingEventArgs : EventArgs, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The door that is damaging.
+ /// The damage to apply this door.
+ /// The type of damage this door received.
+ public DoorDamagingEventArgs(DoorVariant door, float hp, DoorDamageType type)
+ {
+ Door = Door.Get(door);
+ Damage = hp;
+ DamageType = type;
+
+ IsAllowed = true;
+ }
+
+ ///
+ /// Gets the current Door.
+ ///
+ public Door Door { get; }
+
+ ///
+ /// Gets or sets the damage value.
+ ///
+ public float Damage { get; set; }
+
+ ///
+ /// Gets or sets the damage type.
+ ///
+ public DoorDamageType DamageType { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/ServerEvents/DoorLockChangedEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/DoorLockChangedEventArgs.cs
new file mode 100644
index 00000000..a0f28ac4
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/DoorLockChangedEventArgs.cs
@@ -0,0 +1,40 @@
+using Interactables.Interobjects.DoorUtils;
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class DoorLockChangedEventArgs : EventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The door whose lock reason changed.
+ /// The previous lock reason.
+ /// The 's lock reason.
+ public DoorLockChangedEventArgs(DoorVariant door, ushort prevLockReason, ushort activeLocks)
+ {
+ Door = Door.Get(door);
+ PrevLockReason = (DoorLockReason)prevLockReason;
+ LockReason = (DoorLockReason)activeLocks;
+ }
+
+ ///
+ /// Gets the current Door.
+ ///
+ public Door Door { get; }
+
+ ///
+ /// Gets the old lock reason.
+ ///
+ public DoorLockReason PrevLockReason { get; }
+
+ ///
+ /// Gets the new lock reason.
+ ///
+ public DoorLockReason LockReason { get; }
+}
diff --git a/LabApi/Events/Arguments/ServerEvents/DoorRepairedEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/DoorRepairedEventArgs.cs
new file mode 100644
index 00000000..27aa4d2c
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/DoorRepairedEventArgs.cs
@@ -0,0 +1,32 @@
+using Interactables.Interobjects.DoorUtils;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class DoorRepairedEventArgs : EventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The door that was repaired.
+ /// The remaining health for this door.
+ public DoorRepairedEventArgs(DoorVariant door, float remainingHealth)
+ {
+ Door = Door.Get(door);
+ RemainingHealth = remainingHealth;
+ }
+
+ ///
+ /// Gets the current Door.
+ ///
+ public Door Door { get; }
+
+ ///
+ /// Gets the remaining health of the .
+ ///
+ public float RemainingHealth { get; }
+}
diff --git a/LabApi/Events/Arguments/ServerEvents/DoorRepairingEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/DoorRepairingEventArgs.cs
new file mode 100644
index 00000000..f9014b99
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/DoorRepairingEventArgs.cs
@@ -0,0 +1,38 @@
+using Interactables.Interobjects.DoorUtils;
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class DoorRepairingEventArgs : EventArgs, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The door that is repairing.
+ /// The remaining health for this door.
+ public DoorRepairingEventArgs(DoorVariant door, float remainingHealth)
+ {
+ Door = Door.Get(door);
+ RemainingHealth = remainingHealth;
+
+ IsAllowed = true;
+ }
+
+ ///
+ /// Gets the current Door.
+ ///
+ public Door Door { get; }
+
+ ///
+ /// Gets or sets the remaining health of the .
+ ///
+ public float RemainingHealth { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/ServerEvents/ElevatorSequenceChangedEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/ElevatorSequenceChangedEventArgs.cs
new file mode 100644
index 00000000..965bdd42
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/ElevatorSequenceChangedEventArgs.cs
@@ -0,0 +1,39 @@
+using Interactables.Interobjects;
+using LabApi.Events.Arguments.Interfaces;
+using LabApi.Features.Wrappers;
+using System;
+using static Interactables.Interobjects.ElevatorChamber;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class ElevatorSequenceChangedEventArgs : EventArgs, IElevatorEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The elevator whose sequence has changed.
+ /// The old sequence the elevator was in before.
+ /// The new sequence the elevator has transitioned into.
+ public ElevatorSequenceChangedEventArgs(ElevatorChamber elevator, ElevatorSequence oldSequence, ElevatorSequence newSequence)
+ {
+ Elevator = Elevator.Get(elevator);
+ OldSequence = oldSequence;
+ NewSequence = newSequence;
+ }
+
+ ///
+ public Elevator Elevator { get; }
+
+ ///
+ /// The old sequence the elevator was in before.
+ ///
+ public ElevatorSequence OldSequence { get; }
+
+ ///
+ /// The new sequence the elevator has transitioned into.
+ ///
+ public ElevatorSequence NewSequence { get; }
+}
diff --git a/LabApi/Events/Arguments/ServerEvents/ExplosionSpawnedEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/ExplosionSpawnedEventArgs.cs
index fe56ed15..9a5f1f92 100644
--- a/LabApi/Events/Arguments/ServerEvents/ExplosionSpawnedEventArgs.cs
+++ b/LabApi/Events/Arguments/ServerEvents/ExplosionSpawnedEventArgs.cs
@@ -4,53 +4,52 @@
using System;
using UnityEngine;
-namespace LabApi.Events.Arguments.ServerEvents
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class ExplosionSpawnedEventArgs : EventArgs, IPlayerEvent
{
///
- /// Represents the arguments for the event.
+ /// Initializes a new instance of the class.
///
- public class ExplosionSpawnedEventArgs : EventArgs, IPlayerEvent
+ /// The player which caused this explosion.
+ /// The position of explosion.
+ /// The projectile which caused explosion.
+ /// The type of this explosion.
+ /// Whether the explosion was allowed to destroy doors.
+ public ExplosionSpawnedEventArgs(ReferenceHub? hub, Vector3 position, ExplosionGrenade settingsReference, ExplosionType explosionType, bool destroyDoors)
{
- ///
- /// Initializes a new instance of the class.
- ///
- /// The player which caused this explosion.
- /// The position of explosion.
- /// The projectile which caused explosion.
- /// The type of this explosion.
- /// Whether the explosion was allowed to destroy doors.
- public ExplosionSpawnedEventArgs(ReferenceHub? player, Vector3 position, ExplosionGrenade settingsReference, ExplosionType explosionType, bool destroyDoors)
- {
- Player = Player.Get(player);
- Position = position;
- Settings = settingsReference;
- ExplosionType = explosionType;
- DestroyDoors = destroyDoors;
- }
+ Player = Player.Get(hub);
+ Position = position;
+ Settings = settingsReference;
+ ExplosionType = explosionType;
+ DestroyDoors = destroyDoors;
+ }
- ///
- /// Gets the player which caused this explosion.
- ///
- public Player? Player { get; }
+ ///
+ /// Gets the player which caused this explosion.
+ ///
+ public Player? Player { get; }
- ///
- /// Gets the position of explosion.
- ///
- public Vector3 Position { get; }
+ ///
+ /// Gets the position of explosion.
+ ///
+ public Vector3 Position { get; }
- ///
- /// Gets the projectile which will cause explosion.
- ///
- public ExplosionGrenade Settings { get; }
+ ///
+ /// Gets the projectile which will cause explosion.
+ ///
+ public ExplosionGrenade Settings { get; }
- ///
- /// Gets the type of this explosion.
- ///
- public ExplosionType ExplosionType { get; }
+ ///
+ /// Gets the type of this explosion.
+ ///
+ public ExplosionType ExplosionType { get; }
- ///
- /// Gets whether the explosion should destroy doors.
- ///
- public bool DestroyDoors { get; }
- }
+ ///
+ /// Gets whether the explosion should destroy doors.
+ ///
+ public bool DestroyDoors { get; }
}
diff --git a/LabApi/Events/Arguments/ServerEvents/ExplosionSpawningEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/ExplosionSpawningEventArgs.cs
index 29638552..f6438f2f 100644
--- a/LabApi/Events/Arguments/ServerEvents/ExplosionSpawningEventArgs.cs
+++ b/LabApi/Events/Arguments/ServerEvents/ExplosionSpawningEventArgs.cs
@@ -4,58 +4,57 @@
using System;
using UnityEngine;
-namespace LabApi.Events.Arguments.ServerEvents
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class ExplosionSpawningEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
{
///
- /// Represents the arguments for the event.
+ /// Initializes a new instance of the class.
///
- public class ExplosionSpawningEventArgs : EventArgs, IPlayerEvent, ICancellableEvent
+ /// The player which caused this explosion.
+ /// The position of explosion.
+ /// The projectile which will cause the explosion.
+ /// The type of this explosion.
+ /// Whether the explosion should destroy doors.
+ public ExplosionSpawningEventArgs(ReferenceHub? hub, Vector3 position, ExplosionGrenade settingsReference, ExplosionType explosionType, bool destroyDoors)
{
- ///
- /// Initializes a new instance of the class.
- ///
- /// The player which caused this explosion.
- /// The position of explosion.
- /// The projectile which will cause the explosion.
- /// The type of this explosion.
- /// Whether the explosion should destroy doors.
- public ExplosionSpawningEventArgs(ReferenceHub? player, Vector3 position, ExplosionGrenade settingsReference, ExplosionType explosionType, bool destroyDoors)
- {
- Player = Player.Get(player);
- Position = position;
- Settings = settingsReference;
- ExplosionType = explosionType;
- DestroyDoors = destroyDoors;
-
- IsAllowed = true;
- }
-
- ///
- /// Gets or sets the player which caused this explosion.
- ///
- public Player? Player { get; set; }
-
- ///
- /// Gets or sets the position of explosion.
- ///
- public Vector3 Position { get; set; }
-
- ///
- /// Gets or sets the projectile which will cause explosion.
- ///
- public ExplosionGrenade Settings { get; set; }
-
- ///
- /// Gets or sets the type of this explosion.
- ///
- public ExplosionType ExplosionType { get; set; }
-
- ///
- /// Gets or sets whether the explosion should destroy doors.
- ///
- public bool DestroyDoors { get; set; }
-
- ///
- public bool IsAllowed { get; set; }
+ Player = Player.Get(hub);
+ Position = position;
+ Settings = settingsReference;
+ ExplosionType = explosionType;
+ DestroyDoors = destroyDoors;
+
+ IsAllowed = true;
}
+
+ ///
+ /// Gets or sets the player which caused this explosion.
+ ///
+ public Player? Player { get; set; }
+
+ ///
+ /// Gets or sets the position of explosion.
+ ///
+ public Vector3 Position { get; set; }
+
+ ///
+ /// Gets or sets the projectile which will cause explosion.
+ ///
+ public ExplosionGrenade Settings { get; set; }
+
+ ///
+ /// Gets or sets the type of this explosion.
+ ///
+ public ExplosionType ExplosionType { get; set; }
+
+ ///
+ /// Gets or sets whether the explosion should destroy doors.
+ ///
+ public bool DestroyDoors { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
}
diff --git a/LabApi/Events/Arguments/ServerEvents/ItemSpawningEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/ItemSpawningEventArgs.cs
index a1bd6009..92b8368e 100644
--- a/LabApi/Events/Arguments/ServerEvents/ItemSpawningEventArgs.cs
+++ b/LabApi/Events/Arguments/ServerEvents/ItemSpawningEventArgs.cs
@@ -11,7 +11,7 @@ public class ItemSpawningEventArgs : EventArgs, ICancellableEvent
///
/// Initializes a new instance of the class.
///
- /// The type of item which will spawn on map
+ /// The type of item which will spawn on map.
public ItemSpawningEventArgs(ItemType type)
{
IsAllowed = true;
diff --git a/LabApi/Events/Arguments/ServerEvents/ModifiedFactionInfluenceEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/ModifiedFactionInfluenceEventArgs.cs
new file mode 100644
index 00000000..b967e7eb
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/ModifiedFactionInfluenceEventArgs.cs
@@ -0,0 +1,32 @@
+using PlayerRoles;
+using Respawning;
+using System;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class ModifiedFactionInfluenceEventArgs : EventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The faction whose influence is modified.
+ /// The influence amount the has now.
+ public ModifiedFactionInfluenceEventArgs(Faction faction, float influence)
+ {
+ Faction = faction;
+ Influence = influence;
+ }
+
+ ///
+ /// Gets the faction whose influence is modified.
+ ///
+ public Faction Faction { get; }
+
+ ///
+ /// Gets the new influence of the .
+ ///
+ public float Influence { get; }
+}
diff --git a/LabApi/Events/Arguments/ServerEvents/ModifyingFactionInfluenceEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/ModifyingFactionInfluenceEventArgs.cs
new file mode 100644
index 00000000..66ea997a
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/ModifyingFactionInfluenceEventArgs.cs
@@ -0,0 +1,38 @@
+using LabApi.Events.Arguments.Interfaces;
+using PlayerRoles;
+using Respawning;
+using System;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class ModifyingFactionInfluenceEventArgs : EventArgs, ICancellableEvent
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The faction whose influence is being modified.
+ /// The influence amount the has now.
+ public ModifyingFactionInfluenceEventArgs(Faction faction, float influence)
+ {
+ Faction = faction;
+ Influence = influence;
+
+ IsAllowed = true;
+ }
+
+ ///
+ /// Gets or sets the faction whose influence is being modified.
+ ///
+ public Faction Faction { get; set; }
+
+ ///
+ /// Gets or sets the new influence of the .
+ ///
+ public float Influence { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; }
+}
diff --git a/LabApi/Events/Arguments/ServerEvents/ProjectileExplodedEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/ProjectileExplodedEventArgs.cs
index 6144ff08..832fe1f3 100644
--- a/LabApi/Events/Arguments/ServerEvents/ProjectileExplodedEventArgs.cs
+++ b/LabApi/Events/Arguments/ServerEvents/ProjectileExplodedEventArgs.cs
@@ -15,12 +15,12 @@ public class ProjectileExplodedEventArgs : EventArgs, IPlayerEvent, ITimedGrenad
/// Initializes a new instance of the class.
///
/// The projectile which will cause explosion.
- /// The player which threw that grenade.
+ /// The player which threw that grenade.
/// The position of explosion.
- public ProjectileExplodedEventArgs(TimeGrenade projectile, ReferenceHub player, Vector3 position)
+ public ProjectileExplodedEventArgs(TimeGrenade projectile, ReferenceHub hub, Vector3 position)
{
TimedGrenade = TimedGrenadeProjectile.Get(projectile);
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Position = position;
}
diff --git a/LabApi/Events/Arguments/ServerEvents/ProjectileExplodingEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/ProjectileExplodingEventArgs.cs
index ff5f3dff..31bdfed5 100644
--- a/LabApi/Events/Arguments/ServerEvents/ProjectileExplodingEventArgs.cs
+++ b/LabApi/Events/Arguments/ServerEvents/ProjectileExplodingEventArgs.cs
@@ -15,12 +15,12 @@ public class ProjectileExplodingEventArgs : EventArgs, IPlayerEvent, ITimedGrena
/// Initializes a new instance of the class.
///
/// The grenade which will cause explosion.
- /// The player which threw that grenade.
+ /// The player which threw that grenade.
/// The position of explosion.
- public ProjectileExplodingEventArgs(TimeGrenade grenade, ReferenceHub player, Vector3 position)
+ public ProjectileExplodingEventArgs(TimeGrenade grenade, ReferenceHub hub, Vector3 position)
{
TimedGrenade = TimedGrenadeProjectile.Get(grenade);
- Player = Player.Get(player);
+ Player = Player.Get(hub);
Position = position;
IsAllowed = true;
diff --git a/LabApi/Events/Arguments/ServerEvents/RoomColorChangedEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/RoomColorChangedEventArgs.cs
new file mode 100644
index 00000000..2eac9d68
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/RoomColorChangedEventArgs.cs
@@ -0,0 +1,33 @@
+using LabApi.Features.Wrappers;
+using MapGeneration;
+using System;
+using UnityEngine;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class RoomColorChangedEventArgs : EventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The room that is changing its color.
+ /// The 's new color.
+ public RoomColorChangedEventArgs(RoomIdentifier room, Color newState)
+ {
+ Room = Room.Get(room);
+ NewState = newState;
+ }
+
+ ///
+ /// Gets the current room.
+ ///
+ public Room Room { get; }
+
+ ///
+ /// Gets the new color.
+ ///
+ public Color NewState { get; }
+}
diff --git a/LabApi/Events/Arguments/ServerEvents/RoomLightChangedEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/RoomLightChangedEventArgs.cs
new file mode 100644
index 00000000..a8a6d4c4
--- /dev/null
+++ b/LabApi/Events/Arguments/ServerEvents/RoomLightChangedEventArgs.cs
@@ -0,0 +1,32 @@
+using LabApi.Features.Wrappers;
+using MapGeneration;
+using System;
+
+namespace LabApi.Events.Arguments.ServerEvents;
+
+///
+/// Represents the arguments for the event.
+///
+public class RoomLightChangedEventArgs : EventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The room that is changing its light state.
+ /// The 's new light state.
+ public RoomLightChangedEventArgs(RoomIdentifier room, bool newState)
+ {
+ Room = Room.Get(room);
+ NewState = newState;
+ }
+
+ ///
+ /// Gets the current room.
+ ///
+ public Room Room { get; }
+
+ ///
+ /// Gets the new light state.
+ ///
+ public bool NewState { get; }
+}
diff --git a/LabApi/Events/Arguments/ServerEvents/RoundEndingConditionsCheckEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/RoundEndingConditionsCheckEventArgs.cs
index 4ddd004b..afc3f753 100644
--- a/LabApi/Events/Arguments/ServerEvents/RoundEndingConditionsCheckEventArgs.cs
+++ b/LabApi/Events/Arguments/ServerEvents/RoundEndingConditionsCheckEventArgs.cs
@@ -10,7 +10,7 @@ public class RoundEndingConditionsCheckEventArgs : EventArgs
///
/// Initializes a new instance of the class.
///
- /// Whether the round end conditions are met
+ /// Whether the round end conditions are met.
public RoundEndingConditionsCheckEventArgs(bool canEnd)
{
CanEnd = canEnd;
diff --git a/LabApi/Events/Arguments/ServerEvents/SentAdminChatEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/SentAdminChatEventArgs.cs
index b9cd0e43..d6a79331 100644
--- a/LabApi/Events/Arguments/ServerEvents/SentAdminChatEventArgs.cs
+++ b/LabApi/Events/Arguments/ServerEvents/SentAdminChatEventArgs.cs
@@ -1,5 +1,5 @@
-using System;
using LabApi.Events.Arguments.Interfaces;
+using System;
namespace LabApi.Events.Arguments.ServerEvents;
diff --git a/LabApi/Events/Arguments/ServerEvents/WaveRespawnedEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/WaveRespawnedEventArgs.cs
index 8b930c55..c24cce1a 100644
--- a/LabApi/Events/Arguments/ServerEvents/WaveRespawnedEventArgs.cs
+++ b/LabApi/Events/Arguments/ServerEvents/WaveRespawnedEventArgs.cs
@@ -18,7 +18,7 @@ public class WaveRespawnedEventArgs : EventArgs
public WaveRespawnedEventArgs(SpawnableWaveBase wave, List players)
{
Players = players;
- Wave = RespawnWaves.Get(wave);
+ Wave = RespawnWaves.Get(wave)!;
}
///
diff --git a/LabApi/Events/Arguments/ServerEvents/WaveRespawningEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/WaveRespawningEventArgs.cs
index 5a0f8683..d648a0b3 100644
--- a/LabApi/Events/Arguments/ServerEvents/WaveRespawningEventArgs.cs
+++ b/LabApi/Events/Arguments/ServerEvents/WaveRespawningEventArgs.cs
@@ -21,11 +21,13 @@ public class WaveRespawningEventArgs : EventArgs, ICancellableEvent
public WaveRespawningEventArgs(SpawnableWaveBase wave, Dictionary roles)
{
IsAllowed = true;
- Wave = RespawnWaves.Get(wave);
+ Wave = RespawnWaves.Get(wave)!;
Roles = DictionaryPool.Get();
foreach (KeyValuePair kvp in roles)
+ {
Roles.Add(Player.Get(kvp.Key), kvp.Value);
+ }
}
///
diff --git a/LabApi/Events/Arguments/ServerEvents/WaveTeamSelectedEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/WaveTeamSelectedEventArgs.cs
index 3a833c6e..e040abc8 100644
--- a/LabApi/Events/Arguments/ServerEvents/WaveTeamSelectedEventArgs.cs
+++ b/LabApi/Events/Arguments/ServerEvents/WaveTeamSelectedEventArgs.cs
@@ -15,11 +15,11 @@ public class WaveTeamSelectedEventArgs : EventArgs
/// The wave that was selected.
public WaveTeamSelectedEventArgs(SpawnableWaveBase wave)
{
- Wave = RespawnWaves.Get(wave);
+ Wave = RespawnWaves.Get(wave)!;
}
///
- /// Gets the spawnable wave. See and its subclasses for more info.
+ /// Gets the spawnable wave. See and its subclasses for more info.
///
public RespawnWave Wave { get; }
}
\ No newline at end of file
diff --git a/LabApi/Events/Arguments/ServerEvents/WaveTeamSelectingEventArgs.cs b/LabApi/Events/Arguments/ServerEvents/WaveTeamSelectingEventArgs.cs
index d3ba16e1..e3cc02ae 100644
--- a/LabApi/Events/Arguments/ServerEvents/WaveTeamSelectingEventArgs.cs
+++ b/LabApi/Events/Arguments/ServerEvents/WaveTeamSelectingEventArgs.cs
@@ -21,7 +21,7 @@ public WaveTeamSelectingEventArgs(SpawnableWaveBase wave)
}
///
- /// Gets or sets the spawnable wave. See and its subclasses.
+ /// Gets or sets the spawnable wave. See and its subclasses.
/// Use the to set it to a different value.
///
public SpawnableWaveBase Wave { get; set; }
diff --git a/LabApi/Events/Arguments/WarheadEvents/WarheadDetonatedEventArgs.cs b/LabApi/Events/Arguments/WarheadEvents/WarheadDetonatedEventArgs.cs
index 1dde8d35..77bf3c15 100644
--- a/LabApi/Events/Arguments/WarheadEvents/WarheadDetonatedEventArgs.cs
+++ b/LabApi/Events/Arguments/WarheadEvents/WarheadDetonatedEventArgs.cs
@@ -12,10 +12,10 @@ public class WarheadDetonatedEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who detonated the warhead.
- public WarheadDetonatedEventArgs(ReferenceHub player)
+ /// The player who detonated the warhead.
+ public WarheadDetonatedEventArgs(ReferenceHub hub)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/WarheadEvents/WarheadDetonatingEventArgs.cs b/LabApi/Events/Arguments/WarheadEvents/WarheadDetonatingEventArgs.cs
index b0b0710b..30341c7a 100644
--- a/LabApi/Events/Arguments/WarheadEvents/WarheadDetonatingEventArgs.cs
+++ b/LabApi/Events/Arguments/WarheadEvents/WarheadDetonatingEventArgs.cs
@@ -12,11 +12,11 @@ public class WarheadDetonatingEventArgs : EventArgs, IPlayerEvent, ICancellableE
///
/// Initializes a new instance of the class.
///
- /// The player who is detonating the warhead.
- public WarheadDetonatingEventArgs(ReferenceHub player)
+ /// The player who is detonating the warhead.
+ public WarheadDetonatingEventArgs(ReferenceHub hub)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
}
///
diff --git a/LabApi/Events/Arguments/WarheadEvents/WarheadStartedEventArgs.cs b/LabApi/Events/Arguments/WarheadEvents/WarheadStartedEventArgs.cs
index 1d2c1e57..7a7ea1a2 100644
--- a/LabApi/Events/Arguments/WarheadEvents/WarheadStartedEventArgs.cs
+++ b/LabApi/Events/Arguments/WarheadEvents/WarheadStartedEventArgs.cs
@@ -12,13 +12,13 @@ public class WarheadStartedEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who started the warhead.
+ /// The player who started the warhead.
/// Whether the warhead is starting automatically.
/// Whether subtitles should be suppressed.
/// The current state of the alpha warhead.
- public WarheadStartedEventArgs(ReferenceHub player, bool isAutomatic, bool suppressSubtitles, AlphaWarheadSyncInfo warheadState)
+ public WarheadStartedEventArgs(ReferenceHub hub, bool isAutomatic, bool suppressSubtitles, AlphaWarheadSyncInfo warheadState)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
IsAutomatic = isAutomatic;
SuppressSubtitles = suppressSubtitles;
WarheadState = warheadState;
diff --git a/LabApi/Events/Arguments/WarheadEvents/WarheadStartingEventArgs.cs b/LabApi/Events/Arguments/WarheadEvents/WarheadStartingEventArgs.cs
index e9dd99eb..39953b1d 100644
--- a/LabApi/Events/Arguments/WarheadEvents/WarheadStartingEventArgs.cs
+++ b/LabApi/Events/Arguments/WarheadEvents/WarheadStartingEventArgs.cs
@@ -12,14 +12,14 @@ public class WarheadStartingEventArgs : EventArgs, IPlayerEvent, ICancellableEve
///
/// Initializes a new instance of the class.
///
- /// The player who is starting the warhead.
+ /// The player who is starting the warhead.
/// Whether the warhead is starting automatically.
/// Whether subtitles should be suppressed.
/// The current state of the alpha warhead.
- public WarheadStartingEventArgs(ReferenceHub player, bool isAutomatic, bool suppressSubtitles, AlphaWarheadSyncInfo warheadState)
+ public WarheadStartingEventArgs(ReferenceHub hub, bool isAutomatic, bool suppressSubtitles, AlphaWarheadSyncInfo warheadState)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
IsAutomatic = isAutomatic;
SuppressSubtitles = suppressSubtitles;
WarheadState = warheadState;
diff --git a/LabApi/Events/Arguments/WarheadEvents/WarheadStoppedEventArgs.cs b/LabApi/Events/Arguments/WarheadEvents/WarheadStoppedEventArgs.cs
index 580ace8c..a2894c34 100644
--- a/LabApi/Events/Arguments/WarheadEvents/WarheadStoppedEventArgs.cs
+++ b/LabApi/Events/Arguments/WarheadEvents/WarheadStoppedEventArgs.cs
@@ -12,11 +12,11 @@ public class WarheadStoppedEventArgs : EventArgs, IPlayerEvent
///
/// Initializes a new instance of the class.
///
- /// The player who stopped the warhead.
+ /// The player who stopped the warhead.
/// The current state of the alpha warhead.
- public WarheadStoppedEventArgs(ReferenceHub player, AlphaWarheadSyncInfo warheadState)
+ public WarheadStoppedEventArgs(ReferenceHub hub, AlphaWarheadSyncInfo warheadState)
{
- Player = Player.Get(player);
+ Player = Player.Get(hub);
WarheadState = warheadState;
}
diff --git a/LabApi/Events/Arguments/WarheadEvents/WarheadStoppingEventArgs.cs b/LabApi/Events/Arguments/WarheadEvents/WarheadStoppingEventArgs.cs
index 2812562a..fc39a2ae 100644
--- a/LabApi/Events/Arguments/WarheadEvents/WarheadStoppingEventArgs.cs
+++ b/LabApi/Events/Arguments/WarheadEvents/WarheadStoppingEventArgs.cs
@@ -12,12 +12,12 @@ public class WarheadStoppingEventArgs : EventArgs, IPlayerEvent, ICancellableEve
///
/// Initializes a new instance of the class.
///
- /// The player who is stopping the warhead.
+ /// The player who is stopping the warhead.
/// The current state of the alpha warhead.
- public WarheadStoppingEventArgs(ReferenceHub player, AlphaWarheadSyncInfo warheadState)
+ public WarheadStoppingEventArgs(ReferenceHub hub, AlphaWarheadSyncInfo warheadState)
{
IsAllowed = true;
- Player = Player.Get(player);
+ Player = Player.Get(hub);
WarheadState = warheadState;
}
diff --git a/LabApi/Events/CustomHandlers/CustomEventHandlers.cs b/LabApi/Events/CustomHandlers/CustomEventHandlers.cs
index 796c2682..c993a346 100644
--- a/LabApi/Events/CustomHandlers/CustomEventHandlers.cs
+++ b/LabApi/Events/CustomHandlers/CustomEventHandlers.cs
@@ -12,5 +12,5 @@ public abstract partial class CustomEventsHandler
///
/// Internal dictionary to store the registered events and their delegates.
///
- internal readonly Dictionary InternalEvents = new ();
+ internal Dictionary InternalEvents { get; } = [];
}
\ No newline at end of file
diff --git a/LabApi/Events/CustomHandlers/CustomHandlersManager.cs b/LabApi/Events/CustomHandlers/CustomHandlersManager.cs
index ba3c7326..8ec32dc8 100644
--- a/LabApi/Events/CustomHandlers/CustomHandlersManager.cs
+++ b/LabApi/Events/CustomHandlers/CustomHandlersManager.cs
@@ -46,15 +46,32 @@ public static void UnregisterEventsHandler(T handler)
///
/// Checks if the event is overriden and subscribes the handler to the event if it is.
///
- private static void CheckEvent(T handler, Type handlerType, string methodDelegate, Type eventType, string eventName)
+ /// The custom event handler instance.
+ /// The of the handler instance.
+ /// The of the event method.
+ /// The class of the handler.
+ /// The the event in the handler.
+ /// The custom event handler type.
+ public static void CheckEvent(T handler, Type handlerType, string methodDelegate, Type eventType, string eventName)
where T : CustomEventsHandler
{
- // We first get the method from the handler.
- MethodInfo? method = handlerType.GetMethod(methodDelegate, BindingFlags.Public | BindingFlags.Instance);
+ // We first get the method from the handler, there can be custom methods names as the original events but with different overloads, so we filter them.
+ MethodInfo[] candidates = handlerType.GetMethods(BindingFlags.Public | BindingFlags.Instance);
- // If the method is null or not an override, we return.
- if (method == null || !IsOverride(method))
+ MethodInfo? method = null;
+ foreach (MethodInfo candidate in candidates)
+ {
+ if (candidate.Name == methodDelegate && IsOverride(candidate))
+ {
+ method = candidate;
+ break;
+ }
+ }
+
+ if (method == null)
+ {
return;
+ }
// We get the event from the event type.
EventInfo eventInfo = eventType.GetEvent(eventName);
diff --git a/LabApi/Events/EventManager.cs b/LabApi/Events/EventManager.cs
index 85876068..17e15c50 100644
--- a/LabApi/Events/EventManager.cs
+++ b/LabApi/Events/EventManager.cs
@@ -21,7 +21,9 @@ public static void InvokeEvent(this LabEventHandler? eventHandler)
{
// We check if the event handler is null
if (eventHandler is null)
+ {
return;
+ }
#if DEBUG
// In DEBUG mode we add some useful logs about the event.
@@ -35,7 +37,9 @@ public static void InvokeEvent(this LabEventHandler? eventHandler)
{
// We invoke the subscriber as a lab event handler.
if (sub is LabEventHandler labEventHandler)
+ {
labEventHandler.Invoke();
+ }
}
catch (Exception e)
{
@@ -55,7 +59,9 @@ public static void InvokeEvent(this LabEventHandler? eve
{
// We check if the event handler is null
if (eventHandler is null)
+ {
return;
+ }
#if DEBUG
// In DEBUG mode we add some useful logs about the event.
@@ -69,7 +75,9 @@ public static void InvokeEvent(this LabEventHandler? eve
{
// We invoke the subscriber as a lab event handler.
if (sub is LabEventHandler labEventHandler)
+ {
labEventHandler.Invoke(args);
+ }
}
catch (Exception e)
{
@@ -105,7 +113,9 @@ public static string FormatToString(this LabEventHandler
// We iterate through all the properties of the EventArgs and append them to the StringBuilder.
PropertyInfo[] properties = typeof(TEventArgs).GetProperties();
if (properties.Length > 0)
+ {
stringBuilder.Append("\n");
+ }
foreach (PropertyInfo property in properties)
{
@@ -133,12 +143,14 @@ public static string FormatToString(this LabEventHandler
///
/// The that caused the error.
/// The that occurred.
- ///
+ /// The formated error message.
public static string FormatErrorMessage(Delegate eventHandler, Exception exception)
{
if (eventHandler.Target == null) // Static methods
- return $"'{exception.GetType().Name}' occured while invoking '{eventHandler.Method.Name}' on '{eventHandler.Method.DeclaringType}': '{exception.Message}', stack trace:\n{exception.StackTrace}";
+ {
+ return $"'{exception.GetType().Name}' occurred while invoking '{eventHandler.Method.Name}' on '{eventHandler.Method.DeclaringType}': '{exception.Message}', stack trace:\n{exception.StackTrace}";
+ }
- return $"'{exception.GetType().Name}' occured while invoking '{eventHandler.Method.Name}' on '{eventHandler.Target.GetType().FullName}': '{exception.Message}', stack trace:\n{exception.StackTrace}";
+ return $"'{exception.GetType().Name}' occurred while invoking '{eventHandler.Method.Name}' on '{eventHandler.Target.GetType().FullName}': '{exception.Message}', stack trace:\n{exception.StackTrace}";
}
}
\ No newline at end of file
diff --git a/LabApi/Events/Handlers/ObjectiveEvents.EventHandlers.cs b/LabApi/Events/Handlers/ObjectiveEvents.EventHandlers.cs
new file mode 100644
index 00000000..a1404722
--- /dev/null
+++ b/LabApi/Events/Handlers/ObjectiveEvents.EventHandlers.cs
@@ -0,0 +1,77 @@
+using LabApi.Events.Arguments.ObjectiveEvents;
+
+namespace LabApi.Events.Handlers;
+
+///
+/// Handles all events related to objectives.
+///
+public static partial class ObjectiveEvents
+{
+ ///
+ /// Gets called when any objective is being completed.
+ /// Use specific events or the subclasses of the to determine which kind of the objective is being completed.
+ ///
+ ///
+ /// This event is called after the very specific objective event has been triggered.
+ ///
+ public static event LabEventHandler? Completing;
+
+ ///
+ /// Gets called when any objective has been completed.
+ /// Use specific events or the subclasses of the to determine which kind of the objective has been completed.
+ ///
+ ///
+ /// This event is called after the very specific objective event has been triggered.
+ ///
+ public static event LabEventHandler? Completed;
+
+ ///
+ /// Gets called when the enemy kill objective is being completed.
+ ///
+ public static event LabEventHandler? KillingEnemyCompleting;
+
+ ///
+ /// Gets called when the enemy kill objective has been completed.
+ ///
+ public static event LabEventHandler? KilledEnemyCompleted;
+
+ ///
+ /// Gets called when the player escape objective is being completed.
+ ///
+ public static event LabEventHandler? EscapingCompleting;
+
+ ///
+ /// Gets called when the player escape objective has been completed.
+ ///
+ public static event LabEventHandler? EscapedCompleted;
+
+ ///
+ /// Gets called when the generator activated objective is being completed.
+ ///
+ public static event LabEventHandler? ActivatingGeneratorCompleting;
+
+ ///
+ /// Gets called when the generator activated objective has been completed.
+ ///
+ public static event LabEventHandler? ActivatedGeneratorCompleted;
+
+ ///
+ /// Gets called when the scp damage objective is being completed.
+ ///
+ public static event LabEventHandler? DamagingScpCompleting;
+
+ ///
+ /// Gets called when the scp damage objective has been completed.
+ ///
+ public static event LabEventHandler? DamagedScpCompleted;
+
+ ///
+ /// Gets called when the scp item pickup objective is being completed.
+ ///
+ public static event LabEventHandler? PickingScpItemCompleting;
+
+ ///
+ /// Gets called when the scp item pickup objective has been completed.
+ ///
+ public static event LabEventHandler? PickedScpItemCompleted;
+}
diff --git a/LabApi/Events/Handlers/PlayerEvents.EventHandlers.cs b/LabApi/Events/Handlers/PlayerEvents.EventHandlers.cs
index b33a6643..bd9e2ac2 100644
--- a/LabApi/Events/Handlers/PlayerEvents.EventHandlers.cs
+++ b/LabApi/Events/Handlers/PlayerEvents.EventHandlers.cs
@@ -49,7 +49,7 @@ public static partial class PlayerEvents
///
public static event LabEventHandler? UsedIntercom;
- #endregion
+ #endregion
#region Moderation
@@ -123,6 +123,64 @@ public static partial class PlayerEvents
///
public static event LabEventHandler? ToggledNoclip;
+ ///
+ /// Gets called when the player is requesting the remote admin player list.
+ ///
+ public static event LabEventHandler? RequestingRaPlayerList;
+
+ ///
+ /// Gets called when the player had requested the remote admin player list.
+ ///
+ public static event LabEventHandler? RequestedRaPlayerList;
+
+ ///
+ /// Gets called when adding a target player to the remote admin player list while processing the request for the player.
+ ///
+ public static event LabEventHandler? RaPlayerListAddingPlayer;
+
+ ///
+ /// Gets called when a target player was added to the remote admin player list while processing the request for the player.
+ ///
+ public static event LabEventHandler? RaPlayerListAddedPlayer;
+
+ ///
+ /// Gets called when a player requested info for an unknown target in the remote admin.
+ ///
+ public static event LabEventHandler? RequestedCustomRaInfo;
+
+ ///
+ /// Gets called when a player is requesting info for multiple players in the remote admin.
+ ///
+ public static event LabEventHandler? RequestingRaPlayersInfo;
+
+ ///
+ /// Gets called when a player had requested info for multiple players in the remote admin.
+ ///
+ public static event LabEventHandler? RequestedRaPlayersInfo;
+
+ ///
+ /// Gets called when a player is requesting info for a target player in the remote admin.
+ ///
+ public static event LabEventHandler? RequestingRaPlayerInfo;
+
+ ///
+ /// Gets called when a player had requested info for a target player in the remote admin.
+ ///
+ public static event LabEventHandler? RequestedRaPlayerInfo;
+
+ #endregion
+
+ #region Badges
+
+ ///
+ /// Gets called when the player is changing their global or local badge visibility.
+ ///
+ public static event LabEventHandler? ChangingBadgeVisibility;
+
+ ///
+ /// Gets called when the player has changed their global or local badge visibility.
+ ///
+ public static event LabEventHandler? ChangedBadgeVisibility;
#endregion
@@ -357,6 +415,31 @@ public static partial class PlayerEvents
///
public static event LabEventHandler? ThrewProjectile;
+ ///
+ /// Gets called when the player wants to inspect any keycard item.
+ ///
+ public static event LabEventHandler? InspectingKeycard;
+
+ ///
+ /// Gets called when the player inspected keycard item.
+ ///
+ public static event LabEventHandler? InspectedKeycard;
+
+ ///
+ /// Gets called when the player requests to spin the revolver.
+ ///
+ public static event LabEventHandler? SpinningRevolver;
+
+ ///
+ /// Gets called when the player spinned the revolver.
+ ///
+ public static event LabEventHandler? SpinnedRevolver;
+
+ ///
+ /// Gets called when the player toggled disruptor firing mode.
+ ///
+ public static event LabEventHandler? ToggledDisruptorFiringMode;
+
#endregion
#region Item Actions and Interactions
@@ -371,6 +454,11 @@ public static partial class PlayerEvents
///
public static event LabEventHandler? UsedItem;
+ ///
+ /// Gets called when the player is about to complete using an item.
+ ///
+ public static event LabEventHandler? ItemUsageEffectsApplying;
+
///
/// Gets called when the player is using the radio.
///
@@ -384,7 +472,7 @@ public static partial class PlayerEvents
/////
///// Gets called when the player is aiming the weapon.
/////
- //public static event LabEventHandler? AimingWeapon;
+ // public static event LabEventHandler? AimingWeapon;
///
/// Gets called when the player aimed the weapon.
@@ -431,6 +519,26 @@ public static partial class PlayerEvents
///
public static event LabEventHandler? ShotWeapon;
+ ///
+ /// Gets called when player is changing weapon attachments.
+ ///
+ public static event LabEventHandler? ChangingAttachments;
+
+ ///
+ /// Gets called when player has changed weapon attachments.
+ ///
+ public static event LabEventHandler? ChangedAttachments;
+
+ ///
+ /// Gets called when player is changing weapon attachments preferences.
+ ///
+ public static event LabEventHandler? SendingAttachmentsPrefs;
+
+ ///
+ /// Gets called when player has changed weapon attachments preferences.
+ ///
+ public static event LabEventHandler? SentAttachmentsPrefs;
+
///
/// Gets called when the player is cancelling the use of an item.
///
@@ -451,6 +559,16 @@ public static partial class PlayerEvents
///
public static event LabEventHandler? ChangedRadioRange;
+ ///
+ /// Gets called when processing a player's interaction with the jailbird item.
+ ///
+ public static event LabEventHandler? ProcessingJailbirdMessage;
+
+ ///
+ /// Gets called when processed the player's interaction with the jailbird item.
+ ///
+ public static event LabEventHandler? ProcessedJailbirdMessage;
+
///
/// Gets called when the player is toggling a flashlight.
///
@@ -481,6 +599,16 @@ public static partial class PlayerEvents
///
public static event LabEventHandler? ToggledRadio;
+ ///
+ /// Gets called when player successfully jumps. Not called when jumping is prevented by status effects.
+ ///
+ public static event LabEventHandler? Jumped;
+
+ ///
+ /// Gets called when player's movement state change. Such as from walking to running, sneaking and opposite way around.
+ ///
+ public static event LabEventHandler? MovementStateChanged;
+
#endregion
#region World Interaction
@@ -730,6 +858,46 @@ public static partial class PlayerEvents
///
public static event LabEventHandler? UnlockedWarheadButton;
+ ///
+ /// Gets called when the player has meet the requirements of an achievement.
+ ///
+ public static event LabEventHandler? ReceivedAchievement;
+
+ ///
+ /// Gets called when player's last known room changes.
+ ///
+ public static event LabEventHandler? RoomChanged;
+
+ ///
+ /// Gets called when player's last known zone changes.
+ ///
+ public static event LabEventHandler? ZoneChanged;
+
+ ///
+ /// Gets called when player interacts with warhead lever.
+ ///
+ public static event LabEventHandler? InteractingWarheadLever;
+
+ ///
+ /// Gets called when player interacted with warhead lever.
+ ///
+ public static event LabEventHandler? InteractedWarheadLever;
+
+ ///
+ /// Gets called when a hitmarker is being sent to a player.
+ ///
+ public static event LabEventHandler? SendingHitmarker;
+
+ ///
+ /// Gets called when a hitmarker is sent to a player.
+ ///
+ public static event LabEventHandler? SentHitmarker;
+
+ ///
+ /// Gets called when a hitmarker permission is checked for a player.
+ ///
+ public static event LabEventHandler? CheckedHitmarker;
+
#endregion
#region Spectating
@@ -772,5 +940,15 @@ public static partial class PlayerEvents
/// Gets called when a player has validated the visibility of a target player.
///
public static event LabEventHandler? ValidatedVisibility;
+
+ #endregion
+
+ #region Scp1344
+
+ ///
+ /// Gets called when player detects enemy player using SCP-1344.
+ ///
+ public static event LabEventHandler? DetectedByScp1344;
+
#endregion
}
\ No newline at end of file
diff --git a/LabApi/Events/Handlers/Scp0492Events.EventHandlers.cs b/LabApi/Events/Handlers/Scp0492Events.EventHandlers.cs
index 9ada9a92..cfd1e490 100644
--- a/LabApi/Events/Handlers/Scp0492Events.EventHandlers.cs
+++ b/LabApi/Events/Handlers/Scp0492Events.EventHandlers.cs
@@ -11,17 +11,17 @@ public static partial class Scp0492Events
/// Gets called when SCP-049-2 is starting to consume a corpse.
///
public static event LabEventHandler? StartingConsumingCorpse;
-
+
///
/// Gets called when SCP-049-2 started to consume a corpse.
///
public static event LabEventHandler? StartedConsumingCorpse;
-
+
///
/// Gets called when SCP-049-2 is consuming a corpse.
///
public static event LabEventHandler? ConsumingCorpse;
-
+
///
/// Gets called when SCP-049-2 consumed a corpse.
///
diff --git a/LabApi/Events/Handlers/Scp049Events.EventHandlers.cs b/LabApi/Events/Handlers/Scp049Events.EventHandlers.cs
index cc92149d..7e632c77 100644
--- a/LabApi/Events/Handlers/Scp049Events.EventHandlers.cs
+++ b/LabApi/Events/Handlers/Scp049Events.EventHandlers.cs
@@ -41,4 +41,24 @@ public static partial class Scp049Events
/// Gets called when SCP-049 has used its sense ability.
///
public static event LabEventHandler? UsedSense;
+
+ ///
+ /// Gets called when SCP-049 is using its attack ability.
+ ///
+ public static event LabEventHandler? Attacking;
+
+ ///
+ /// Gets called when SCP-049 has used its attack ability.
+ ///
+ public static event LabEventHandler? Attacked;
+
+ ///
+ /// Gets called when SCP-049 has lost a target.
+ ///
+ public static event LabEventHandler? SenseLostTarget;
+
+ ///
+ /// Gets called when SCP-049 has killed a target.
+ ///
+ public static event LabEventHandler? SenseKilledTarget;
}
\ No newline at end of file
diff --git a/LabApi/Events/Handlers/Scp127Events.EventHandlers.cs b/LabApi/Events/Handlers/Scp127Events.EventHandlers.cs
new file mode 100644
index 00000000..27058f3a
--- /dev/null
+++ b/LabApi/Events/Handlers/Scp127Events.EventHandlers.cs
@@ -0,0 +1,39 @@
+using LabApi.Events.Arguments.Scp127Events;
+
+namespace LabApi.Events.Handlers;
+
+///
+/// Handles all the events related to the SCP-127.
+///
+public static partial class Scp127Events
+{
+ ///
+ /// Gets called when the SCP-127 is gaining experience.
+ ///
+ public static event LabEventHandler? GainingExperience;
+
+ ///
+ /// Gets called when the SCP-127 is gained experience.
+ ///
+ public static event LabEventHandler? GainExperience;
+
+ ///
+ /// Gets called when the SCP-127 is levelling up.
+ ///
+ public static event LabEventHandler? LevellingUp;
+
+ ///
+ /// Gets called when the SCP-127 level up.
+ ///
+ public static event LabEventHandler? LevelUp;
+
+ ///
+ /// Gets called when SCP-127 is about to play a voiceline.
+ ///
+ public static event LabEventHandler? Talking;
+
+ ///
+ /// Gets called when SCP-127 played a voiceline.
+ ///
+ public static event LabEventHandler? Talked;
+}
diff --git a/LabApi/Events/Handlers/Scp173Events.EventHandlers.cs b/LabApi/Events/Handlers/Scp173Events.EventHandlers.cs
index dd597691..a6886da6 100644
--- a/LabApi/Events/Handlers/Scp173Events.EventHandlers.cs
+++ b/LabApi/Events/Handlers/Scp173Events.EventHandlers.cs
@@ -56,4 +56,24 @@ public static partial class Scp173Events
/// Gets called when SCP-173 has played a sound.
///
public static event LabEventHandler? PlayedSound;
+
+ ///
+ /// Gets called when SCP-173 is teleporting.
+ ///
+ public static event LabEventHandler? Teleporting;
+
+ ///
+ /// Gets called when SCP-173 has teleported.
+ ///
+ public static event LabEventHandler? Teleported;
+
+ ///
+ /// Gets called when SCP-173 is attempting to snap a target.
+ ///
+ public static event LabEventHandler? Snapping;
+
+ ///
+ /// Gets called when SCP-173 has snapped a target.
+ ///
+ public static event LabEventHandler? Snapped;
}
\ No newline at end of file
diff --git a/LabApi/Events/Handlers/Scp3114Events.EventHandlers.cs b/LabApi/Events/Handlers/Scp3114Events.EventHandlers.cs
new file mode 100644
index 00000000..8eb5332a
--- /dev/null
+++ b/LabApi/Events/Handlers/Scp3114Events.EventHandlers.cs
@@ -0,0 +1,59 @@
+using LabApi.Events.Arguments.Scp3114Events;
+
+namespace LabApi.Events.Handlers;
+
+///
+/// Handles all events related to SCP-3114.
+///
+public static partial class Scp3114Events
+{
+ ///
+ /// Gets called when SCP-3114 is disguising itself.
+ ///
+ public static event LabEventHandler? Disguising;
+
+ ///
+ /// Gets called when SCP-3114 has disguised itself.
+ ///
+ public static event LabEventHandler? Disguised;
+
+ ///
+ /// Gets called when SCP-3114 is revealing itself.
+ ///
+ public static event LabEventHandler? Revealing;
+
+ ///
+ /// Gets called when SCP-3114 has revealed itself.
+ ///
+ public static event LabEventHandler? Revealed;
+
+ ///
+ /// Gets called when SCP-3114 is starting to strangle a player.
+ ///
+ public static event LabEventHandler? StrangleStarting;
+
+ ///
+ /// Gets called when SCP-3114 has started to strangle a player.
+ ///
+ public static event LabEventHandler? StrangleStarted;
+
+ ///
+ /// Gets called when SCP-3114 is aborting their strangle on the player.
+ ///
+ public static event LabEventHandler? StrangleAborting;
+
+ ///
+ /// Gets called when SCP-3114 started dancing.
+ ///
+ public static event LabEventHandler? Dance;
+
+ ///
+ /// Gets called when SCP-3114 is about to dance.
+ ///
+ public static event LabEventHandler? StartDancing;
+
+ ///
+ /// Gets called when SCP-3114 has aborted their strangle on the player.
+ ///
+ public static event LabEventHandler? StrangleAborted;
+}
\ No newline at end of file
diff --git a/LabApi/Events/Handlers/Scp939Events.EventHandlers.cs b/LabApi/Events/Handlers/Scp939Events.EventHandlers.cs
index b322067f..ac815205 100644
--- a/LabApi/Events/Handlers/Scp939Events.EventHandlers.cs
+++ b/LabApi/Events/Handlers/Scp939Events.EventHandlers.cs
@@ -36,4 +36,19 @@ public static partial class Scp939Events
/// Gets called when SCP-939 has lunged.
///
public static event LabEventHandler? Lunged;
+
+ ///
+ /// Gets called when SCP-939 has focused.
+ ///
+ public static event LabEventHandler? Focused;
+
+ ///
+ /// Gets called when SCP-939 is mimicking the environment.
+ ///
+ public static event LabEventHandler? MimickingEnvironment;
+
+ ///
+ /// Gets called when SCP-939 has mimicked the environment.
+ ///
+ public static event LabEventHandler? MimickedEnvironment;
}
\ No newline at end of file
diff --git a/LabApi/Events/Handlers/ScpEvents.EventHandlers.cs b/LabApi/Events/Handlers/ScpEvents.EventHandlers.cs
new file mode 100644
index 00000000..1e1acac2
--- /dev/null
+++ b/LabApi/Events/Handlers/ScpEvents.EventHandlers.cs
@@ -0,0 +1,14 @@
+using LabApi.Events.Arguments.ScpEvents;
+
+namespace LabApi.Events.Handlers;
+
+///
+/// Handles all events related to SCPs.
+///
+public static partial class ScpEvents
+{
+ ///
+ /// Gets called when an SCP has their hume shield broken.
+ ///
+ public static event LabEventHandler? HumeShieldBroken;
+}
\ No newline at end of file
diff --git a/LabApi/Events/Handlers/ServerEvents.EventHandlers.cs b/LabApi/Events/Handlers/ServerEvents.EventHandlers.cs
index 7c8ea582..22c977bc 100644
--- a/LabApi/Events/Handlers/ServerEvents.EventHandlers.cs
+++ b/LabApi/Events/Handlers/ServerEvents.EventHandlers.cs
@@ -17,6 +17,21 @@ public static partial class ServerEvents
///
public static event LabEventHandler? RoundRestarted;
+ ///
+ /// Gets called when the server shuts down.
+ ///
+ public static event LabEventHandler? Shutdown;
+
+ ///
+ /// Gets called when Deadman Sequence is activated.
+ ///
+ public static event LabEventHandler? DeadmanSequenceActivated;
+
+ ///
+ /// Gets called when Deadman Sequence is activating.
+ ///
+ public static event LabEventHandler? DeadmanSequenceActivating;
+
///
/// Gets called when round end conditions are checked.
///
@@ -118,7 +133,7 @@ public static partial class ServerEvents
public static event LabEventHandler? LczDecontaminationAnnounced;
///
- /// Gets called when the server starts LCZ decontamiantion.
+ /// Gets called when the server starts LCZ decontamination.
///
public static event LabEventHandler? LczDecontaminationStarting;
@@ -141,7 +156,7 @@ public static partial class ServerEvents
/// Gets called when the server has created a new pickup.
///
public static event LabEventHandler? PickupCreated;
-
+
///
/// Gets called when the server has destroyed a pickup.
///
@@ -151,7 +166,7 @@ public static partial class ServerEvents
/// Gets called when the server is sending an Admin Chat message.
///
public static event LabEventHandler? SendingAdminChat;
-
+
///
/// Gets called when the server sent an Admin Chat message.
///
@@ -206,4 +221,84 @@ public static partial class ServerEvents
/// Gets called when the server activated generator.
///
public static event LabEventHandler? GeneratorActivated;
+
+ ///
+ /// Gets called when elevator's sequence has changed.
+ ///
+ public static event LabEventHandler? ElevatorSequenceChanged;
+
+ ///
+ /// Gets called when a faction's influence is changing.
+ ///
+ public static event LabEventHandler? ModifyingFactionInfluence;
+
+ ///
+ /// Gets called when a faction's influence has changed.
+ ///
+ public static event LabEventHandler? ModifiedFactionInfluence;
+
+ ///
+ /// Gets called when a faction is achieving a milestone.
+ ///
+ public static event LabEventHandler? AchievingMilestone;
+
+ ///
+ /// Gets called when a faction achieved a milestone.
+ ///
+ public static event LabEventHandler? AchievedMilestone;
+
+ ///
+ /// Gets called when a blast door changes state.
+ ///
+ public static event LabEventHandler? BlastDoorChanging;
+
+ ///
+ /// Gets called when a blast door is changed state.
+ ///
+ public static event LabEventHandler? BlastDoorChanged;
+
+ ///
+ /// Gets called when a room's light is changed.
+ ///
+ public static event LabEventHandler? RoomLightChanged;
+
+ ///
+ /// Gets called when a room's color is changed.
+ ///
+ public static event LabEventHandler? RoomColorChanged;
+
+ ///
+ /// Gets called when a door's lock state is changed.
+ ///
+ public static event LabEventHandler? DoorLockChanged;
+
+ ///
+ /// Gets called when a door is repairing.
+ ///
+ public static event LabEventHandler? DoorRepairing;
+
+ ///
+ /// Gets called when a door is repaired.
+ ///
+ public static event LabEventHandler? DoorRepaired;
+
+ ///
+ /// Gets called when a door is damaging.
+ ///
+ public static event LabEventHandler? DoorDamaging;
+
+ ///
+ /// Gets called when a door is damaged.
+ ///
+ public static event LabEventHandler? DoorDamaged;
+
+ ///
+ /// Gets called when a checkpoint door sequence is changing.
+ ///
+ public static event LabEventHandler? CheckpointDoorSequenceChanging;
+
+ ///
+ /// Gets called when a checkpoint door sequence is changed.
+ ///
+ public static event LabEventHandler? CheckpointDoorSequenceChanged;
}
\ No newline at end of file
diff --git a/LabApi/Events/LabEventHandlerTEventArgs.cs b/LabApi/Events/LabEventHandler{TEventArgs}.cs
similarity index 88%
rename from LabApi/Events/LabEventHandlerTEventArgs.cs
rename to LabApi/Events/LabEventHandler{TEventArgs}.cs
index 8690f875..9452b0fa 100644
--- a/LabApi/Events/LabEventHandlerTEventArgs.cs
+++ b/LabApi/Events/LabEventHandler{TEventArgs}.cs
@@ -6,6 +6,7 @@ namespace LabApi.Events;
/// LabAPI's event handler with a parameter.
/// Called when an event is with the specified triggered .
///
+/// The event arg instance.
/// The type of the of the event.
public delegate void LabEventHandler(TEventArgs ev)
where TEventArgs : EventArgs;
\ No newline at end of file
diff --git a/LabApi/Features/Audio/AudioTransmitter.cs b/LabApi/Features/Audio/AudioTransmitter.cs
index b90f5801..dfb516ca 100644
--- a/LabApi/Features/Audio/AudioTransmitter.cs
+++ b/LabApi/Features/Audio/AudioTransmitter.cs
@@ -17,17 +17,11 @@ namespace LabApi.Features.Audio;
/// Encodes and sends audio to certain players which plays on speakers with the specified controller id.
///
///
-/// Its possible to create multiple transmitters with the same controller id, but you must filter the receiving players such that no one player receives audio from multiple transmitters.
+/// Its possible to create multiple transmitters with the same controller id, but you must filter the receiving players such that no one player receives audio from multiple transmitters.
/// This is done to allow you to send different audio to certain players using the same speakers.
///
public class AudioTransmitter
{
- private static readonly float[] EmptyData = new float[FrameSize];
-
- private static readonly float[] TempSampleData = new float[FrameSize];
-
- private static readonly byte[] TempEncodedData = new byte[MaxEncodedSize];
-
///
/// The sample rate in samples per second.
///
@@ -48,16 +42,39 @@ public class AudioTransmitter
///
public const int MaxEncodedSize = VoiceChatSettings.MaxEncodedSize;
+ private const float GainCorrectionFactor = 1.41421356237f;
+
+ private static readonly float[] EmptyData = new float[FrameSize];
+ private static readonly float[] TempSampleData = new float[FrameSize];
+ private static readonly byte[] TempEncodedData = new byte[MaxEncodedSize];
+
+ private readonly OpusEncoder _opusEncoder;
+ private CoroutineHandle _update;
+ private double _targetTime = 0.0;
+ private bool _breakCurrent = false;
+ private float[] _currentSamples = EmptyData;
+
+ ///
+ /// Creates a new audio transmitter for the specified controller.
+ ///
+ /// The controller specified by its Id.
+ /// What kind of audio the encoder should optimise's for.
+ public AudioTransmitter(byte controllerId, OpusApplicationType type = OpusApplicationType.Audio)
+ {
+ ControllerId = controllerId;
+ _opusEncoder = new OpusEncoder(type);
+ }
+
///
/// The of the speakers to play the audio on.
///
- public readonly byte ControllerId;
+ public byte ControllerId { get; }
///
/// The queued audio clips.
/// Includes the current playing clip.
///
- public readonly Queue AudioClipSamples = [];
+ public Queue AudioClipSamples { get; } = [];
///
/// The predicate for determining which players receive audio.
@@ -65,56 +82,35 @@ public class AudioTransmitter
///
/// If , all authenticated players will receive audio packets.
///
- public Func? ValidPlayers = null;
+ public Func? ValidPlayers { get; set; } = null;
///
/// Whether the last queued clip will loop.
///
- public bool Looping = false;
+ public bool Looping { get; set; } = false;
///
- /// The position in samples of the current clip.
+ /// The position in samples of the current clip.
///
- public int CurrentPosition = 0;
+ public int CurrentPosition { get; set; } = 0;
///
/// Number of samples in the current clip.
///
- public int CurrentSampleCount => currentSamples == EmptyData ? 0 : currentSamples.Length;
+ public int CurrentSampleCount => _currentSamples == EmptyData ? 0 : _currentSamples.Length;
///
/// Whether playback is active and can be stopped or paused.
///
- public bool IsPlaying => update.IsRunning && !IsPaused;
+ public bool IsPlaying => _update.IsRunning && !IsPaused;
///
/// Whether playback is paused and can be resumed.
///
- public bool IsPaused => update.IsAliveAndPaused;
-
- private readonly OpusEncoder opusEncoder;
-
- private CoroutineHandle update;
-
- private double targetTime = 0.0;
-
- private bool breakCurrent = false;
-
- private float[] currentSamples = EmptyData;
+ public bool IsPaused => _update.IsAliveAndPaused;
private bool CanLoop => AudioClipSamples.Count == 0 && Looping;
- ///
- /// Creates a new audio transmitter for the specified controller.
- ///
- /// The controller specified by its Id.
- /// What kind of audio the encoder should optimise's for.
- public AudioTransmitter(byte controllerId, OpusApplicationType type = OpusApplicationType.Audio)
- {
- ControllerId = controllerId;
- opusEncoder = new OpusEncoder(type);
- }
-
///
/// Plays the PCM samples on the current controller.
///
@@ -124,17 +120,19 @@ public AudioTransmitter(byte controllerId, OpusApplicationType type = OpusApplic
/// The PCM samples.
/// Whether to queue the audio if audio is already playing, otherwise overrides the current audio.
///
- /// Whether to loop this clip.
+ /// Whether to loop this clip.
/// Loop ends if another clip is played either immediately if not queued or at the end of the loop if next clip was queued.
///
public void Play(float[] samples, bool queue, bool loop)
{
if (samples.IsEmpty())
+ {
throw new InvalidOperationException($"Audio clip samples must not be empty");
+ }
if (!queue)
{
- breakCurrent = true;
+ _breakCurrent = true;
AudioClipSamples.Clear();
CurrentPosition = 0;
}
@@ -142,8 +140,10 @@ public void Play(float[] samples, bool queue, bool loop)
AudioClipSamples.Enqueue(samples);
Looping = loop;
- if (!update.IsRunning)
- update = Timing.RunCoroutine(Transmit(), Segment.Update);
+ if (!_update.IsRunning)
+ {
+ _update = Timing.RunCoroutine(Transmit(), Segment.Update);
+ }
}
///
@@ -151,7 +151,7 @@ public void Play(float[] samples, bool queue, bool loop)
///
public void Pause()
{
- update.IsAliveAndPaused = true;
+ _update.IsAliveAndPaused = true;
}
///
@@ -159,8 +159,8 @@ public void Pause()
///
public void Resume()
{
- update.IsAliveAndPaused = false;
- targetTime = NetworkTime.time;
+ _update.IsAliveAndPaused = false;
+ _targetTime = NetworkTime.time;
}
///
@@ -171,12 +171,16 @@ public void Resume()
public void Skip(int count)
{
if (count == 0)
+ {
return;
+ }
- breakCurrent = true;
+ _breakCurrent = true;
CurrentPosition = 0;
for (int i = 1; i < count; i++)
+ {
AudioClipSamples.Dequeue();
+ }
}
///
@@ -184,40 +188,43 @@ public void Skip(int count)
///
public void Stop()
{
- Timing.KillCoroutines(update);
+ Timing.KillCoroutines(_update);
AudioClipSamples.Clear();
CurrentPosition = 0;
}
private IEnumerator Transmit()
{
- float root2 = MathF.Sqrt(2.0f);
- targetTime = NetworkTime.time;
+ _targetTime = NetworkTime.time;
while (!AudioClipSamples.IsEmpty())
{
- currentSamples = AudioClipSamples.Dequeue();
+ _currentSamples = AudioClipSamples.Dequeue();
- breakCurrent = false;
- while (!breakCurrent && (CanLoop || CurrentPosition < currentSamples.Length))
+ _breakCurrent = false;
+ while (!_breakCurrent && (CanLoop || CurrentPosition < _currentSamples.Length))
{
try
{
- while (targetTime < NetworkTime.time)
+ while (_targetTime < NetworkTime.time)
{
int read = 0;
while (read != FrameSize)
{
int remaining = FrameSize - read;
- int count = Mathf.Max(Mathf.Min(CurrentPosition + remaining, currentSamples.Length) - CurrentPosition, 0);
- Array.Copy(currentSamples, CurrentPosition, TempSampleData, read, count);
+ int count = Mathf.Max(Mathf.Min(CurrentPosition + remaining, _currentSamples.Length) - CurrentPosition, 0);
+ Array.Copy(_currentSamples, CurrentPosition, TempSampleData, read, count);
if (remaining == count)
+ {
CurrentPosition += count;
+ }
else
{
CurrentPosition = 0;
if (!CanLoop)
- currentSamples = AudioClipSamples.IsEmpty() ? EmptyData : AudioClipSamples.Dequeue();
+ {
+ _currentSamples = AudioClipSamples.IsEmpty() ? EmptyData : AudioClipSamples.Dequeue();
+ }
}
read += count;
@@ -226,9 +233,11 @@ private IEnumerator Transmit()
// Client sided bug causes output to be 3db quieter than expected
// so we correct for that here
for (int i = 0; i < TempSampleData.Length; i++)
- TempSampleData[i] *= root2;
+ {
+ TempSampleData[i] *= GainCorrectionFactor;
+ }
- int length = opusEncoder.Encode(TempSampleData, TempEncodedData, FrameSize);
+ int length = _opusEncoder.Encode(TempSampleData, TempEncodedData, FrameSize);
if (length > 2)
{
AudioMessage msg = new()
@@ -239,12 +248,16 @@ private IEnumerator Transmit()
};
if (ValidPlayers != null)
+ {
msg.SendToHubsConditionally(x => x.Mode != ClientInstanceMode.Unverified && ValidPlayers.Invoke(Player.Get(x)));
+ }
else
+ {
msg.SendToAuthenticated();
+ }
}
- targetTime += FramePeriod;
+ _targetTime += FramePeriod;
}
}
catch (Exception ex)
diff --git a/LabApi/Features/Console/Logger.cs b/LabApi/Features/Console/Logger.cs
index 2b5445e6..e0c59c16 100644
--- a/LabApi/Features/Console/Logger.cs
+++ b/LabApi/Features/Console/Logger.cs
@@ -30,7 +30,9 @@ public static class Logger
public static void Debug(object message, bool canBePrinted = true)
{
if (!canBePrinted)
+ {
return;
+ }
Raw(FormatLog(message, DebugPrefix, Assembly.GetCallingAssembly()), ConsoleColor.Gray);
}
diff --git a/LabApi/Features/Enums/DoorName.cs b/LabApi/Features/Enums/DoorName.cs
index 21dd9d55..466d70d2 100644
--- a/LabApi/Features/Enums/DoorName.cs
+++ b/LabApi/Features/Enums/DoorName.cs
@@ -1,47 +1,50 @@
-namespace LabApi.Features.Enums
+namespace LabApi.Features.Enums;
+
+///
+/// Enum type that represents all the door name tags defined in the game.
+///
+public enum DoorName
{
- ///
- /// Enum type that represents all the door name tags defined in the game.
- ///
- public enum DoorName
- {
- None = 0,
- LczPc,// LCZ_CAFE
- LczWc,// LCZ_WC
- LczCheckpointA,// CHECKPOINT_LCZ_A
- LczCheckpointB,// CHECKPOINT_LCZ_B
- LczArmory,// LCZ_ARMORY
- Lcz173Bottom,// 173_BOTTOM
- Lcz173Gate,// 173_GATE
- Lcz173Connector,// 173_CONNECTOR
- Lcz173Armory,// 173_ARMORY
- LczGr18Inner,// GR18_INNER
- LczGr18Gate,// GR18
- Lcz914Gate,// 914
- Lcz330,// 330
- Lcz330Chamber,// 330_CHAMBER
- Hcz079FirstGate,// 079_FIRST
- Hcz079SecondGate,// 079_SECOND
- Hcz079Armory,// 079_ARMORY
- Hcz096,// 096
- Hcz939Cryo,// 939_CRYO
- HczArmory,// HCZ_ARMORY
- Hcz049Armory,// 049_ARMORY
- HczHidChamber,// HID_CHAMBER
- HczHidUpper,// HID_UPPER
- HczHidLower,// HID_LOWER
- HczNukeArmory,// NUKE_ARMORY
- Hcz106Primiary,// 106_PRIMARY
- Hcz106Secondary,// 106_SECONDARY
- HczCheckpoint,// CHECKPOINT_EZ_HCZ_A
- Hcz127Lab, // HCZ_127_LAB
- EzIntercom,// INTERCOM
- EzGateA,// GATE_A
- EzGateB,// GATE_B
- SurfaceGate,// SURFACE_GATE
- SurfaceNuke,// SURFACE_NUKE
- SurfaceEscapePrimary,// ESCAPE_PRIMARY
- SurfaceEscapeSecondary,// ESCAPE_SECONDARY
- SurfaceEscapeFinal,// ESCAPE_FINAL
- }
+#pragma warning disable SA1602 // Enumeration items should be documented
+#pragma warning disable CS1591 // Missing XML Comment for publicly visible type or member
+ None = 0,
+ LczPc, // LCZ_CAFE
+ LczWc, // LCZ_WC
+ LczCheckpointA, // CHECKPOINT_LCZ_A
+ LczCheckpointB, // CHECKPOINT_LCZ_B
+ LczArmory, // LCZ_ARMORY
+ Lcz173Bottom, // 173_BOTTOM
+ Lcz173Gate, // 173_GATE
+ Lcz173Connector, // 173_CONNECTOR
+ Lcz173Armory, // 173_ARMORY
+ LczGr18Inner, // GR18_INNER
+ LczGr18Gate, // GR18
+ Lcz914Gate, // 914
+ Lcz330, // 330
+ Lcz330Chamber, // 330_CHAMBER
+ Hcz079FirstGate, // 079_FIRST
+ Hcz079SecondGate, // 079_SECOND
+ Hcz079Armory, // 079_ARMORY
+ Hcz096, // 096
+ Hcz939Cryo, // 939_CRYO
+ HczArmory, // HCZ_ARMORY
+ Hcz049Armory, // 049_ARMORY
+ HczHidChamber, // HID_CHAMBER
+ HczHidUpper, // HID_UPPER
+ HczHidLower, // HID_LOWER
+ HczNukeArmory, // NUKE_ARMORY
+ Hcz106Primiary, // 106_PRIMARY
+ Hcz106Secondary, // 106_SECONDARY
+ HczCheckpoint, // CHECKPOINT_EZ_HCZ_A
+ Hcz127Lab, // HCZ_127_LAB
+ EzIntercom, // INTERCOM
+ EzGateA, // GATE_A
+ EzGateB, // GATE_B
+ SurfaceGate, // SURFACE_GATE
+ SurfaceNuke, // SURFACE_NUKE
+ SurfaceEscapePrimary, // ESCAPE_PRIMARY
+ SurfaceEscapeSecondary, // ESCAPE_SECONDARY
+ SurfaceEscapeFinal, // ESCAPE_FINAL
+#pragma warning restore SA1602 // Enumeration items should be documented
+#pragma warning restore CS1591 // Missing XML Comment for publicly visible type or member
}
diff --git a/LabApi/Features/Extensions/LinqExtensions.cs b/LabApi/Features/Extensions/LinqExtensions.cs
new file mode 100644
index 00000000..d8ccc0b3
--- /dev/null
+++ b/LabApi/Features/Extensions/LinqExtensions.cs
@@ -0,0 +1,71 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace LabApi.Features.Extensions;
+
+///
+/// Extensions for Linq.
+///
+public static class LinqExtensions
+{
+ ///
+ /// Finds smallest value by a specified key.
+ /// If 2 or more occurrences have the same minimum value then the first one in the collection is returned.
+ ///
+ /// The type to compare and select.
+ /// The value to compare the keys.
+ /// The enumerable collection.
+ /// The selection function.
+ /// Minimum value or if the collection is empty.
+ public static T? MinBy(this IEnumerable enumerable, Func selectFunc)
+ where T : class
+ where TKey : IComparable
+ {
+ if (!enumerable.Any())
+ {
+ return null;
+ }
+
+ T? currentMin = enumerable.First();
+ foreach (T member in enumerable)
+ {
+ if (selectFunc(member).CompareTo(selectFunc(currentMin)) < 0)
+ {
+ currentMin = member;
+ }
+ }
+
+ return currentMin;
+ }
+
+ ///
+ /// Finds largest value by a specified key.
+ /// If 2 or more occurrences have the same minimum value then the first one in the collection is returned.
+ ///
+ /// The type to compare and select.
+ /// The value to compare the keys.
+ /// The enumerable collection.
+ /// The selection function.
+ /// Maximum value or if the collection is empty.
+ public static T? MaxBy(this IEnumerable enumerable, Func selectFunc)
+ where T : class
+ where TKey : IComparable
+ {
+ if (!enumerable.Any())
+ {
+ return null;
+ }
+
+ T? currentMin = enumerable.First();
+ foreach (T member in enumerable)
+ {
+ if (selectFunc(member).CompareTo(selectFunc(currentMin)) > 0)
+ {
+ currentMin = member;
+ }
+ }
+
+ return currentMin;
+ }
+}
diff --git a/LabApi/Features/Extensions/PriorityQueue.cs b/LabApi/Features/Extensions/PriorityQueue.cs
new file mode 100644
index 00000000..be989c92
--- /dev/null
+++ b/LabApi/Features/Extensions/PriorityQueue.cs
@@ -0,0 +1,120 @@
+using System;
+using System.Collections.Generic;
+
+namespace LabApi.Features.Extensions;
+
+///
+/// Priority queue class.
+///
+/// Data type to store in the queue.
+public class PriorityQueue
+{
+ private readonly List<(int, T)> _elements;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public PriorityQueue()
+ {
+ _elements = [];
+ }
+
+ ///
+ /// Gets the number of items currently in the queue.
+ ///
+ public int Count => _elements.Count;
+
+ ///
+ /// Adds an item to the priority queue with the specified priority.
+ /// Smaller numbers indicate higher priority.
+ ///
+ /// The item to add.
+ /// The priority of the item.
+ public void Enqueue(T item, int priority)
+ {
+ ValueTuple newItem = new(priority, item);
+ _elements.Add(newItem);
+ HeapifyUp(_elements.Count - 1);
+ }
+
+ ///
+ /// Removes and returns the item with the highest priority (smallest priority value) from the queue.
+ ///
+ /// The item with the highest priority.
+ /// Thrown if the queue is empty.
+ public T Dequeue()
+ {
+ if (Count == 0)
+ {
+ throw new InvalidOperationException("The queue is empty.");
+ }
+
+ T bestItem = _elements[0].Item2;
+ int lastIndex = _elements.Count - 1;
+
+ _elements[0] = _elements[lastIndex];
+ _elements.RemoveAt(lastIndex);
+
+ if (Count > 0)
+ {
+ HeapifyDown(0);
+ }
+
+ return bestItem;
+ }
+
+ ///
+ /// Clears all items from the queue.
+ ///
+ public void Clear()
+ {
+ _elements.Clear();
+ }
+
+ private void HeapifyUp(int index)
+ {
+ int parentIndex = (index - 1) / 2;
+ while (index > 0 && _elements[index].Item1 < _elements[parentIndex].Item1)
+ {
+ Swap(index, parentIndex);
+ index = parentIndex;
+ parentIndex = (index - 1) / 2;
+ }
+ }
+
+ private void HeapifyDown(int index)
+ {
+ int leftChildIndex;
+ int rightChildIndex;
+ int smallestChildIndex;
+ while (true)
+ {
+ leftChildIndex = (2 * index) + 1;
+ rightChildIndex = (2 * index) + 2;
+ smallestChildIndex = index;
+
+ if (leftChildIndex < Count && _elements[leftChildIndex].Item1 < _elements[smallestChildIndex].Item1)
+ {
+ smallestChildIndex = leftChildIndex;
+ }
+
+ if (rightChildIndex < Count && _elements[rightChildIndex].Item1 < _elements[smallestChildIndex].Item1)
+ {
+ smallestChildIndex = rightChildIndex;
+ }
+
+ if (smallestChildIndex == index)
+ {
+ break;
+ }
+
+ Swap(index, smallestChildIndex);
+ index = smallestChildIndex;
+ }
+ }
+
+ private void Swap(int index1, int index2)
+ {
+ (_elements[index1], _elements[index2]) = (_elements[index2], _elements[index1]);
+ }
+}
\ No newline at end of file
diff --git a/LabApi/Features/Extensions/PriorityQueuePool.cs b/LabApi/Features/Extensions/PriorityQueuePool.cs
new file mode 100644
index 00000000..c171c073
--- /dev/null
+++ b/LabApi/Features/Extensions/PriorityQueuePool.cs
@@ -0,0 +1,37 @@
+using NorthwoodLib.Pools;
+using System.Collections.Concurrent;
+
+namespace LabApi.Features.Extensions;
+
+///
+/// Pool for .
+///
+/// Type of the queue.
+public sealed class PriorityQueuePool : IPool>
+{
+ ///
+ /// Gets a shared instance.
+ ///
+ public static readonly PriorityQueuePool Shared = new();
+
+ private readonly ConcurrentQueue> _pool = new();
+
+ ///
+ /// Gives a pooled or creates a new one if the pool is empty.
+ ///
+ /// A instance from the pool.
+ public PriorityQueue Rent()
+ {
+ return _pool.TryDequeue(out PriorityQueue set) ? set : new PriorityQueue();
+ }
+
+ ///
+ /// Returns a to the pool for reuse.
+ ///
+ /// The to return to the pool.
+ public void Return(PriorityQueue queue)
+ {
+ queue.Clear();
+ _pool.Enqueue(queue);
+ }
+}
diff --git a/LabApi/Features/Extensions/RoleExtensions.cs b/LabApi/Features/Extensions/RoleExtensions.cs
index d7cf9ed1..a3ec6e5f 100644
--- a/LabApi/Features/Extensions/RoleExtensions.cs
+++ b/LabApi/Features/Extensions/RoleExtensions.cs
@@ -1,4 +1,9 @@
-using PlayerRoles;
+using System.Collections.Generic;
+using PlayerRoles;
+using System.Diagnostics.CodeAnalysis;
+using InventorySystem;
+using InventorySystem.Configs;
+using PlayerRoles.FirstPersonControl;
using UnityEngine;
namespace LabApi.Features.Extensions;
@@ -8,20 +13,58 @@ namespace LabApi.Features.Extensions;
///
public static class RoleExtensions
{
+ private static readonly InventoryRoleInfo EmptyInventoryInfo = new([], []); // prevent creating this multiple time
+
///
/// Gets the from a .
///
/// The .
/// The .
public static PlayerRoleBase GetRoleBase(this RoleTypeId roleType) => PlayerRoleLoader.TryGetRoleTemplate(roleType, out PlayerRoleBase role) ? role : null!;
-
+
+ ///
+ /// Tries to get a role base from a .
+ ///
+ /// The to get base of.
+ /// The found.
+ /// The .
+ /// The role base found, else null.
+ public static bool TryGetRoleBase(this RoleTypeId roleTypeId, [NotNullWhen(true)] out T? role) => PlayerRoleLoader.TryGetRoleTemplate(roleTypeId, out role);
+
///
/// Gets the human-readable version of a 's name.
///
/// The .
/// The name of the role.
public static string GetFullName(this RoleTypeId roleType) => roleType.GetRoleBase().RoleName;
-
+
+ ///
+ /// Tries to get a random spawn point from a .
+ ///
+ /// The role to get spawn from.
+ /// The position found.
+ /// The rotation found.
+ /// Whether a SpawnPoint was found.
+ public static bool TryGetRandomSpawnPoint(this RoleTypeId role, out Vector3 position, out float horizontalRotation)
+ {
+ if (TryGetRoleBase(role, out IFpcRole? fpcRole))
+ {
+ return fpcRole.SpawnpointHandler.TryGetSpawnpoint(out position, out horizontalRotation);
+ }
+
+ position = Vector3.zero;
+ horizontalRotation = 0f;
+ return false;
+ }
+
+ ///
+ /// Gets the inventory of the specified .
+ ///
+ /// The to get inventory of.
+ /// The found.
+ public static InventoryRoleInfo GetInventory(this RoleTypeId roleTypeId)
+ => StartingInventories.DefinedInventories.GetValueOrDefault(roleTypeId, EmptyInventoryInfo);
+
///
/// Checks if the role is an SCP role.
///
@@ -62,5 +105,5 @@ public static class RoleExtensions
///
/// The .
/// A boolean which is true when the role is a civilian role.
- public static bool IsCivilian(this RoleTypeId roleType) => roleType == RoleTypeId.ClassD || roleType == RoleTypeId.Scientist;
+ public static bool IsCivilian(this RoleTypeId roleType) => roleType is RoleTypeId.ClassD or RoleTypeId.Scientist;
}
\ No newline at end of file
diff --git a/LabApi/Features/Interfaces/IScp914ItemProcessor.cs b/LabApi/Features/Interfaces/IScp914ItemProcessor.cs
index ce9f8f9f..9e7f4c83 100644
--- a/LabApi/Features/Interfaces/IScp914ItemProcessor.cs
+++ b/LabApi/Features/Interfaces/IScp914ItemProcessor.cs
@@ -1,5 +1,6 @@
using LabApi.Features.Wrappers;
using Scp914;
+using UnityEngine;
namespace LabApi.Features.Interfaces;
@@ -8,6 +9,11 @@ namespace LabApi.Features.Interfaces;
///
public interface IScp914ItemProcessor
{
+ ///
+ /// The amount of world space position that needs to be added to move a pickup item from the input chamber to the output chamber.
+ ///
+ public static Vector3 MoveVector => Scp914Controller.MoveVector;
+
///
/// Whether to use the for inventory items and skip using .
///
@@ -28,6 +34,9 @@ public interface IScp914ItemProcessor
///
/// Called for each pickup in the intake chamber if the allows so.
///
+ ///
+ /// Add to the pickups world position to move pickup from the input chamber to the output.
+ ///
/// The used for this upgrade.
/// The to upgrade.
/// The upgrade result.
diff --git a/LabApi/Features/LabApiProperties.cs b/LabApi/Features/LabApiProperties.cs
index b35c6abd..3c7f1895 100644
--- a/LabApi/Features/LabApiProperties.cs
+++ b/LabApi/Features/LabApiProperties.cs
@@ -29,7 +29,9 @@ private static string GetCompiledVersion()
AssemblyInformationalVersionAttribute att = assembly.GetCustomAttribute();
if (att == null)
+ {
return defaultVersion;
+ }
string version = att.InformationalVersion ?? defaultVersion;
int index = version.IndexOf('+');
diff --git a/LabApi/Features/Permissions/PermissionsExtensions.cs b/LabApi/Features/Permissions/PermissionsExtensions.cs
index cc65ca67..dec1782b 100644
--- a/LabApi/Features/Permissions/PermissionsExtensions.cs
+++ b/LabApi/Features/Permissions/PermissionsExtensions.cs
@@ -1,8 +1,8 @@
-using System;
-using System.Collections.Generic;
using CommandSystem;
using LabApi.Features.Wrappers;
using RemoteAdmin;
+using System;
+using System.Collections.Generic;
namespace LabApi.Features.Permissions;
@@ -13,11 +13,11 @@ public static class PermissionsExtensions
{
///
public static Dictionary GetPermissionsByProvider(this ICommandSender sender) =>
- Player.Get(sender)?.GetPermissionsByProvider() ?? new Dictionary();
+ Player.Get(sender)?.GetPermissionsByProvider() ?? [];
///
public static string[] GetPermissions(this ICommandSender sender) =>
- Player.Get(sender)?.GetPermissions() ?? Array.Empty();
+ Player.Get(sender)?.GetPermissions() ?? [];
///
public static bool HasPermissions(this ICommandSender sender, params string[] permissions) =>
diff --git a/LabApi/Features/Permissions/PermissionsManager.cs b/LabApi/Features/Permissions/PermissionsManager.cs
index b21cb91b..58cefce7 100644
--- a/LabApi/Features/Permissions/PermissionsManager.cs
+++ b/LabApi/Features/Permissions/PermissionsManager.cs
@@ -1,8 +1,8 @@
+using LabApi.Features.Console;
+using LabApi.Features.Wrappers;
using System;
using System.Collections.Generic;
using System.Linq;
-using LabApi.Features.Console;
-using LabApi.Features.Wrappers;
namespace LabApi.Features.Permissions;
@@ -16,13 +16,14 @@ public static class PermissionsManager
///
/// Internal dictionary to store the registered permission providers.
///
- private static readonly Dictionary PermissionProviders = new();
+ private static readonly Dictionary PermissionProviders = [];
///
/// Registers the given .
///
/// The type of the permission provider to register.
- public static void RegisterProvider() where T : IPermissionsProvider, new()
+ public static void RegisterProvider()
+ where T : IPermissionsProvider, new()
{
if (PermissionProviders.ContainsKey(typeof(T)))
{
@@ -43,10 +44,13 @@ public static class PermissionsManager
/// Unregisters the given .
///
/// The type of the permission provider to unregister.
- public static void UnregisterProvider() where T : IPermissionsProvider, new()
+ public static void UnregisterProvider()
+ where T : IPermissionsProvider, new()
{
if (PermissionProviders.Remove(typeof(T)))
+ {
return;
+ }
Logger.Warn($"{LoggerPrefix} Failed to unregister the permission provider of type {typeof(T).FullName}. It is not registered.");
}
@@ -56,10 +60,13 @@ public static class PermissionsManager
///
/// The type of the permission provider to retrieve.
/// The registered of the given type ; otherwise, null.
- public static IPermissionsProvider? GetProvider() where T : IPermissionsProvider, new()
+ public static IPermissionsProvider? GetProvider()
+ where T : IPermissionsProvider, new()
{
if (PermissionProviders.TryGetValue(typeof(T), out IPermissionsProvider provider))
+ {
return provider;
+ }
Logger.Warn($"{LoggerPrefix} The permission provider of type {typeof(T).FullName} is not registered.");
return null;
diff --git a/LabApi/Features/Permissions/Providers/DefaultPermissionsProvider.cs b/LabApi/Features/Permissions/Providers/DefaultPermissionsProvider.cs
index 4a51a584..0b49ac83 100644
--- a/LabApi/Features/Permissions/Providers/DefaultPermissionsProvider.cs
+++ b/LabApi/Features/Permissions/Providers/DefaultPermissionsProvider.cs
@@ -1,12 +1,12 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
using LabApi.Features.Console;
using LabApi.Features.Wrappers;
using LabApi.Loader.Features.Paths;
using NorthwoodLib.Pools;
using Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
namespace LabApi.Features.Permissions.Providers;
@@ -20,7 +20,7 @@ public class DefaultPermissionsProvider : IPermissionsProvider
private const string PermissionsFileName = "permissions.yml";
private readonly FileInfo _permissions;
- private Dictionary _permissionsDictionary = new();
+ private Dictionary _permissionsDictionary = [];
///
/// Creates a new instance of the class.
@@ -86,7 +86,7 @@ public bool HasAnyPermission(Player player, params string[] permissions)
public void AddPermissions(Player player, params string[] permissions)
{
PermissionGroup group = GetPlayerGroup(player);
- group.Permissions = group.Permissions.Concat(permissions).ToArray();
+ group.Permissions = [.. group.Permissions, .. permissions];
ReloadPermissions();
SavePermissions();
}
@@ -100,6 +100,9 @@ public void RemovePermissions(Player player, params string[] permissions)
SavePermissions();
}
+ ///
+ void IPermissionsProvider.ReloadPermissions() => ReloadPermissions();
+
private PermissionGroup GetPlayerGroup(Player player) => _permissionsDictionary.GetValueOrDefault(player.PermissionsGroupName ?? "default") ?? PermissionGroup.Default;
private string[] GetPermissions(PermissionGroup group)
@@ -112,22 +115,28 @@ private string[] GetPermissions(PermissionGroup group)
foreach (string inheritedGroup in group.InheritedGroups)
{
if (!_permissionsDictionary.TryGetValue(inheritedGroup, out PermissionGroup inherited))
+ {
continue;
+ }
permissions.AddRange(GetPermissions(inherited));
}
- return permissions.ToArray();
+ return [.. permissions];
}
private bool HasPermission(PermissionGroup group, string permission)
{
if (group.IsRoot)
+ {
return true;
-
+ }
+
// We do first check if the group has the permission.
if (group.Permissions.Contains(permission))
+ {
return true;
+ }
if (permission.Contains("."))
{
@@ -135,17 +144,23 @@ private bool HasPermission(PermissionGroup group, string permission)
string perm = permission[..index];
if (group.SpecialPermissionsSuperset.Contains(perm + ".*"))
+ {
return true;
+ }
}
// Then we check if the group has the permission from the inherited groups.
foreach (string inheritedGroup in group.InheritedGroups)
{
if (!_permissionsDictionary.TryGetValue(inheritedGroup, out PermissionGroup inherited))
+ {
continue;
+ }
if (HasPermission(inherited, permission))
+ {
return true;
+ }
}
return false;
@@ -157,8 +172,6 @@ private void LoadDefaultPermissions()
ReloadPermissions();
}
- void IPermissionsProvider.ReloadPermissions() => ReloadPermissions();
-
private void ReloadPermissions()
{
// We clear the special permissions and fill them again.
@@ -170,12 +183,15 @@ private void ReloadPermissions()
if (permission == ".*")
{
permissionsGroup.IsRoot = true;
+
// We don't have to continue.
break;
}
-
+
if (!permission.Contains(".*"))
+ {
continue;
+ }
int index = permission.LastIndexOf(".", StringComparison.Ordinal);
string perm = permission[..index];
diff --git a/LabApi/Features/Permissions/Providers/PermissionGroup.cs b/LabApi/Features/Permissions/Providers/PermissionGroup.cs
index dcb80acb..875e0806 100644
--- a/LabApi/Features/Permissions/Providers/PermissionGroup.cs
+++ b/LabApi/Features/Permissions/Providers/PermissionGroup.cs
@@ -1,4 +1,3 @@
-using System;
using System.Collections.Generic;
using YamlDotNet.Serialization;
@@ -9,20 +8,6 @@ namespace LabApi.Features.Permissions.Providers;
///
public class PermissionGroup
{
- ///
- /// Constructor for deserialization.
- ///
- public PermissionGroup() : this([], []) {}
-
- ///
- /// Represents a group of permissions. They are linked to RA user groups.
- ///
- public PermissionGroup(string[] inheritedGroups, string[] permissions)
- {
- InheritedGroups = inheritedGroups;
- Permissions = permissions;
- }
-
///
/// Gets the default permission group.
///
@@ -37,13 +22,32 @@ public static Dictionary DefaultPermissionGroups
{
Dictionary groups = new()
{
- ["default"] = Default
+ ["default"] = Default,
};
return groups;
}
}
+ ///
+ /// Constructor for deserialization.
+ ///
+ public PermissionGroup()
+ : this([], [])
+ {
+ }
+
+ ///
+ /// Represents a group of permissions. They are linked to RA user groups.
+ ///
+ /// Array of groups that should be inherited.
+ /// Array of permissions this group should have.
+ public PermissionGroup(string[] inheritedGroups, string[] permissions)
+ {
+ InheritedGroups = inheritedGroups;
+ Permissions = permissions;
+ }
+
///
/// The inherited groups of the group.
///
diff --git a/LabApi/Features/Stores/CustomDataStore.cs b/LabApi/Features/Stores/CustomDataStore.cs
index 8677c738..90b4d3d4 100644
--- a/LabApi/Features/Stores/CustomDataStore.cs
+++ b/LabApi/Features/Stores/CustomDataStore.cs
@@ -1,8 +1,8 @@
+using LabApi.Features.Wrappers;
+using NorthwoodLib.Pools;
using System;
using System.Collections.Generic;
using System.Linq;
-using LabApi.Features.Wrappers;
-using NorthwoodLib.Pools;
namespace LabApi.Features.Stores;
@@ -11,22 +11,7 @@ namespace LabApi.Features.Stores;
///
public abstract class CustomDataStore
{
- private static readonly Dictionary> StoreInstances = new ();
-
- ///
- /// Gets the that this instance is associated with.
- ///
- public Player Owner { get; internal set; }
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The that this instance is associated with.
- protected CustomDataStore(Player owner)
- {
- Owner = owner;
- InternalOnInstanceCreated();
- }
+ private static readonly Dictionary> StoreInstances = [];
///
/// Gets the for the specified , or creates a new one if it doesn't exist.
@@ -40,16 +25,20 @@ public static TStore GetOrAdd(Player player)
Type type = typeof(TStore);
if (!CustomDataStoreManager.IsRegistered())
+ {
CustomDataStoreManager.RegisterStore();
+ }
if (!StoreInstances.TryGetValue(type, out Dictionary? playerStores))
{
- playerStores = new Dictionary();
+ playerStores = [];
StoreInstances[type] = playerStores;
}
if (playerStores.TryGetValue(player, out CustomDataStore? store))
+ {
return (TStore)store;
+ }
store = (TStore)Activator.CreateInstance(type, player);
playerStores[player] = store;
@@ -57,16 +46,6 @@ public static TStore GetOrAdd(Player player)
return (TStore)store;
}
- ///
- /// Called when a new instance of the is created.
- ///
- protected virtual void OnInstanceCreated() { }
-
- ///
- /// Called when an instance of the is going to be destroyed.
- ///
- protected virtual void OnInstanceDestroyed() { }
-
///
/// Destroys the for the specified .
///
@@ -76,10 +55,14 @@ internal static void Destroy(Player player)
where TStore : CustomDataStore
{
if (!StoreInstances.TryGetValue(typeof(TStore), out Dictionary? playerStores))
+ {
return;
+ }
if (!playerStores.TryGetValue(player, out CustomDataStore? store))
+ {
return;
+ }
store.Destroy();
}
@@ -90,47 +73,54 @@ internal static void Destroy(Player player)
/// The type of the .
internal static void DestroyAll()
{
- List? storesToRemove = ListPool.Shared.Rent(StoreInstances.SelectMany(entry =>
- entry.Value.Where(playerStore => playerStore.Value.GetType() == typeof(TStore)).Select(playerStore => playerStore.Value)));
+ List? storesToRemove = ListPool.Shared.Rent(StoreInstances.SelectMany(static entry =>
+ entry.Value.Where(static playerStore => playerStore.Value.GetType() == typeof(TStore)).Select(playerStore => playerStore.Value)));
foreach (CustomDataStore? store in storesToRemove)
+ {
store.Destroy();
+ }
ListPool.Shared.Return(storesToRemove);
}
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The that this instance is associated with.
+ protected CustomDataStore(Player owner)
+ {
+ Owner = owner;
+ InternalOnInstanceCreated();
+ }
+
+ ///
+ /// Gets the that this instance is associated with.
+ ///
+ public Player Owner { get; internal set; }
+
///
/// Destroys this instance of the .
///
internal void Destroy()
{
OnInstanceDestroyed();
- StoreInstances[this.GetType()].Remove(Owner);
+ StoreInstances[GetType()].Remove(Owner);
}
- private void InternalOnInstanceCreated() => OnInstanceCreated();
-}
-
-///
-/// Represents a Custom Data Store that plugins can use to store data with a player.
-///
-/// The type of the .
-public abstract class CustomDataStore : CustomDataStore
- where TStore : CustomDataStore
-{
///
- /// Initializes a new instance of the class.
+ /// Called when a new instance of the is created.
///
- /// The that this instance is associated with.
- protected CustomDataStore(Player owner)
- : base(owner)
+ protected virtual void OnInstanceCreated()
{
}
///
- /// Gets the for the specified .
+ /// Called when an instance of the is going to be destroyed.
///
- /// The to get the for.
- /// The for the specified .
- public static TStore Get(Player player) => GetOrAdd(player);
+ protected virtual void OnInstanceDestroyed()
+ {
+ }
+
+ private void InternalOnInstanceCreated() => OnInstanceCreated();
}
\ No newline at end of file
diff --git a/LabApi/Features/Stores/CustomDataStoreManager.cs b/LabApi/Features/Stores/CustomDataStoreManager.cs
index 57add4ba..d882830a 100644
--- a/LabApi/Features/Stores/CustomDataStoreManager.cs
+++ b/LabApi/Features/Stores/CustomDataStoreManager.cs
@@ -1,7 +1,7 @@
+using LabApi.Features.Wrappers;
using System;
using System.Collections.Generic;
using System.Reflection;
-using LabApi.Features.Wrappers;
namespace LabApi.Features.Stores;
@@ -10,10 +10,10 @@ namespace LabApi.Features.Stores;
///
public static class CustomDataStoreManager
{
- private static readonly List RegisteredStores = new ();
- private static readonly Dictionary GetOrAddMethods = new ();
- private static readonly Dictionary DestroyMethods = new ();
- private static readonly Dictionary DestroyAllMethods = new ();
+ private static readonly List RegisteredStores = [];
+ private static readonly Dictionary GetOrAddMethods = [];
+ private static readonly Dictionary DestroyMethods = [];
+ private static readonly Dictionary DestroyAllMethods = [];
///
/// Registers a custom data store.
@@ -24,25 +24,34 @@ public static bool RegisterStore()
where T : CustomDataStore
{
Type type = typeof(T);
- if (RegisteredStores.Contains(type)) return false;
+ if (RegisteredStores.Contains(type))
+ {
+ return false;
+ }
MethodInfo? getOrAddMethod = typeof(CustomDataStore).GetMethod(nameof(CustomDataStore.GetOrAdd), BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public);
if (getOrAddMethod == null)
+ {
return false;
+ }
getOrAddMethod = getOrAddMethod.MakeGenericMethod(type);
GetOrAddMethods.Add(type, getOrAddMethod);
MethodInfo? destroyMethod = typeof(CustomDataStore).GetMethod(nameof(CustomDataStore.Destroy), BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public);
if (destroyMethod == null)
+ {
return false;
+ }
destroyMethod = destroyMethod.MakeGenericMethod(type);
DestroyMethods.Add(type, destroyMethod);
MethodInfo? destroyAllMethod = typeof(CustomDataStore).GetMethod(nameof(CustomDataStore.DestroyAll), BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public);
if (destroyAllMethod == null)
+ {
return false;
+ }
destroyAllMethod = destroyAllMethod.MakeGenericMethod(type);
DestroyAllMethods.Add(type, destroyAllMethod);
@@ -60,9 +69,11 @@ public static void UnregisterStore()
where T : CustomDataStore
{
Type type = typeof(T);
-
+
if (DestroyAllMethods.TryGetValue(type, out MethodInfo? method))
+ {
method.Invoke(null, null);
+ }
DestroyAllMethods.Remove(type);
RegisteredStores.Remove(type);
@@ -70,19 +81,41 @@ public static void UnregisterStore()
DestroyMethods.Remove(type);
}
+ ///
+ /// Method used to initialize stores when a new player joins the server.
+ ///
+ /// The player added to the game.
internal static void AddPlayer(Player player)
{
foreach (Type? storeType in RegisteredStores)
- GetOrAddMethods[storeType].Invoke(null, new object[] { player });
+ {
+ GetOrAddMethods[storeType].Invoke(null, [player]);
+ }
}
- internal static void RemovePlayer(Player player)
+ ///
+ /// Method used to destroy stores when an existing player leaves the server.
+ ///
+ /// The player removed from the game.
+ internal static void RemovePlayer(Player player)
{
foreach (Type? storeType in RegisteredStores)
- DestroyMethods[storeType].Invoke(null, new object[] { player });
+ {
+ DestroyMethods[storeType].Invoke(null, [player]);
+ }
}
+ ///
+ /// Whether the store type had been registered.
+ ///
+ /// The of the store.
+ /// if registered; otherwise .
internal static bool IsRegistered(Type type) => RegisteredStores.Contains(type);
+ ///
+ /// Whether the store type had been registered.
+ ///
+ /// The stores type.
+ /// if registered; otherwise .
internal static bool IsRegistered() => IsRegistered(typeof(T));
}
\ No newline at end of file
diff --git a/LabApi/Features/Stores/CustomDataStore{TStore}.cs b/LabApi/Features/Stores/CustomDataStore{TStore}.cs
new file mode 100644
index 00000000..4daa39a4
--- /dev/null
+++ b/LabApi/Features/Stores/CustomDataStore{TStore}.cs
@@ -0,0 +1,27 @@
+using LabApi.Features.Wrappers;
+
+namespace LabApi.Features.Stores;
+
+///
+/// Represents a Custom Data Store that plugins can use to store data with a player.
+///
+/// The type of the .
+public abstract class CustomDataStore : CustomDataStore
+ where TStore : CustomDataStore
+{
+ ///
+ /// Gets the for the specified .
+ ///
+ /// The to get the for.
+ /// The for the specified .
+ public static TStore Get(Player player) => GetOrAdd(player);
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The that this instance is associated with.
+ protected CustomDataStore(Player owner)
+ : base(owner)
+ {
+ }
+}
diff --git a/LabApi/Features/Wrappers/AdminToys/AdminToy.cs b/LabApi/Features/Wrappers/AdminToys/AdminToy.cs
index 507168bd..7e2c8e77 100644
--- a/LabApi/Features/Wrappers/AdminToys/AdminToy.cs
+++ b/LabApi/Features/Wrappers/AdminToys/AdminToy.cs
@@ -13,6 +13,49 @@ namespace LabApi.Features.Wrappers;
///
public class AdminToy
{
+ ///
+ /// Contains all the handlers for constructing wrappers for the associated base game types.
+ ///
+ private static readonly Dictionary> _typeWrappers = [];
+
+ ///
+ /// Contains all the cached admin toys, accessible through their .
+ ///
+ public static Dictionary Dictionary { get; } = [];
+
+ ///
+ /// A reference to all instances of .
+ ///
+ public static IReadOnlyCollection List => Dictionary.Values;
+
+ ///
+ /// Gets the admin toy wrapper from the or creates a new one if it doesn't exist and the provided was not .
+ ///
+ /// The of the admin toy.
+ /// The requested admin toy or .
+ [return: NotNullIfNotNull(nameof(adminToyBase))]
+ public static AdminToy? Get(AdminToyBase? adminToyBase)
+ {
+ if (adminToyBase == null)
+ {
+ return null;
+ }
+
+ return Dictionary.TryGetValue(adminToyBase, out AdminToy item) ? item : CreateAdminToyWrapper(adminToyBase);
+ }
+
+ ///
+ /// Tries to get the admin toy wrapper from the .
+ ///
+ /// The of the admin toy.
+ /// The requested admin toy.
+ /// True if the admin toy exists, otherwise .
+ public static bool TryGet(AdminToyBase? adminToyBase, [NotNullWhen(true)] out AdminToy? adminToy)
+ {
+ adminToy = Get(adminToyBase);
+ return adminToy != null;
+ }
+
///
/// Initializes the class.
///
@@ -30,38 +73,131 @@ internal static void Initialize()
Register(static x => new CameraToy(x));
Register(static x => new CapybaraToy(x));
Register(static x => new TextToy(x));
+ Register(static x => new WaypointToy(x));
}
///
- /// Contains all the handlers for constructing wrappers for the associated base game types.
+ /// Instantiates a new base game admin toy object.
///
- private static readonly Dictionary> typeWrappers = [];
+ /// The base game admin toy type.
+ /// The initial local position.
+ /// The initial local rotation.
+ /// The initial local scale.
+ /// The parent transform.
+ /// The instantiated admin toy.
+ protected static T Create(Vector3 position, Quaternion rotation, Vector3 scale, Transform? parent)
+ where T : AdminToyBase
+ {
+ if (PrefabCache.Prefab == null)
+ {
+ T? found = null;
+ foreach (GameObject prefab in NetworkClient.prefabs.Values)
+ {
+ if (prefab.TryGetComponent(out found))
+ {
+ break;
+ }
+ }
+
+ if (found == null)
+ {
+ throw new InvalidOperationException($"No prefab in NetworkClient.prefabs has component type {typeof(T)}");
+ }
+
+ PrefabCache.Prefab = found;
+ }
+
+ T instance = UnityEngine.Object.Instantiate(PrefabCache.Prefab, parent);
+ instance.transform.localPosition = position;
+ instance.transform.localRotation = rotation;
+ instance.transform.localScale = scale;
+ return instance;
+ }
///
- /// Contains all the cached admin toys, accessible through their .
+ /// Creates a new wrapper from the base admin toy object.
///
- public static Dictionary Dictionary { get; } = [];
+ /// The base object.
+ /// The newly created wrapper.
+ protected static AdminToy CreateAdminToyWrapper(AdminToyBase adminToyBase)
+ {
+ if (!_typeWrappers.TryGetValue(adminToyBase.GetType(), out Func handler))
+ {
+ Console.Logger.InternalWarn($"Backing up to the default AdminToy constructor. Missing constructor handler for type {adminToyBase.GetType()}");
+ return new AdminToy(adminToyBase);
+ }
+
+ AdminToy? wrapper = handler.Invoke(adminToyBase);
+ if (wrapper == null)
+ {
+ Console.Logger.InternalWarn($"Backing up to the default AdminToy constructor. A handler returned null for type {adminToyBase.GetType()}");
+ return new AdminToy(adminToyBase);
+ }
+
+ return wrapper;
+ }
///
- /// A reference to all instances of .
+ /// A private method to handle the creation of new admin toys in the server.
///
- public static IReadOnlyCollection List => Dictionary.Values;
+ /// The created instance.
+ private static void AddAdminToy(AdminToyBase adminToyBase)
+ {
+ try
+ {
+ if (!Dictionary.ContainsKey(adminToyBase))
+ {
+ _ = CreateAdminToyWrapper(adminToyBase);
+ }
+ }
+ catch (Exception e)
+ {
+ Console.Logger.InternalError($"Failed to handle admin toy creation with error: {e}");
+ }
+ }
///
- /// A protected constructor to prevent external instantiation.
+ /// A private method to handle the removal of admin toys from the server.
///
- /// The base object.
- protected AdminToy(AdminToyBase adminToyBase)
+ /// The to be destroyed instance.
+ private static void RemoveAdminToy(AdminToyBase adminToyBase)
{
- Dictionary.Add(adminToyBase, this);
- Base = adminToyBase;
+ try
+ {
+ if (Dictionary.Remove(adminToyBase, out AdminToy adminToy))
+ {
+ adminToy.OnRemove();
+ }
+ }
+ catch (Exception e)
+ {
+ Console.Logger.InternalError($"Failed to handle admin toy destruction with error: {e}");
+ }
}
///
- /// An internal method to remove itself from the cache when the base object is destroyed.
+ /// A private method to handle the addition of wrapper handlers.
///
- internal virtual void OnRemove()
+ /// The derived base game type to handle.
+ /// A handler to construct the wrapper with the base game instance.
+ private static void Register(Func constructor)
+ where T : AdminToyBase
{
+ _typeWrappers.Add(typeof(T), x => constructor((T)x));
+ }
+
+ ///
+ /// A protected constructor to prevent external instantiation.
+ ///
+ /// The base object.
+ protected AdminToy(AdminToyBase adminToyBase)
+ {
+ Base = adminToyBase;
+
+ if (CanCache)
+ {
+ Dictionary.Add(adminToyBase, this);
+ }
}
///
@@ -92,9 +228,9 @@ internal virtual void OnRemove()
/// Position is relative to its parent if it has one, otherwise its the world position.
///
///
- /// If is true client wont update its position.
+ /// If is client wont update its position.
///
- public Vector3 Position
+ public virtual Vector3 Position
{
get => Transform.localPosition;
set => Transform.localPosition = value;
@@ -105,9 +241,9 @@ public Vector3 Position
/// Rotation is relative to its parent if it has one, otherwise its the world rotation.
///
///
- /// If is true client wont update its rotation.
+ /// If is client wont update its rotation.
///
- public Quaternion Rotation
+ public virtual Quaternion Rotation
{
get => Transform.localRotation;
set => Transform.localRotation = value;
@@ -118,9 +254,9 @@ public Quaternion Rotation
/// Scale is relative to its parent if it has one, otherwise its the world scale.
///
///
- /// If is true client wont update its scale.
+ /// If is client wont update its scale.
///
- public Vector3 Scale
+ public virtual Vector3 Scale
{
get => Transform.localScale;
set => Transform.localScale = value;
@@ -132,9 +268,9 @@ public Vector3 Scale
///
/// If the parent object contains a component and has been the parent is synced with the client.
///
- /// Can be used even if is true.
+ /// Can be used even if is .
/// When changing parent the toys relative , and are retained.
- /// Note that if the parent has called on it this object automatically has called on itself.
+ /// Note that if the parent has called on it this object automatically has called on itself.
/// To prevent destruction make sure you unparent it before that happens.
///
///
@@ -162,11 +298,11 @@ public byte MovementSmoothing
///
/// Gets or sets whether the admin toy is static.
/// This should be enabled on as many toys possible to increase performance.
- /// Static is only applies to the local transformations so parenting to something that moves will still causes it to move while retaining the performance boost.
+ /// Static is only applies to the local transformations so parenting to something that moves will still cause it to move while retaining the performance boost.
///
///
/// A static admin toy will not process , or on both server and client drastically increasing performance.
- /// can still be used even if static is true.
+ /// can still be used even if static is .
///
public bool IsStatic
{
@@ -185,11 +321,16 @@ public float SyncInterval
set => Base.syncInterval = value;
}
+ ///
+ /// Whether to cache this wrapper.
+ ///
+ protected bool CanCache => !IsDestroyed && Base.isActiveAndEnabled;
+
///
/// Spawns the toy on the client.
///
///
- /// Spawn wont cascade to children toy objects, so if they are not spawned you have to call spawn on all of them.
+ /// Spawn won't cascade to children toy objects, so if they are not spawned you have to call spawn on all of them.
///
public void Spawn() => NetworkServer.Spawn(GameObject);
@@ -202,140 +343,24 @@ public float SyncInterval
public void Destroy() => NetworkServer.Destroy(GameObject);
///
- /// Instantiates a new base game admin toy object.
- ///
- /// The base game admin toy type.
- /// The initial local position.
- /// The initial local rotation.
- /// The initial local scale.
- /// The parent transform.
- /// The instantiated admin toy.
- protected static T Create(Vector3 position, Quaternion rotation, Vector3 scale, Transform? parent) where T : AdminToyBase
- {
- if (PrefabCache.prefab == null)
- {
- T? found = null;
- foreach (GameObject prefab in NetworkClient.prefabs.Values)
- {
- if (prefab.TryGetComponent(out found))
- break;
- }
-
- if (found == null)
- throw new InvalidOperationException($"No prefab in NetworkClient.prefabs has component type {typeof(T)}");
-
- PrefabCache.prefab = found;
- }
-
- T instance = UnityEngine.Object.Instantiate(PrefabCache.prefab, parent);
- instance.transform.localPosition = position;
- instance.transform.localRotation = rotation;
- instance.transform.localScale = scale;
- return instance;
- }
-
- ///
- /// Gets the admin toy wrapper from the or creates a new one if it doesn't exist and the provided was not .
- ///
- /// The of the admin toy.
- /// The requested admin toy or .
- [return: NotNullIfNotNull(nameof(adminToyBase))]
- public static AdminToy? Get(AdminToyBase? adminToyBase)
- {
- if (adminToyBase == null)
- return null;
-
- return Dictionary.TryGetValue(adminToyBase, out AdminToy item) ? item : CreateAdminToyWrapper(adminToyBase);
- }
-
- ///
- /// Tries to get the admin toy wrapper from the .
- ///
- /// The of the admin toy.
- /// The requested admin toy.
- /// True if the admin toy exists, otherwise .
- public static bool TryGet(AdminToyBase? adminToyBase, [NotNullWhen(true)] out AdminToy? adminToy)
- {
- adminToy = Get(adminToyBase);
- return adminToy != null;
- }
-
- ///
- /// Creates a new wrapper from the base admin toy object.
- ///
- /// The base object.
- /// The newly created wrapper.
- protected static AdminToy CreateAdminToyWrapper(AdminToyBase adminToyBase)
- {
- if (!typeWrappers.TryGetValue(adminToyBase.GetType(), out Func handler))
- {
- Console.Logger.InternalWarn($"Backing up to the default AdminToy constructor. Missing constructor handler for type {adminToyBase.GetType()}");
- return new AdminToy(adminToyBase);
- }
-
- AdminToy? wrapper = handler.Invoke(adminToyBase);
- if (wrapper == null)
- {
- Console.Logger.InternalWarn($"Backing up to the default AdminToy constructor. A handler returned null for type {adminToyBase.GetType()}");
- return new AdminToy(adminToyBase);
- }
-
- return wrapper ?? new AdminToy(adminToyBase);
- }
-
- ///
- /// A private method to handle the creation of new admin toys in the server.
- ///
- /// The created instance.
- private static void AddAdminToy(AdminToyBase adminToyBase)
- {
- try
- {
- if (!Dictionary.ContainsKey(adminToyBase))
- _ = CreateAdminToyWrapper(adminToyBase);
- }
- catch (Exception e)
- {
- Console.Logger.InternalError($"Failed to handle admin toy creation with error: {e}");
- }
- }
-
- ///
- /// A private method to handle the removal of admin toys from the server.
+ /// An internal method to remove itself from the cache when the base object is destroyed.
///
- /// The to be destroyed instance.
- private static void RemoveAdminToy(AdminToyBase adminToyBase)
+ internal virtual void OnRemove()
{
- try
- {
-
- if (Dictionary.TryGetValue(adminToyBase, out AdminToy adminToy))
- {
- Dictionary.Remove(adminToyBase);
- adminToy.OnRemove();
- }
- }
- catch (Exception e)
- {
- Console.Logger.InternalError($"Failed to handle admin toy destruction with error: {e}");
- }
}
+#pragma warning disable SA1204 // Static elements should appear before instance elements
///
- /// A private method to handle the addition of wrapper handlers.
+ /// Static prefab cache used to speed up prefab search.
///
- /// The derived base game type to handle.
- /// A handler to construct the wrapper with the base game instance.
- private static void Register(Func constructor) where T : AdminToyBase
- {
- typeWrappers.Add(typeof(T), x => constructor((T)x));
- }
-
- private static class PrefabCache where T : AdminToyBase
+ /// The base game component type of the prefab.
+ internal static class PrefabCache
+ where T : NetworkBehaviour
{
///
/// Cached prefab instance for type T.
///
- public static T? prefab = null;
+ public static T? Prefab { get; set; } = null;
}
+#pragma warning restore SA1204 // Static elements should appear before instance elements
}
diff --git a/LabApi/Features/Wrappers/AdminToys/CameraToy.cs b/LabApi/Features/Wrappers/AdminToys/CameraToy.cs
index 6e996156..66050724 100644
--- a/LabApi/Features/Wrappers/AdminToys/CameraToy.cs
+++ b/LabApi/Features/Wrappers/AdminToys/CameraToy.cs
@@ -13,12 +13,73 @@ public class CameraToy : AdminToy
///
/// Contains all the camera toys, accessible through their .
///
- public new static Dictionary Dictionary { get; } = [];
+ public static new Dictionary Dictionary { get; } = [];
///
/// A reference to all instances of .
///
- public new static IReadOnlyCollection List => Dictionary.Values;
+ public static new IReadOnlyCollection List => Dictionary.Values;
+
+ ///
+ public static CameraToy Create(Transform? parent = null, bool networkSpawn = true)
+ => Create(Vector3.zero, parent, networkSpawn);
+
+ ///
+ public static CameraToy Create(Vector3 position, Transform? parent = null, bool networkSpawn = true)
+ => Create(position, Quaternion.identity, parent, networkSpawn);
+
+ ///
+ public static CameraToy Create(Vector3 position, Quaternion rotation, Transform? parent = null, bool networkSpawn = true)
+ => Create(position, rotation, Vector3.one, parent, networkSpawn);
+
+ ///
+ /// Creates a new camera toy.
+ ///
+ /// The initial local position.
+ /// The initial local rotation.
+ /// The initial local scale.
+ /// The parent transform.
+ /// Whether to spawn the toy on the client.
+ /// The created camera toy.
+ public static CameraToy Create(Vector3 position, Quaternion rotation, Vector3 scale, Transform? parent = null, bool networkSpawn = true)
+ {
+ CameraToy toy = Get(Create(position, rotation, scale, parent));
+
+ if (networkSpawn)
+ {
+ toy.Spawn();
+ }
+
+ return toy;
+ }
+
+ ///
+ /// Gets the camera toy wrapper from the or creates a new one if it doesn't exist and the provided was not .
+ ///
+ /// The of the camera toy.
+ /// The requested camera toy or .
+ [return: NotNullIfNotNull(nameof(baseCameraToy))]
+ public static CameraToy? Get(Scp079CameraToy? baseCameraToy)
+ {
+ if (baseCameraToy == null)
+ {
+ return null;
+ }
+
+ return Dictionary.TryGetValue(baseCameraToy, out CameraToy item) ? item : (CameraToy)CreateAdminToyWrapper(baseCameraToy);
+ }
+
+ ///
+ /// Tries to get the camera toy wrapper from the .
+ ///
+ /// The of the camera toy.
+ /// The requested camera toy.
+ /// True if the camera toy exists, otherwise false.
+ public static bool TryGet(Scp079CameraToy? baseCameraToy, [NotNullWhen(true)] out CameraToy? cameraToy)
+ {
+ cameraToy = Get(baseCameraToy);
+ return cameraToy != null;
+ }
///
/// An internal constructor to prevent external instantiation.
@@ -27,17 +88,12 @@ public class CameraToy : AdminToy
internal CameraToy(Scp079CameraToy baseCameraToy)
: base(baseCameraToy)
{
- Dictionary.Add(baseCameraToy, this);
Base = baseCameraToy;
- }
- ///
- /// An internal method to remove itself from the cache when the base object is destroyed.
- ///
- internal override void OnRemove()
- {
- base.OnRemove();
- Dictionary.Remove(Base);
+ if (CanCache)
+ {
+ Dictionary.Add(baseCameraToy, this);
+ }
}
///
@@ -45,11 +101,10 @@ internal override void OnRemove()
///
public new Scp079CameraToy Base { get; }
- // Todo: reimplement when publicized
- // ///
- // /// The camera instance associated with this toy.
- // ///
- // public Camera Camera => Camera.Get(Base.Camera);
+ ///
+ /// The camera instance associated with this toy.
+ ///
+ public Camera Camera => Camera.Get(Base.Camera);
///
/// Gets or sets the label of the camera displayed to SCP-079 on HUD.
@@ -101,7 +156,7 @@ public Vector2 HorizontalConstraint
/// Gets or set the min and max zoom level of the camera.
///
///
- /// Values range from 0.0 to 1.0, with zero being the minimum zoom, and 1 being the maximum zoom.
+ /// Values range from 0.0 to 1.0, with zero being the minimum zoom, and 1 being the maximum zoom.
/// X should be less than or equal to y.
///
public Vector2 ZoomConstraints
@@ -110,60 +165,12 @@ public Vector2 ZoomConstraints
set => Base.NetworkZoomConstraint = value;
}
- ///
- public static CameraToy Create(Transform? parent = null, bool networkSpawn = true)
- => Create(Vector3.zero, parent, networkSpawn);
-
- ///
- public static CameraToy Create(Vector3 position, Transform? parent = null, bool networkSpawn = true)
- => Create(position, Quaternion.identity, parent, networkSpawn);
-
- ///
- public static CameraToy Create(Vector3 position, Quaternion rotation, Transform? parent = null, bool networkSpawn = true)
- => Create(position, rotation, Vector3.one, parent, networkSpawn);
-
///
- /// Creates a new camera toy.
- ///
- /// The initial local position.
- /// The initial local rotation.
- /// The initial local scale.
- /// The parent transform.
- /// Whether to spawn the toy on the client.
- /// The created camera toy.
- public static CameraToy Create(Vector3 position, Quaternion rotation, Vector3 scale, Transform? parent = null, bool networkSpawn = true)
- {
- CameraToy toy = Get(Create(position, rotation, scale, parent));
-
- if (networkSpawn)
- toy.Spawn();
-
- return toy;
- }
-
- ///
- /// Gets the camera toy wrapper from the or creates a new one if it doesn't exist and the provided was not .
- ///
- /// The of the camera toy.
- /// The requested camera toy or .
- [return: NotNullIfNotNull(nameof(baseCameraToy))]
- public static CameraToy? Get(Scp079CameraToy? baseCameraToy)
- {
- if (baseCameraToy == null)
- return null;
-
- return Dictionary.TryGetValue(baseCameraToy, out CameraToy item) ? item : (CameraToy)CreateAdminToyWrapper(baseCameraToy);
- }
-
- ///
- /// Tries to get the camera toy wrapper from the .
+ /// An internal method to remove itself from the cache when the base object is destroyed.
///
- /// The of the camera toy.
- /// The requested camera toy.
- /// True if the camera toy exists, otherwise false.
- public static bool TryGet(Scp079CameraToy? baseCameraToy, [NotNullWhen(true)] out CameraToy? cameraToy)
+ internal override void OnRemove()
{
- cameraToy = Get(baseCameraToy);
- return cameraToy != null;
+ base.OnRemove();
+ Dictionary.Remove(Base);
}
}
diff --git a/LabApi/Features/Wrappers/AdminToys/CapybaraToy.cs b/LabApi/Features/Wrappers/AdminToys/CapybaraToy.cs
index 28630112..2f703443 100644
--- a/LabApi/Features/Wrappers/AdminToys/CapybaraToy.cs
+++ b/LabApi/Features/Wrappers/AdminToys/CapybaraToy.cs
@@ -13,45 +13,12 @@ public class CapybaraToy : AdminToy
///
/// Contains all the capybara toys, accessible through their .
///
- public new static Dictionary Dictionary { get; } = [];
+ public static new Dictionary Dictionary { get; } = [];
///
/// A reference to all instances of .
///
- public new static IReadOnlyCollection List => Dictionary.Values;
-
- ///
- /// An internal constructor to prevent external instantiation.
- ///
- /// The base object.
- internal CapybaraToy(BaseCapybaraToy baseCapybaraToy) : base(baseCapybaraToy)
- {
- Dictionary.Add(baseCapybaraToy, this);
- Base = baseCapybaraToy;
- }
-
- ///
- /// An internal method to remove itself from the cache when the base object is destroyed.
- ///
- internal override void OnRemove()
- {
- base.OnRemove();
- Dictionary.Remove(Base);
- }
-
- ///
- /// The object.
- ///
- public new BaseCapybaraToy Base { get; }
-
- ///
- /// Gets or sets whether the capybara has enabled colliders.
- ///
- public bool CollidersEnabled
- {
- get => Base.CollisionsEnabled;
- set => Base.CollisionsEnabled = value;
- }
+ public static new IReadOnlyCollection List => Dictionary.Values;
///
public static CapybaraToy Create(Transform? parent = null, bool networkSpawn = true)
@@ -79,7 +46,9 @@ public static CapybaraToy Create(Vector3 position, Quaternion rotation, Vector3
CapybaraToy toy = Get(Create(position, rotation, scale, parent));
if (networkSpawn)
+ {
toy.Spawn();
+ }
return toy;
}
@@ -93,8 +62,48 @@ public static CapybaraToy Create(Vector3 position, Quaternion rotation, Vector3
public static CapybaraToy? Get(BaseCapybaraToy? baseCapybaraToy)
{
if (baseCapybaraToy == null)
+ {
return null;
+ }
return Dictionary.TryGetValue(baseCapybaraToy, out CapybaraToy toy) ? toy : (CapybaraToy)CreateAdminToyWrapper(baseCapybaraToy);
}
+
+ ///
+ /// An internal constructor to prevent external instantiation.
+ ///
+ /// The base object.
+ internal CapybaraToy(BaseCapybaraToy baseCapybaraToy)
+ : base(baseCapybaraToy)
+ {
+ Base = baseCapybaraToy;
+
+ if (CanCache)
+ {
+ Dictionary.Add(baseCapybaraToy, this);
+ }
+ }
+
+ ///
+ /// The object.
+ ///
+ public new BaseCapybaraToy Base { get; }
+
+ ///
+ /// Gets or sets whether the capybara has enabled colliders.
+ ///
+ public bool CollidersEnabled
+ {
+ get => Base.CollisionsEnabled;
+ set => Base.CollisionsEnabled = value;
+ }
+
+ ///
+ /// An internal method to remove itself from the cache when the base object is destroyed.
+ ///
+ internal override void OnRemove()
+ {
+ base.OnRemove();
+ Dictionary.Remove(Base);
+ }
}
diff --git a/LabApi/Features/Wrappers/AdminToys/InteractableToy.cs b/LabApi/Features/Wrappers/AdminToys/InteractableToy.cs
index 6a1d7e24..9727b8a4 100644
--- a/LabApi/Features/Wrappers/AdminToys/InteractableToy.cs
+++ b/LabApi/Features/Wrappers/AdminToys/InteractableToy.cs
@@ -14,37 +14,88 @@ public class InteractableToy : AdminToy
///
/// Contains all the interactable toys, accessible through their .
///
- public new static Dictionary Dictionary { get; } = [];
+ public static new Dictionary Dictionary { get; } = [];
///
/// A reference to all instances of .
///
- public new static IReadOnlyCollection List => Dictionary.Values;
+ public static new IReadOnlyCollection List => Dictionary.Values;
+
+ ///
+ public static InteractableToy Create(Transform? parent = null, bool networkSpawn = true)
+ => Create(Vector3.zero, parent, networkSpawn);
+
+ ///
+ public static InteractableToy Create(Vector3 position, Transform? parent = null, bool networkSpawn = true)
+ => Create(position, Quaternion.identity, parent, networkSpawn);
+
+ ///
+ public static InteractableToy Create(Vector3 position, Quaternion rotation, Transform? parent = null, bool networkSpawn = true)
+ => Create(position, rotation, Vector3.one, parent, networkSpawn);
///
- /// An internal constructor to prevent external instantiation.
+ /// Creates a new interactable toy.
///
- /// The base object.
- internal InteractableToy(InvisibleInteractableToy baseInteractableToy)
- :base(baseInteractableToy)
+ /// The initial local position.
+ /// The initial local rotation.
+ /// The initial local scale.
+ /// The parent transform.
+ /// Whether to spawn the toy on the client.
+ /// The created interactable toy.
+ public static InteractableToy Create(Vector3 position, Quaternion rotation, Vector3 scale, Transform? parent = null, bool networkSpawn = true)
{
- Dictionary.Add(baseInteractableToy, this);
- Base = baseInteractableToy;
+ InteractableToy toy = Get(Create(position, rotation, scale, parent));
+
+ if (networkSpawn)
+ {
+ toy.Spawn();
+ }
+
+ return toy;
}
///
- /// An internal method to remove itself from the cache when the base object is destroyed.
+ /// Gets the interactable toy wrapper from the or creates a new one if it doesn't exist and the provided was not .
///
- internal override void OnRemove()
+ /// The of the interactable toy.
+ /// The requested interactable toy or .
+ [return: NotNullIfNotNull(nameof(baseInteractableToy))]
+ public static InteractableToy? Get(InvisibleInteractableToy? baseInteractableToy)
{
- base.OnRemove();
- Dictionary.Remove(Base);
+ if (baseInteractableToy == null)
+ {
+ return null;
+ }
+
+ return Dictionary.TryGetValue(baseInteractableToy, out InteractableToy item) ? item : (InteractableToy)CreateAdminToyWrapper(baseInteractableToy);
}
///
- /// The object.
+ /// Tries to get the interactable toy wrapper from the .
///
- public new InvisibleInteractableToy Base { get; }
+ /// The of the interactable toy.
+ /// The requested interactable toy.
+ /// True if the interactable toy exists, otherwise false.
+ public static bool TryGet(InvisibleInteractableToy? baseInteractableToy, [NotNullWhen(true)] out InteractableToy? interactableToy)
+ {
+ interactableToy = Get(baseInteractableToy);
+ return interactableToy != null;
+ }
+
+ ///
+ /// An internal constructor to prevent external instantiation.
+ ///
+ /// The base object.
+ internal InteractableToy(InvisibleInteractableToy baseInteractableToy)
+ : base(baseInteractableToy)
+ {
+ Base = baseInteractableToy;
+
+ if (CanCache)
+ {
+ Dictionary.Add(baseInteractableToy, this);
+ }
+ }
///
/// Event called when a interacts with the toy.
@@ -54,16 +105,21 @@ public event Action OnInteracted
add
{
if (InternalOnInteracted == null)
+ {
Base.OnInteracted += InvokeOnInteracted;
+ }
InternalOnInteracted += value;
}
+
remove
{
InternalOnInteracted -= value;
if (InternalOnInteracted == null)
+ {
Base.OnInteracted -= InvokeOnInteracted;
+ }
}
}
@@ -75,16 +131,21 @@ public event Action OnSearching
add
{
if (InternalOnSearching == null)
+ {
Base.OnSearching += InvokeOnSearching;
+ }
InternalOnSearching += value;
}
+
remove
{
InternalOnSearching -= value;
if (InternalOnSearching == null)
+ {
Base.OnSearching -= InvokeOnSearching;
+ }
}
}
@@ -96,16 +157,21 @@ public event Action OnSearched
add
{
if (InternalOnSearched == null)
+ {
Base.OnSearched += InvokeOnSearched;
+ }
InternalOnSearched += value;
}
+
remove
{
InternalOnSearched -= value;
if (InternalOnSearched == null)
+ {
Base.OnSearched -= InvokeOnSearched;
+ }
}
}
@@ -117,19 +183,37 @@ public event Action OnSearchAborted
add
{
if (InternalOnSearchAborted == null)
+ {
Base.OnSearched += InvokeOnSearchAborted;
+ }
InternalOnSearchAborted += value;
}
+
remove
{
InternalOnSearchAborted -= value;
if (InternalOnSearchAborted == null)
+ {
Base.OnSearched -= InvokeOnSearchAborted;
+ }
}
}
+ private event Action? InternalOnInteracted;
+
+ private event Action? InternalOnSearching;
+
+ private event Action? InternalOnSearched;
+
+ private event Action? InternalOnSearchAborted;
+
+ ///
+ /// The object.
+ ///
+ public new InvisibleInteractableToy Base { get; }
+
///
/// Gets or sets the shape of the collider used for interactions.
///
@@ -171,13 +255,14 @@ public bool IsLocked
///
public bool CanSearch => Base.CanSearch;
- private event Action? InternalOnInteracted;
-
- private event Action? InternalOnSearching;
-
- private event Action? InternalOnSearched;
-
- private event Action? InternalOnSearchAborted;
+ ///
+ /// An internal method to remove itself from the cache when the base object is destroyed.
+ ///
+ internal override void OnRemove()
+ {
+ base.OnRemove();
+ Dictionary.Remove(Base);
+ }
private void InvokeOnInteracted(ReferenceHub hub) => InternalOnInteracted?.Invoke(Player.Get(hub));
@@ -186,61 +271,4 @@ public bool IsLocked
private void InvokeOnSearched(ReferenceHub hub) => InternalOnSearched?.Invoke(Player.Get(hub));
private void InvokeOnSearchAborted(ReferenceHub hub) => InternalOnSearchAborted?.Invoke(Player.Get(hub));
-
- ///
- public static InteractableToy Create(Transform? parent = null, bool networkSpawn = true)
- => Create(Vector3.zero, parent, networkSpawn);
-
- ///
- public static InteractableToy Create(Vector3 position, Transform? parent = null, bool networkSpawn = true)
- => Create(position, Quaternion.identity, parent, networkSpawn);
-
- ///
- public static InteractableToy Create(Vector3 position, Quaternion rotation, Transform? parent = null, bool networkSpawn = true)
- => Create(position, rotation, Vector3.one, parent, networkSpawn);
-
- ///
- /// Creates a new interactable toy.
- ///
- /// The initial local position.
- /// The initial local rotation.
- /// The initial local scale.
- /// The parent transform.
- /// Whether to spawn the toy on the client.
- /// The created interactable toy.
- public static InteractableToy Create(Vector3 position, Quaternion rotation, Vector3 scale, Transform? parent = null, bool networkSpawn = true)
- {
- InteractableToy toy = Get(Create(position, rotation, scale, parent));
-
- if (networkSpawn)
- toy.Spawn();
-
- return toy;
- }
-
- ///
- /// Gets the interactable toy wrapper from the or creates a new one if it doesn't exist and the provided was not .
- ///
- /// The of the interactable toy.
- /// The requested interactable toy or .
- [return: NotNullIfNotNull(nameof(baseInteractableToy))]
- public static InteractableToy? Get(InvisibleInteractableToy? baseInteractableToy)
- {
- if (baseInteractableToy == null)
- return null;
-
- return Dictionary.TryGetValue(baseInteractableToy, out InteractableToy item) ? item : (InteractableToy)CreateAdminToyWrapper(baseInteractableToy);
- }
-
- ///
- /// Tries to get the interactable toy wrapper from the .
- ///
- /// The of the interactable toy.
- /// The requested interactable toy.
- /// True if the interactable toy exists, otherwise false.
- public static bool TryGet(InvisibleInteractableToy? baseInteractableToy, [NotNullWhen(true)] out InteractableToy? interactableToy)
- {
- interactableToy = Get(baseInteractableToy);
- return interactableToy != null;
- }
}
diff --git a/LabApi/Features/Wrappers/AdminToys/LightSourceToy.cs b/LabApi/Features/Wrappers/AdminToys/LightSourceToy.cs
index b428c2fa..c442f09a 100644
--- a/LabApi/Features/Wrappers/AdminToys/LightSourceToy.cs
+++ b/LabApi/Features/Wrappers/AdminToys/LightSourceToy.cs
@@ -13,12 +13,73 @@ public class LightSourceToy : AdminToy
///
/// Contains all the light source toys, accessible through their .
///
- public new static Dictionary Dictionary { get; } = [];
+ public static new Dictionary Dictionary { get; } = [];
///
/// A reference to all instances of .
///
- public new static IReadOnlyCollection List => Dictionary.Values;
+ public static new IReadOnlyCollection List => Dictionary.Values;
+
+ ///
+ public static LightSourceToy Create(Transform? parent = null, bool networkSpawn = true)
+ => Create(Vector3.zero, parent, networkSpawn);
+
+ ///
+ public static LightSourceToy Create(Vector3 position, Transform? parent = null, bool networkSpawn = true)
+ => Create(position, Quaternion.identity, parent, networkSpawn);
+
+ ///
+ public static LightSourceToy Create(Vector3 position, Quaternion rotation, Transform? parent = null, bool networkSpawn = true)
+ => Create(position, rotation, Vector3.one, parent, networkSpawn);
+
+ ///
+ /// Creates a new light source toy.
+ ///
+ /// The initial local position.
+ /// The initial local rotation.
+ /// The initial local scale.
+ /// The parent transform.
+ /// Whether to spawn the toy on the client.
+ /// The created light source toy.
+ public static LightSourceToy Create(Vector3 position, Quaternion rotation, Vector3 scale, Transform? parent = null, bool networkSpawn = true)
+ {
+ LightSourceToy toy = Get(Create(position, rotation, scale, parent));
+
+ if (networkSpawn)
+ {
+ toy.Spawn();
+ }
+
+ return toy;
+ }
+
+ ///
+ /// Gets the light source toy wrapper from the or creates a new one if it doesn't exist and the provided was not .
+ ///
+ /// The of the light source toy.
+ /// The requested light source toy or .
+ [return: NotNullIfNotNull(nameof(baseLightSourceToy))]
+ public static LightSourceToy? Get(BaseLightSourceToy? baseLightSourceToy)
+ {
+ if (baseLightSourceToy == null)
+ {
+ return null;
+ }
+
+ return Dictionary.TryGetValue(baseLightSourceToy, out LightSourceToy item) ? item : (LightSourceToy)CreateAdminToyWrapper(baseLightSourceToy);
+ }
+
+ ///
+ /// Tries to get the light source toy wrapper from the .
+ ///
+ /// The of the light source toy.
+ /// The requested light source toy.
+ /// if the light toy exists, otherwise .
+ public static bool TryGet(BaseLightSourceToy? baseLightSourceToy, [NotNullWhen(true)] out LightSourceToy? lightSourceToy)
+ {
+ lightSourceToy = Get(baseLightSourceToy);
+ return lightSourceToy != null;
+ }
///
/// An internal constructor to prevent external instantiation.
@@ -27,17 +88,12 @@ public class LightSourceToy : AdminToy
internal LightSourceToy(BaseLightSourceToy baseLightSourceToy)
: base(baseLightSourceToy)
{
- Dictionary.Add(baseLightSourceToy, this);
Base = baseLightSourceToy;
- }
- ///
- /// An internal method to remove itself from the cache when the base object is destroyed.
- ///
- internal override void OnRemove()
- {
- base.OnRemove();
- Dictionary.Remove(Base);
+ if (CanCache)
+ {
+ Dictionary.Add(baseLightSourceToy, this);
+ }
}
///
@@ -102,7 +158,9 @@ public LightType Type
///
/// Gets or sets the lights .
///
+#pragma warning disable CS0618 // Type or member is obsolete
public LightShape Shape
+#pragma warning restore CS0618 // Type or member is obsolete
{
get => Base.LightShape;
set => Base.NetworkLightShape = value;
@@ -132,60 +190,12 @@ public override string ToString()
return $"[LightSourceToy: Type={Type}, Shape={Shape}, Intensity={Intensity}, Range={Range}, Color={Color}, ShadowType={ShadowType}, ShadowStrength={ShadowStrength}]";
}
- ///
- public static LightSourceToy Create(Transform? parent = null, bool networkSpawn = true)
- => Create(Vector3.zero, parent, networkSpawn);
-
- ///
- public static LightSourceToy Create(Vector3 position, Transform? parent = null, bool networkSpawn = true)
- => Create(position, Quaternion.identity, parent, networkSpawn);
-
- ///
- public static LightSourceToy Create(Vector3 position, Quaternion rotation, Transform? parent = null, bool networkSpawn = true)
- => Create(position, rotation, Vector3.one, parent, networkSpawn);
-
- ///
- /// Creates a new light source toy.
- ///
- /// The initial local position.
- /// The initial local rotation.
- /// The initial local scale.
- /// The parent transform.
- /// Whether to spawn the toy on the client.
- /// The created light source toy.
- public static LightSourceToy Create(Vector3 position, Quaternion rotation, Vector3 scale, Transform? parent = null, bool networkSpawn = true)
- {
- LightSourceToy toy = Get(Create(position, rotation, scale, parent));
-
- if (networkSpawn)
- toy.Spawn();
-
- return toy;
- }
-
- ///
- /// Gets the light source toy wrapper from the or creates a new one if it doesn't exist and the provided was not .
- ///
- /// The of the light source toy.
- /// The requested light source toy or .
- [return: NotNullIfNotNull(nameof(baseLightSourceToy))]
- public static LightSourceToy? Get(BaseLightSourceToy? baseLightSourceToy)
- {
- if (baseLightSourceToy == null)
- return null;
-
- return Dictionary.TryGetValue(baseLightSourceToy, out LightSourceToy item) ? item : (LightSourceToy)CreateAdminToyWrapper(baseLightSourceToy);
- }
-
///
- /// Tries to get the light source toy wrapper from the .
+ /// An internal method to remove itself from the cache when the base object is destroyed.
///
- /// The of the light source toy.
- /// The requested light source toy.
- /// if the light toy exists, otherwise .
- public static bool TryGet(BaseLightSourceToy? baseLightSourceToy, [NotNullWhen(true)] out LightSourceToy? lightSourceToy)
+ internal override void OnRemove()
{
- lightSourceToy = Get(baseLightSourceToy);
- return lightSourceToy != null;
+ base.OnRemove();
+ Dictionary.Remove(Base);
}
}
diff --git a/LabApi/Features/Wrappers/AdminToys/PrimitiveObjectToy.cs b/LabApi/Features/Wrappers/AdminToys/PrimitiveObjectToy.cs
index 62196bf9..ba5c4fad 100644
--- a/LabApi/Features/Wrappers/AdminToys/PrimitiveObjectToy.cs
+++ b/LabApi/Features/Wrappers/AdminToys/PrimitiveObjectToy.cs
@@ -14,73 +14,12 @@ public class PrimitiveObjectToy : AdminToy
///
/// Contains all the primitive object toys, accessible through their .
///
- public new static Dictionary Dictionary { get; } = [];
+ public static new Dictionary Dictionary { get; } = [];
///
/// A reference to all instances of .
///
- public new static IReadOnlyCollection List => Dictionary.Values;
-
- ///
- /// An internal constructor to prevent external instantiation.
- ///
- /// The base object.
- internal PrimitiveObjectToy(BasePrimitiveObjectToy basePrimitiveObjectToy)
- : base(basePrimitiveObjectToy)
- {
- Dictionary.Add(basePrimitiveObjectToy, this);
- Base = basePrimitiveObjectToy;
- }
-
- ///
- /// An internal method to remove itself from the cache when the base object is destroyed.
- ///
- internal override void OnRemove()
- {
- base.OnRemove();
- Dictionary.Remove(Base);
- }
-
- ///
- /// The object.
- ///
- public new BasePrimitiveObjectToy Base { get; }
-
- ///
- /// Gets or sets the .
- ///
- public PrimitiveType Type
- {
- get => Base.PrimitiveType;
- set => Base.NetworkPrimitiveType = value;
- }
-
- ///
- /// Gets or sets the material .
- ///
- public Color Color
- {
- get => Base.MaterialColor;
- set => Base.NetworkMaterialColor = value;
- }
-
- ///
- /// Gets or sets the .
- ///
- ///
- /// Setting flags to is similar to having an empty object which is useful as a root object other toys parent to.
- ///
- public PrimitiveFlags Flags
- {
- get => Base.PrimitiveFlags;
- set => Base.NetworkPrimitiveFlags = value;
- }
-
- ///
- public override string ToString()
- {
- return $"[PrimitiveObjectToy: Type={Type}, Color={Color}, Flags={Flags}]";
- }
+ public static new IReadOnlyCollection List => Dictionary.Values;
///
public static PrimitiveObjectToy Create(Transform? parent = null, bool networkSpawn = true)
@@ -108,7 +47,9 @@ public static PrimitiveObjectToy Create(Vector3 position, Quaternion rotation, V
PrimitiveObjectToy toy = Get(Create(position, rotation, scale, parent));
if (networkSpawn)
+ {
toy.Spawn();
+ }
return toy;
}
@@ -122,7 +63,9 @@ public static PrimitiveObjectToy Create(Vector3 position, Quaternion rotation, V
public static PrimitiveObjectToy? Get(BasePrimitiveObjectToy? primitiveObjectToy)
{
if (primitiveObjectToy == null)
+ {
return null;
+ }
return Dictionary.TryGetValue(primitiveObjectToy, out PrimitiveObjectToy item) ? item : (PrimitiveObjectToy)CreateAdminToyWrapper(primitiveObjectToy);
}
@@ -138,4 +81,69 @@ public static bool TryGet(BasePrimitiveObjectToy? basePrimitiveObjectToy, [NotNu
primitiveObjectToy = Get(basePrimitiveObjectToy);
return primitiveObjectToy != null;
}
+
+ ///
+ /// An internal constructor to prevent external instantiation.
+ ///
+ /// The base object.
+ internal PrimitiveObjectToy(BasePrimitiveObjectToy basePrimitiveObjectToy)
+ : base(basePrimitiveObjectToy)
+ {
+ Base = basePrimitiveObjectToy;
+
+ if (CanCache)
+ {
+ Dictionary.Add(basePrimitiveObjectToy, this);
+ }
+ }
+
+ ///
+ /// The object.
+ ///
+ public new BasePrimitiveObjectToy Base { get; }
+
+ ///
+ /// Gets or sets the .
+ ///
+ public PrimitiveType Type
+ {
+ get => Base.PrimitiveType;
+ set => Base.NetworkPrimitiveType = value;
+ }
+
+ ///
+ /// Gets or sets the material .
+ ///
+ public Color Color
+ {
+ get => Base.MaterialColor;
+ set => Base.NetworkMaterialColor = value;
+ }
+
+ ///
+ /// Gets or sets the .
+ ///
+ ///
+ /// Setting flags to is similar to having an empty object which is useful as a root object other toys parent to.
+ ///
+ public PrimitiveFlags Flags
+ {
+ get => Base.PrimitiveFlags;
+ set => Base.NetworkPrimitiveFlags = value;
+ }
+
+ ///
+ public override string ToString()
+ {
+ return $"[PrimitiveObjectToy: Type={Type}, Color={Color}, Flags={Flags}]";
+ }
+
+ ///
+ /// An internal method to remove itself from the cache when the base object is destroyed.
+ ///
+ internal override void OnRemove()
+ {
+ base.OnRemove();
+ Dictionary.Remove(Base);
+ }
}
diff --git a/LabApi/Features/Wrappers/AdminToys/ShootingTargetToy.cs b/LabApi/Features/Wrappers/AdminToys/ShootingTargetToy.cs
index 4699f031..6f5281cc 100644
--- a/LabApi/Features/Wrappers/AdminToys/ShootingTargetToy.cs
+++ b/LabApi/Features/Wrappers/AdminToys/ShootingTargetToy.cs
@@ -13,65 +13,25 @@ public class ShootingTargetToy : AdminToy
///
/// Contains all the shooting target toys, accessible through their .
///
- public new static Dictionary Dictionary { get; } = [];
+ public static new Dictionary Dictionary { get; } = [];
///
/// A reference to all instances of .
///
- public new static IReadOnlyCollection List => Dictionary.Values;
-
- ///
- /// An internal constructor to prevent external instantiation.
- ///
- /// The base object.
- internal ShootingTargetToy(ShootingTarget shootingTarget)
- : base(shootingTarget)
- {
- Dictionary.Add(shootingTarget, this);
- Base = shootingTarget;
- }
-
- ///
- /// An internal method to remove itself from the cache when the base object is destroyed.
- ///
- internal override void OnRemove()
- {
- base.OnRemove();
- Dictionary.Remove(Base);
- }
-
- ///
- /// The object.
- ///
- public new ShootingTarget Base { get; }
-
- ///
- /// Gets or sets whether other players can see your interactions.
- ///
- public bool IsGlobal
- {
- get => Base.Network_syncMode;
- set => Base.Network_syncMode = value;
- }
-
- ///
- public override string ToString()
- {
- return $"[ShootingTargetToy: IsGlobal={IsGlobal}]";
- }
+ public static new IReadOnlyCollection List => Dictionary.Values;
///
- // BUG: you can only spawn one of the shooting target types and you dont get to choose which.
+ // BUG: you can only spawn one of the shooting target types and you don't get to choose which.
public static ShootingTargetToy Create(Transform? parent = null, bool networkSpawn = true)
=> Create(Vector3.zero, parent, networkSpawn);
///
- // BUG: you can only spawn one of the shooting target types and you dont get to choose which.
+ // BUG: you can only spawn one of the shooting target types and you don't get to choose which.
public static ShootingTargetToy Create(Vector3 position, Transform? parent = null, bool networkSpawn = true)
=> Create(position, Quaternion.identity, parent, networkSpawn);
///
- // BUG: you can only spawn one of the shooting target types and you dont get to choose which.
+ // BUG: you can only spawn one of the shooting target types and you don't get to choose which.
public static ShootingTargetToy Create(Vector3 position, Quaternion rotation, Transform? parent = null, bool networkSpawn = true)
=> Create(position, rotation, Vector3.one, parent, networkSpawn);
@@ -84,13 +44,15 @@ public static ShootingTargetToy Create(Vector3 position, Quaternion rotation, Tr
/// The parent transform.
/// Whether to spawn the toy on the client.
/// The created shooting target toy.
- // BUG: you can only spawn one of the shooting target types and you dont get to choose which.
+ // BUG: you can only spawn one of the shooting target types and you don't get to choose which.
public static ShootingTargetToy Create(Vector3 position, Quaternion rotation, Vector3 scale, Transform? parent = null, bool networkSpawn = true)
{
ShootingTargetToy toy = Get(Create(position, rotation, scale, parent));
if (networkSpawn)
+ {
toy.Spawn();
+ }
return toy;
}
@@ -104,7 +66,9 @@ public static ShootingTargetToy Create(Vector3 position, Quaternion rotation, Ve
public static ShootingTargetToy? Get(ShootingTarget? shootingTarget)
{
if (shootingTarget == null)
+ {
return null;
+ }
return Dictionary.TryGetValue(shootingTarget, out ShootingTargetToy toy) ? toy : (ShootingTargetToy)CreateAdminToyWrapper(shootingTarget);
}
@@ -120,4 +84,48 @@ public static bool TryGet(ShootingTarget? shootingTarget, [NotNullWhen(true)] ou
shootingTargetToy = Get(shootingTarget);
return shootingTargetToy != null;
}
+
+ ///
+ /// An internal constructor to prevent external instantiation.
+ ///
+ /// The base object.
+ internal ShootingTargetToy(ShootingTarget shootingTarget)
+ : base(shootingTarget)
+ {
+ Base = shootingTarget;
+
+ if (CanCache)
+ {
+ Dictionary.Add(shootingTarget, this);
+ }
+ }
+
+ ///
+ /// The object.
+ ///
+ public new ShootingTarget Base { get; }
+
+ ///
+ /// Gets or sets whether other players can see your interactions.
+ ///
+ public bool IsGlobal
+ {
+ get => Base.Network_syncMode;
+ set => Base.Network_syncMode = value;
+ }
+
+ ///
+ public override string ToString()
+ {
+ return $"[ShootingTargetToy: IsGlobal={IsGlobal}]";
+ }
+
+ ///
+ /// An internal method to remove itself from the cache when the base object is destroyed.
+ ///
+ internal override void OnRemove()
+ {
+ base.OnRemove();
+ Dictionary.Remove(Base);
+ }
}
diff --git a/LabApi/Features/Wrappers/AdminToys/SpawnableCullingParent.cs b/LabApi/Features/Wrappers/AdminToys/SpawnableCullingParent.cs
new file mode 100644
index 00000000..d8b33354
--- /dev/null
+++ b/LabApi/Features/Wrappers/AdminToys/SpawnableCullingParent.cs
@@ -0,0 +1,207 @@
+using AdminToys;
+using Generators;
+using Mirror;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using UnityEngine;
+using static LabApi.Features.Wrappers.AdminToy;
+using BaseCullingParent = AdminToys.SpawnableCullingParent;
+using Logger = LabApi.Features.Console.Logger;
+
+namespace LabApi.Features.Wrappers;
+
+///
+/// Wrapper for .
+/// Cullable item that deactivates itself when not being looked at.
+/// Can contain children admin toys to cull them.
+///
+///
+/// This class is not subclass of .
+///
+public class SpawnableCullingParent
+{
+ ///
+ /// Contains all the cached spawnable culling parents, accessible through their .
+ ///
+ public static Dictionary Dictionary { get; } = [];
+
+ ///
+ /// A reference to all instances of .
+ ///
+ public static IReadOnlyCollection List => Dictionary.Values;
+
+ ///
+ /// Instantiates a new culling parent object.
+ ///
+ /// The initial position.
+ /// The bounds size.
+ /// Whether should the game object spawn over network.
+ /// The instantiated culling parent.
+ public static SpawnableCullingParent Create(Vector3 position, Vector3 size, bool networkSpawn = true)
+ {
+ if (PrefabCache.Prefab == null)
+ {
+ BaseCullingParent? found = null;
+ foreach (GameObject prefab in NetworkClient.prefabs.Values)
+ {
+ if (prefab.TryGetComponent(out found))
+ {
+ break;
+ }
+ }
+
+ if (found == null)
+ {
+ throw new InvalidOperationException($"No prefab in NetworkClient.prefabs has component type {typeof(BaseCullingParent)}");
+ }
+
+ PrefabCache.Prefab = found;
+ }
+
+ BaseCullingParent instance = UnityEngine.Object.Instantiate(PrefabCache.Prefab, position, Quaternion.identity);
+ instance.NetworkBoundsPosition = position;
+ instance.NetworkBoundsSize = size;
+
+ if (networkSpawn)
+ {
+ NetworkServer.Spawn(instance.gameObject);
+ }
+
+ return Get(instance);
+ }
+
+ ///
+ /// Gets the cullable parent wrapper from the or creates a new one if it doesn't exist and the provided was not .
+ ///
+ /// The of the cullable parent.
+ /// The requested culling parent or .
+ [return: NotNullIfNotNull(nameof(cullingBase))]
+ public static SpawnableCullingParent? Get(BaseCullingParent? cullingBase)
+ {
+ if (cullingBase == null)
+ {
+ return null;
+ }
+
+ return Dictionary.TryGetValue(cullingBase, out SpawnableCullingParent item) ? item : new SpawnableCullingParent(cullingBase);
+ }
+
+ ///
+ /// Tries to get the culling parent wrapper from the .
+ ///
+ /// The of the cullable parent.
+ /// The requested culling parent.
+ /// if the culling parent exists, otherwise .
+ public static bool TryGet(BaseCullingParent? adminToyBase, [NotNullWhen(true)] out SpawnableCullingParent? adminToy)
+ {
+ adminToy = Get(adminToyBase);
+ return adminToy != null;
+ }
+
+ ///
+ /// Initializes the class.
+ ///
+ [InitializeWrapper]
+ internal static void Initialize()
+ {
+ BaseCullingParent.OnAdded += AddCullableParent;
+ BaseCullingParent.OnRemoved += RemoveCullableParent;
+ }
+
+ ///
+ /// A private method to handle the creation of new cullable parents on the server.
+ ///
+ /// The created instance.
+ private static void AddCullableParent(BaseCullingParent cullableParent)
+ {
+ try
+ {
+ if (!Dictionary.ContainsKey(cullableParent))
+ {
+ _ = new SpawnableCullingParent(cullableParent);
+ }
+ }
+ catch (Exception e)
+ {
+ Logger.InternalError($"Failed to handle cullable parent creation with error: {e}");
+ }
+ }
+
+ ///
+ /// A private method to handle the removal of cullable parents from the server.
+ ///
+ /// The to be destroyed instance.
+ private static void RemoveCullableParent(BaseCullingParent cullableParent)
+ {
+ try
+ {
+ Dictionary.Remove(cullableParent);
+ }
+ catch (Exception e)
+ {
+ Logger.InternalError($"Failed to handle cullable parent destruction with error: {e}");
+ }
+ }
+
+ ///
+ /// A protected constructor to prevent external instantiation.
+ ///
+ /// The base object.
+ protected SpawnableCullingParent(BaseCullingParent cullingBase)
+ {
+ Dictionary.Add(cullingBase, this);
+ Base = cullingBase;
+ }
+
+ ///
+ /// The base object.
+ ///
+ public BaseCullingParent Base { get; }
+
+ ///
+ /// The .
+ ///
+ public GameObject GameObject => Base.gameObject;
+
+ ///
+ /// The culling parent's .
+ ///
+ public Transform Transform => Base.transform;
+
+ ///
+ /// Whether the was destroyed.
+ ///
+ ///
+ /// A destroyed object may not be used.
+ ///
+ public bool IsDestroyed => Base == null;
+
+ ///
+ /// Gets or sets the position of the culling parent.
+ ///
+ public Vector3 Position
+ {
+ get => Base.NetworkBoundsPosition;
+ set => Base.NetworkBoundsPosition = value;
+ }
+
+ ///
+ /// Gets or sets the culling bound size of the culling parent.
+ ///
+ public Vector3 Size
+ {
+ get => Base.NetworkBoundsSize;
+ set => Base.NetworkBoundsSize = value;
+ }
+
+ ///
+ /// Spawns the culling parent on client.
+ ///
+ public void Spawn() => NetworkServer.Spawn(GameObject);
+
+ ///
+ /// Destroys the culling parent on server and client.
+ ///
+ public void Destroy() => NetworkServer.Destroy(GameObject);
+}
\ No newline at end of file
diff --git a/LabApi/Features/Wrappers/AdminToys/SpeakerToy.cs b/LabApi/Features/Wrappers/AdminToys/SpeakerToy.cs
index 78c280d5..9abdb733 100644
--- a/LabApi/Features/Wrappers/AdminToys/SpeakerToy.cs
+++ b/LabApi/Features/Wrappers/AdminToys/SpeakerToy.cs
@@ -10,21 +10,135 @@
namespace LabApi.Features.Wrappers;
///
-/// Wrapper for the class
+/// Wrapper for the class.
///
public class SpeakerToy : AdminToy
{
+ private static readonly Dictionary TransmitterByControllerId = [];
+
///
/// Contains all the speaker toys, accessible through their .
///
- public new static Dictionary Dictionary { get; } = [];
+ public static new Dictionary Dictionary { get; } = [];
///
/// A reference to all instances of .
///
- public new static IReadOnlyCollection List => Dictionary.Values;
+ public static new IReadOnlyCollection List => Dictionary.Values;
- private static readonly Dictionary TransmitterByControllerId = [];
+ ///
+ /// Plays the PCM samples on the current controller.
+ ///
+ ///
+ /// Samples are played at a sample rate of , mono channel (non interleaved data) with ranges from -1.0f to 1.0f.
+ ///
+ /// The Id of the controller to play audio on.
+ /// The PCM samples.
+ /// Whether to queue the audio if audio is already playing, otherwise overrides the current audio.
+ ///
+ /// Whether to loop this clip.
+ /// Loop ends if another clip is played either immediately if not queued or at the end of the loop if next clip was queued.
+ ///
+ public static void Play(byte controllerId, float[] samples, bool queue = true, bool loop = false)
+ => GetTransmitter(controllerId).Play(samples, queue, loop);
+
+ ///
+ /// The Id of the controller to play audio on.
+ public static void Pause(byte controllerId) => GetTransmitter(controllerId).Pause();
+
+ ///
+ /// The Id of the controller to play audio on.
+ public static void Resume(byte controllerId) => GetTransmitter(controllerId).Resume();
+
+ ///
+ /// Skips the current or queued clips.
+ /// Includes the current clip.
+ ///
+ /// The Id of the controller to play audio on.
+ /// The number of queued audios clips to skip.
+ public static void Skip(byte controllerId, int count) => GetTransmitter(controllerId).Skip(count);
+
+ ///
+ /// The Id of the controller to play audio on.
+ public static void Stop(byte controllerId) => GetTransmitter(controllerId).Stop();
+
+ ///
+ public static SpeakerToy Create(Transform? parent = null, bool networkSpawn = true)
+ => Create(Vector3.zero, parent, networkSpawn);
+
+ ///
+ public static SpeakerToy Create(Vector3 position, Transform? parent = null, bool networkSpawn = true)
+ => Create(position, Quaternion.identity, parent, networkSpawn);
+
+ ///
+ public static SpeakerToy Create(Vector3 position, Quaternion rotation, Transform? parent = null, bool networkSpawn = true)
+ => Create(position, rotation, Vector3.one, parent, networkSpawn);
+
+ ///
+ /// Creates a new speaker toy.
+ ///
+ /// The initial local position.
+ /// The initial local rotation.
+ /// The initial local scale.
+ /// The parent transform.
+ /// Whether to spawn the toy on the client.
+ /// The created speaker toy.
+ public static SpeakerToy Create(Vector3 position, Quaternion rotation, Vector3 scale, Transform? parent = null, bool networkSpawn = true)
+ {
+ SpeakerToy toy = Get(Create(position, rotation, scale, parent));
+
+ if (networkSpawn)
+ {
+ toy.Spawn();
+ }
+
+ return toy;
+ }
+
+ ///
+ /// Gets the speaker toy wrapper from the or creates a new one if it doesn't exist and the provided was not .
+ ///
+ /// The of the speaker toy.
+ /// The requested speaker toy or .
+ [return: NotNullIfNotNull(nameof(baseSpeakerToy))]
+ public static SpeakerToy? Get(BaseSpeakerToy? baseSpeakerToy)
+ {
+ if (baseSpeakerToy == null)
+ {
+ return null;
+ }
+
+ return Dictionary.TryGetValue(baseSpeakerToy, out SpeakerToy toy) ? toy : (SpeakerToy)CreateAdminToyWrapper(baseSpeakerToy);
+ }
+
+ ///
+ /// Tries to get the speaker toy wrapper from the .
+ ///
+ /// The of the speaker toy.
+ /// The requested speaker toy.
+ /// if the speaker exists, otherwise .
+ public static bool TryGet(BaseSpeakerToy? baseSpeakerToy, [NotNullWhen(true)] out SpeakerToy? speakerToy)
+ {
+ speakerToy = Get(baseSpeakerToy);
+ return speakerToy != null;
+ }
+
+ ///
+ /// Gets the for the .
+ /// If one does not exists, a new one is created for the id.
+ ///
+ /// The for the transmitter.
+ /// Cached transmitter.
+ public static AudioTransmitter GetTransmitter(byte controllerId)
+ {
+ if (!TransmitterByControllerId.TryGetValue(controllerId, out AudioTransmitter transmitter))
+ {
+ transmitter = new(controllerId);
+ TransmitterByControllerId.Add(controllerId, transmitter);
+ }
+
+ return transmitter;
+ }
///
/// An internal constructor to prevent external instantiation.
@@ -33,17 +147,12 @@ public class SpeakerToy : AdminToy
internal SpeakerToy(BaseSpeakerToy baseSpeakerToy)
: base(baseSpeakerToy)
{
- Dictionary.Add(baseSpeakerToy, this);
Base = baseSpeakerToy;
- }
- ///
- /// An internal method to remove itself from the cache when the base object is destroyed.
- ///
- internal override void OnRemove()
- {
- base.OnRemove();
- Dictionary.Remove(Base);
+ if (CanCache)
+ {
+ Dictionary.Add(baseSpeakerToy, this);
+ }
}
///
@@ -178,7 +287,7 @@ public Func? ValidPlayers
}
///
- /// Gets the audio transmitter for this speakers .
+ /// Gets the audio transmitter for this speakers .
///
///
/// Speakers can share instances if they have the same .
@@ -208,112 +317,11 @@ public override string ToString()
}
///
- /// Plays the PCM samples on the current controller.
- ///
- ///
- /// Samples are played at a sample rate of , mono channel (non interleaved data) with ranges from -1.0f to 1.0f.
- ///
- /// The Id of the controller to play audio on.
- /// The PCM samples.
- /// Whether to queue the audio if audio is already playing, otherwise overrides the current audio.
- ///
- /// Whether to loop this clip.
- /// Loop ends if another clip is played either immediately if not queued or at the end of the loop if next clip was queued.
- ///
- public static void Play(byte controllerId, float[] samples, bool queue = true, bool loop = false)
- => GetTransmitter(controllerId).Play(samples, queue, loop);
-
- ///
- /// The Id of the controller to play audio on.
- public static void Pause(byte controllerId) => GetTransmitter(controllerId).Pause();
-
- ///
- /// The Id of the controller to play audio on.
- public static void Resume(byte controllerId) => GetTransmitter(controllerId).Resume();
-
- ///
- /// Skips the current or queued clips.
- /// Includes the current clip.
- ///
- /// The Id of the controller to play audio on.
- /// The number of queued audios clips to skip.
- public static void Skip(byte controllerId, int count) => GetTransmitter(controllerId).Skip(count);
-
- ///
- /// The Id of the controller to play audio on.
- public static void Stop(byte controllerId) => GetTransmitter(controllerId).Stop();
-
- ///
- public static SpeakerToy Create(Transform? parent = null, bool networkSpawn = true)
- => Create(Vector3.zero, parent, networkSpawn);
-
- ///
- public static SpeakerToy Create(Vector3 position, Transform? parent = null, bool networkSpawn = true)
- => Create(position, Quaternion.identity, parent, networkSpawn);
-
- ///
- public static SpeakerToy Create(Vector3 position, Quaternion rotation, Transform? parent = null, bool networkSpawn = true)
- => Create(position, rotation, Vector3.one, parent, networkSpawn);
-
- ///
- /// Creates a new speaker toy.
- ///
- /// The initial local position.
- /// The initial local rotation.
- /// The initial local scale.
- /// The parent transform.
- /// Whether to spawn the toy on the client.
- /// The created speaker toy.
- public static SpeakerToy Create(Vector3 position, Quaternion rotation, Vector3 scale, Transform? parent = null, bool networkSpawn = true)
- {
- SpeakerToy toy = Get(Create(position, rotation, scale, parent));
-
- if (networkSpawn)
- toy.Spawn();
-
- return toy;
- }
-
- ///
- /// Gets the speaker toy wrapper from the or creates a new one if it doesn't exist and the provided was not .
- ///
- /// The of the speaker toy.
- /// The requested speaker toy or .
- [return: NotNullIfNotNull(nameof(baseSpeakerToy))]
- public static SpeakerToy? Get(BaseSpeakerToy? baseSpeakerToy)
- {
- if (baseSpeakerToy == null)
- return null;
-
- return Dictionary.TryGetValue(baseSpeakerToy, out SpeakerToy toy) ? toy : (SpeakerToy)CreateAdminToyWrapper(baseSpeakerToy);
- }
-
- ///
- /// Tries to get the speaker toy wrapper from the .
- ///
- /// The of the speaker toy.
- /// The requested speaker toy.
- /// if the speaker exists, otherwise .
- public static bool TryGet(BaseSpeakerToy? baseSpeakerToy, [NotNullWhen(true)] out SpeakerToy? speakerToy)
- {
- speakerToy = Get(baseSpeakerToy);
- return speakerToy != null;
- }
-
- ///
- /// Gets the for the .
- /// If one does not exists, a new one is created for the id.
+ /// An internal method to remove itself from the cache when the base object is destroyed.
///
- /// The for the transmitter.
- ///
- public static AudioTransmitter GetTransmitter(byte controllerId)
+ internal override void OnRemove()
{
- if (!TransmitterByControllerId.TryGetValue(controllerId, out AudioTransmitter transmitter))
- {
- transmitter = new(controllerId);
- TransmitterByControllerId.Add(controllerId, transmitter);
- }
-
- return transmitter;
+ base.OnRemove();
+ Dictionary.Remove(Base);
}
}
diff --git a/LabApi/Features/Wrappers/AdminToys/TextToy.cs b/LabApi/Features/Wrappers/AdminToys/TextToy.cs
index f2469f5e..0e628b4d 100644
--- a/LabApi/Features/Wrappers/AdminToys/TextToy.cs
+++ b/LabApi/Features/Wrappers/AdminToys/TextToy.cs
@@ -8,67 +8,19 @@ namespace LabApi.Features.Wrappers;
///
/// The wrapper for the class.
-/// Toy with changable text and formatting arguments.
+/// Toy with changeable text and formatting arguments.
///
public class TextToy : AdminToy
{
///
/// Contains all the text toys, accessible through their .
///
- public new static Dictionary Dictionary { get; } = [];
+ public static new Dictionary Dictionary { get; } = [];
///
/// A reference to all instances of .
///
- public new static IReadOnlyCollection List => Dictionary.Values;
-
- ///
- /// An internal constructor to prevent external instantiation.
- ///
- /// The base object.
- internal TextToy(BaseTextToy baseToy) : base(baseToy)
- {
- Base = baseToy;
- }
-
- ///
- /// An internal method to remove itself from the cache when the base object is destroyed.
- ///
- internal override void OnRemove()
- {
- base.OnRemove();
- Dictionary.Remove(Base);
- }
-
- ///
- /// The object.
- ///
- public new BaseTextToy Base { get; }
-
- ///
- /// Gets or sets the base text format used when formatting the final text string.
- /// Text can be formatted and arguments are replaced with .
- ///
- public string TextFormat
- {
- get => Base.TextFormat;
- set => Base.TextFormat = value;
- }
-
- ///
- /// Gets or sets the size of text display used by TMP.
- ///
- public Vector2 DisplaySize
- {
- get => Base.DisplaySize;
- set => Base.DisplaySize = value;
- }
-
- ///
- /// Gets the arguments used while formatting the .
- /// Missing arguments for are not replaced and any extra arguments are ignored.
- ///
- public SyncList Arguments => Base.Arguments;
+ public static new IReadOnlyCollection List => Dictionary.Values;
///
public static TextToy Create(Transform? parent = null, bool networkSpawn = true)
@@ -96,7 +48,9 @@ public static TextToy Create(Vector3 position, Quaternion rotation, Vector3 scal
TextToy toy = Get(Create(position, rotation, scale, parent));
if (networkSpawn)
+ {
toy.Spawn();
+ }
return toy;
}
@@ -110,7 +64,9 @@ public static TextToy Create(Vector3 position, Quaternion rotation, Vector3 scal
public static TextToy? Get(BaseTextToy? baseTextToy)
{
if (baseTextToy == null)
+ {
return null;
+ }
return Dictionary.TryGetValue(baseTextToy, out TextToy item) ? item : (TextToy)CreateAdminToyWrapper(baseTextToy);
}
@@ -126,4 +82,58 @@ public static bool TryGet(BaseTextToy? baseTextToy, [NotNullWhen(true)] out Text
textToy = Get(baseTextToy);
return textToy != null;
}
+
+ ///
+ /// An internal constructor to prevent external instantiation.
+ ///
+ /// The base object.
+ internal TextToy(BaseTextToy baseToy)
+ : base(baseToy)
+ {
+ Base = baseToy;
+
+ if (CanCache)
+ {
+ Dictionary.Add(baseToy, this);
+ }
+ }
+
+ ///
+ /// The object.
+ ///
+ public new BaseTextToy Base { get; }
+
+ ///
+ /// Gets or sets the base text format used when formatting the final text string.
+ /// Text can be formatted and arguments are replaced with .
+ ///
+ public string TextFormat
+ {
+ get => Base.TextFormat;
+ set => Base.TextFormat = value;
+ }
+
+ ///
+ /// Gets or sets the size of text display used by TMP.
+ ///
+ public Vector2 DisplaySize
+ {
+ get => Base.DisplaySize;
+ set => Base.DisplaySize = value;
+ }
+
+ ///
+ /// Gets the arguments used while formatting the .
+ /// Missing arguments for are not replaced and any extra arguments are ignored.
+ ///
+ public SyncList Arguments => Base.Arguments;
+
+ ///
+ /// An internal method to remove itself from the cache when the base object is destroyed.
+ ///
+ internal override void OnRemove()
+ {
+ base.OnRemove();
+ Dictionary.Remove(Base);
+ }
}
diff --git a/LabApi/Features/Wrappers/AdminToys/WaypointToy.cs b/LabApi/Features/Wrappers/AdminToys/WaypointToy.cs
new file mode 100644
index 00000000..ff8733cd
--- /dev/null
+++ b/LabApi/Features/Wrappers/AdminToys/WaypointToy.cs
@@ -0,0 +1,207 @@
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using UnityEngine;
+using BaseWaypointToy = AdminToys.WaypointToy;
+
+namespace LabApi.Features.Wrappers;
+
+///
+/// Wrapper for the class.
+///
+public class WaypointToy : AdminToy
+{
+ ///
+ /// Max distance in meters a waypoint can encapsulate along any dimension.
+ ///
+ public const float MaxBounds = BaseWaypointToy.MaxBounds;
+
+ ///
+ /// Contains all the waypoint toys, accessible through their .
+ ///
+ public static new Dictionary Dictionary { get; } = [];
+
+ ///
+ /// A reference to all instances of .
+ ///
+ public static new IReadOnlyCollection List => Dictionary.Values;
+
+ ///
+ public static WaypointToy Create(Transform? parent = null, bool networkSpawn = true)
+ => Create(Vector3.zero, parent, networkSpawn);
+
+ ///
+ public static WaypointToy Create(Vector3 position, Transform? parent = null, bool networkSpawn = true)
+ => Create(position, Quaternion.identity, parent, networkSpawn);
+
+ ///
+ public static WaypointToy Create(Vector3 position, Quaternion rotation, Transform? parent = null, bool networkSpawn = true)
+ => Create(position, rotation, Vector3.one, parent, networkSpawn);
+
+ ///
+ /// Creates a new waypoint toy.
+ ///
+ /// The initial local position.
+ /// The initial local rotation.
+ /// The initial local scale.
+ /// The parent transform.
+ /// Whether to spawn the toy on the client.
+ /// The created waypoint toy.
+ public static WaypointToy Create(Vector3 position, Quaternion rotation, Vector3 scale, Transform? parent = null, bool networkSpawn = true)
+ {
+ WaypointToy toy = Get(Create(position, rotation, scale, parent));
+
+ if (networkSpawn)
+ {
+ toy.Spawn();
+ }
+
+ return toy;
+ }
+
+ ///
+ /// Gets the waypoint toy wrapper from the or creates a new one if it doesn't exist and the provided was not .
+ ///
+ /// The of the waypoint toy.
+ /// The requested waypoint toy or .
+ [return: NotNullIfNotNull(nameof(baseWaypointToy))]
+ public static WaypointToy? Get(BaseWaypointToy? baseWaypointToy)
+ {
+ if (baseWaypointToy == null)
+ {
+ return null;
+ }
+
+ return Dictionary.TryGetValue(baseWaypointToy, out WaypointToy item) ? item : (WaypointToy)CreateAdminToyWrapper(baseWaypointToy);
+ }
+
+ ///
+ /// Tries to get the waypoint toy wrapper from the .
+ ///
+ /// The of the waypoint toy.
+ /// The requested waypoint toy.
+ /// if the waypoint exists, otherwise .
+ public static bool TryGet(BaseWaypointToy? baseWaypointToy, [NotNullWhen(true)] out WaypointToy? waypointToy)
+ {
+ waypointToy = Get(baseWaypointToy);
+ return waypointToy != null;
+ }
+
+ ///
+ /// An internal constructor to prevent external instantiation.
+ ///
+ /// The base object.
+ internal WaypointToy(BaseWaypointToy baseWaypointToy)
+ : base(baseWaypointToy)
+ {
+ Dictionary.Add(baseWaypointToy, this);
+ Base = baseWaypointToy;
+ }
+
+ ///
+ /// The object.
+ ///
+ public new BaseWaypointToy Base { get; }
+
+ ///
+ public override Vector3 Position
+ {
+ get => base.Position;
+ set
+ {
+ base.Position = value;
+ Base.UpdateWaypointChildren();
+ }
+ }
+
+ ///
+ public override Quaternion Rotation
+ {
+ get => base.Rotation;
+ set
+ {
+ base.Rotation = value;
+ Base.UpdateWaypointChildren();
+ }
+ }
+
+ ///
+ /// Gets or sets the scale on the waypoint toy.
+ /// Does not effect the bounds of the waypoint, use instead.
+ ///
+ ///
+ /// Scale can cause unindented side effects when used on a waypoint toy.
+ ///
+ public override Vector3 Scale
+ {
+ get => base.Scale;
+ set
+ {
+ base.Scale = value;
+
+ if (value != Vector3.one)
+ {
+ Console.Logger.Warn("Setting scale on WaypointToy is not supported and may cause problems.");
+ }
+ }
+ }
+
+ ///
+ /// Bounds the waypoint encapsulates along each dimension in meters.
+ /// Bounds is effected by position and rotation of the GameObject but not its scale.
+ /// Must not exceed Vector3.one * MaxBounds.
+ ///
+ ///
+ /// When is rotation and is not used, instead the bounds is axis aligned and its size is fixed at .
+ ///
+ public Vector3 BoundsSize
+ {
+ get => Base.BoundsSize;
+ set => Base.NetworkBoundsSize = value;
+ }
+
+ ///
+ /// Gets or sets whether to visualize the waypoint's maximum bounds.
+ ///
+ public bool VisualizeBounds
+ {
+ get => Base.VisualizeBounds;
+ set => Base.NetworkVisualizeBounds = value;
+ }
+
+ ///
+ /// Gets or sets how many meters to bias towards this waypoint.
+ ///
+ ///
+ /// The closest waypoint is determined by its square distance.
+ /// When set this takes away (Priority * Priority) from the sqr distance.
+ ///
+ public float PriorityBias
+ {
+ get => Base.Priority;
+ set => Base.NetworkPriority = value;
+ }
+
+ ///
+ /// Force update all waypoint children to be up to date with the current position and rotation of the waypoint.
+ /// Call this when ever the waypoint is moved by a parent object or the waypoint is moved using base game APIs or external APIs.
+ ///
+ ///
+ /// Does not work if the waypoint is .
+ ///
+ public void UpdateWaypointChildren() => Base.UpdateWaypointChildren();
+
+ ///
+ public override string ToString()
+ {
+ return $"[WaypointToy: Position:{Position}, BoundsSize:{BoundsSize}, VisualizeBounds:{VisualizeBounds}, PriorityBias:{PriorityBias}]";
+ }
+
+ ///
+ /// An internal method to remove itself from the cache when the base object is destroyed.
+ ///
+ internal override void OnRemove()
+ {
+ base.OnRemove();
+ Dictionary.Remove(Base);
+ }
+}
diff --git a/LabApi/Features/Wrappers/Facility/Announcer.cs b/LabApi/Features/Wrappers/Facility/Announcer.cs
new file mode 100644
index 00000000..628dc96e
--- /dev/null
+++ b/LabApi/Features/Wrappers/Facility/Announcer.cs
@@ -0,0 +1,277 @@
+using Cassie;
+using Cassie.Interpreters;
+using NorthwoodLib.Pools;
+using PlayerRoles;
+using PlayerStatsSystem;
+using Respawning.NamingRules;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace LabApi.Features.Wrappers;
+
+///
+/// The wrapper for in game CASSIE announcer.
+///
+public static class Announcer
+{
+ ///
+ /// Gets whether CASSIE is currently speaking.
+ ///
+ public static bool IsSpeaking
+ => CassieAnnouncementDispatcher.CurrentAnnouncement != null;
+
+ ///
+ /// Gets the line database for CASSIE.
+ ///
+ public static CassieLineDatabase? LineDatabase
+ => !CassieTtsAnnouncer.TryGetDatabase(out CassieLineDatabase db) ? null : db;
+
+ ///
+ /// Gets all available voice lines for CASSIE.
+ ///
+ public static CassieLine[] AllLines
+ => LineDatabase ? LineDatabase.AllLines : [];
+
+ ///
+ /// Gets all collection names in which voice lines are in.
+ ///
+ public static string[] CollectionNames
+ => AllLines.Select(static line => line.ApiName).Distinct().ToArray();
+
+ ///
+ /// Checks whether a specified word is valid for CASSIE.
+ /// String comparison is case-insensitive.
+ ///
+ /// The word to check.
+ /// Whether the word is valid.
+ public static bool IsValid(string word)
+ => CollectionNames.Any(line => line.Equals(word, StringComparison.InvariantCultureIgnoreCase));
+
+ ///
+ /// Calculates duration of specific message.
+ ///
+ /// The message.
+ /// Raw numbers.
+ /// The speed of the cassie talking.
+ /// Duration of the specific message in seconds.
+ [Obsolete("Use CalculateDuration(string message, CassiePlaybackModifiers playbackModifiers) instead.", true)]
+ public static float CalculateDuration(string message, bool rawNumber = false, float speed = 1f)
+ {
+ CassiePlaybackModifiers playbackModifiers = new()
+ {
+ Pitch = speed,
+ };
+ return (float)CalculateDuration(message, playbackModifiers);
+ }
+
+ ///
+ /// Calculates duration of specific message.
+ ///
+ /// The message.
+ /// The playback modifier.
+ /// Duration of the specific message in seconds.
+ public static double CalculateDuration(string message, CassiePlaybackModifiers playbackModifiers)
+ {
+ CalculateDuration(message, playbackModifiers, out double time);
+ return time;
+ }
+
+ ///
+ /// Queues a custom announcement.
+ ///
+ /// The sentence CASSIE is supposed to say.
+ /// Sets a minimal 3-second moment of silence before the announcement. For most cases you wanna keep it true.
+ /// Whether the background noises play.
+ /// Show subtitles.
+ /// Custom subtitles to appear instead of the actual message.
+ [Obsolete("Use Message(string message, string customSubtitles = \"\", bool playBackground = true, float priority = 0f, float glitchScale = 1f) instead.", true)]
+ public static void Message(string message, bool isHeld = false, bool isNoisy = true, bool isSubtitles = true, string customSubtitles = "")
+ => Message(message, customSubtitles);
+
+ ///
+ /// Queues a custom announcement.
+ ///
+ /// The sentence CASSIE is supposed to say.
+ /// Custom subtitles to play.
+ /// Should play the background track (bells, noise).
+ /// The priority of this message. The higher the value, the earlier it will be dequeued compared to lower-priority announcements.
+ /// Intensity of glitches and stutters added before sending to clients.
+ public static void Message(string message, string customSubtitles = "", bool playBackground = true, float priority = 0f, float glitchScale = 1f)
+ {
+ CassieTtsPayload payload = new(message, customSubtitles, playBackground);
+ Message(payload, priority, glitchScale);
+ }
+
+ ///
+ /// Queues an cassie payload announcement.
+ ///
+ /// The payload to sent.
+ /// The priority of this message. The higher the value, the earlier it will be dequeued compared to lower-priority announcements.
+ /// Intensity of glitches and stutters added before sending to clients. Range from 0f to 1f.
+ public static void Message(CassieTtsPayload payload, float priority = 0f, float glitchScale = 1f)
+ {
+ CassieAnnouncement announcement = new(payload, priority, glitchScale);
+ CassieAnnouncementDispatcher.AddToQueue(announcement);
+ }
+
+ ///
+ /// Plays the custom announcement with chance of 0f to 1f of adding a glitch or jam before each word. Values closer to 1f are higher chances.
+ ///
+ /// The sentence CASSIE is supposed to say.
+ /// The chance for glitch sound to be added before each word. Range from 0f to 1f.
+ /// The chance for jam sound to be added before each word. Range from 0f to 1f.
+ public static void GlitchyMessage(string message, float glitchChance, float jamChance)
+ {
+ message = CassieGlitchifier.Glitchify(message, glitchChance, jamChance);
+ Message(message, string.Empty, true, 0f, 0f);
+ }
+
+ ///
+ /// Plays the termination announcement of a SCP player. If the specified player does not have an SCP role then nothing is played.
+ ///
+ /// The player who is being terminated as an SCP.
+ /// Damage handler causing the death of the player.
+ public static void ScpTermination(Player player, DamageHandlerBase info)
+ => CassieScpTerminationAnnouncement.AnnounceScpTermination(player.ReferenceHub, info);
+
+ ///
+ /// Clears the CASSIE announcements queue.
+ ///
+ public static void Clear()
+ => CassieAnnouncementDispatcher.ClearAll();
+
+ ///
+ /// Converts player's team into CASSIE-able word. Unit names are converted into NATO_X words, followed by a number. For example "Alpha-5" is converted to "NATO_A 5".
+ ///
+ /// Target team.
+ /// MTF Unit name (for team ).
+ /// Converted name.
+ public static string ConvertTeam(Team team, string unitName)
+ {
+ string text = "CONTAINMENTUNIT UNKNOWN";
+ switch (team)
+ {
+ case Team.FoundationForces:
+ {
+ if (!NamingRulesManager.TryGetNamingRule(team, out UnitNamingRule unitNamingRule))
+ {
+ return text;
+ }
+
+ string text2 = unitNamingRule.TranslateToCassie(unitName);
+ return "CONTAINMENTUNIT " + text2;
+ }
+
+ case Team.ChaosInsurgency:
+ return "CHAOSINSURGENCY";
+ case Team.Scientists:
+ return "SCIENCE PERSONNEL";
+ case Team.ClassD:
+ return "CLASSD PERSONNEL";
+ default:
+ return text;
+ }
+ }
+
+ ///
+ /// Converts number into string.
+ ///
+ /// The number.
+ /// Number converted to string.
+ public static string ConvertNumber(int num)
+ {
+ if (LineDatabase == null)
+ {
+ return string.Empty;
+ }
+
+ NumberInterpreter? numberInterpreter = (NumberInterpreter?)CassieTtsAnnouncer.Interpreters.FirstOrDefault(x => x is NumberInterpreter);
+ if (numberInterpreter == null)
+ {
+ return string.Empty;
+ }
+
+ string word = num.ToString();
+
+ CassiePlaybackModifiers cassiePlaybackModifiers = default;
+ StringBuilder sb = StringBuilderPool.Shared.Rent();
+ numberInterpreter.GetResults(LineDatabase, ref cassiePlaybackModifiers, word, sb, out bool halt);
+
+ return StringBuilderPool.Shared.ToStringReturn(sb);
+ }
+
+ ///
+ /// Converts player's into an SCP number identifier.
+ ///
+ /// The target .
+ /// The SCP number without spaces between. Used by CASSIE.
+ /// The SCP number with spaces between. Used by Subtitles.
+ public static void ConvertScp(RoleTypeId role, out string withoutSpace, out string withSpace)
+ => CassieScpTerminationAnnouncement.ConvertSCP(role, out withoutSpace, out withSpace);
+
+ ///
+ /// Converts player's role name into an SCP number identifier.
+ ///
+ /// The targets role name.
+ /// The SCP number without spaces between. Used by CASSIE.
+ /// The SCP number with spaces between. Used by Subtitles.
+ public static void ConvertScp(string roleName, out string withoutSpace, out string withSpace)
+ => CassieScpTerminationAnnouncement.ConvertSCP(roleName, out withoutSpace, out withSpace);
+
+ ///
+ /// Calculates duration of message.
+ ///
+ /// The remaining message.
+ /// The playback modifier.
+ /// The duration of the message.
+ public static void CalculateDuration(string remaining, CassiePlaybackModifiers modifiers, out double time)
+ => CalculateDuration(remaining.AsSpan(), modifiers, out time);
+
+ ///
+ /// Calculates duration of message.
+ ///
+ /// The remaining message.
+ /// The playback modifier.
+ /// The duration of the message.
+ public static void CalculateDuration(ReadOnlySpan remaining, CassiePlaybackModifiers modifiers, out double time)
+ {
+ time = 0;
+
+ if (LineDatabase == null)
+ {
+ return;
+ }
+
+ int index = remaining.IndexOf(' ');
+
+ StringBuilder sb = StringBuilderPool.Shared.Rent();
+
+ ReadOnlySpan word = index < 0 ? remaining : remaining[..index];
+
+ foreach (CassieInterpreter inter in CassieTtsAnnouncer.Interpreters)
+ {
+ List results = inter.GetResults(LineDatabase, ref modifiers, word, sb, out bool jobDone);
+
+ time += results.Sum(static result => result.Modifiers.GetTimeUntilNextWord(result.Line));
+
+ if (jobDone)
+ {
+ // The interpreter claims there's no need to process the word by other interpreters.
+ break;
+ }
+ }
+
+ StringBuilderPool.Shared.Return(sb);
+
+ if (index < 0)
+ {
+ return;
+ }
+
+ remaining = remaining[(index + 1)..];
+ CalculateDuration(remaining, modifiers, out double timeOut);
+ time += timeOut;
+ }
+}
\ No newline at end of file
diff --git a/LabApi/Features/Wrappers/Facility/Cassie.cs b/LabApi/Features/Wrappers/Facility/Cassie.cs
index 79d267e8..e9319d71 100644
--- a/LabApi/Features/Wrappers/Facility/Cassie.cs
+++ b/LabApi/Features/Wrappers/Facility/Cassie.cs
@@ -1,106 +1,101 @@
-using PlayerRoles;
+using Cassie;
+using PlayerRoles;
using PlayerStatsSystem;
-using Respawning;
using System;
-using System.Linq;
-using static NineTailedFoxAnnouncer;
namespace LabApi.Features.Wrappers;
-///
-/// The wrapper for in game Cassie announcer.
-///
+///
+[Obsolete("Use Announcer instead of Cassie.", true)]
public static class Cassie
{
- ///
- /// Gets whether Cassie is currently speaking.
- ///
- public static bool IsSpeaking => singleton.queue.Count != 0;
-
- ///
- /// Gets all available voice lines for Cassie.
- ///
- public static VoiceLine[] AllLines => singleton.voiceLines;
-
- ///
- /// Gets all collection names in which voicelines are in.
- ///
- public static string[] CollectionNames => singleton.voiceLines.Select(n => n.collection).Distinct().ToArray();
-
- ///
- /// Checks whether a specified word is valid for cassie.
- /// String comparison is case-insensitive.
- ///
- /// The word to check.
- /// Whether the word is valid.
- public static bool IsValid(string word) => singleton.voiceLines.Any(line => line.apiName.Equals(word, StringComparison.InvariantCultureIgnoreCase));
-
- ///
- /// Calculates duration of specific message.
- ///
- /// The message.
- /// Raw numbers.
- /// Duration of the specific message in seconds.
- public static float CalculateDuration(string message, bool rawNumber = false, float speed = 1f) => singleton.CalculateDuration(message, rawNumber, speed);
-
- ///
- /// Plays a custom announcement.
- ///
- /// The sentence Cassie is supposed to say.
- /// Sets a minimal 3-second moment of silence before the announcement. For most cases you wanna keep it true.
- /// Whether the background noises play.
- /// Show subtitles.
- /// Custom subtitles to appear instead of the actual message.
- public static void Message(string message, bool isHeld = false, bool isNoisy = true, bool isSubtitles = true, string customSubtitles = "") => RespawnEffectsController.PlayCassieAnnouncement(message, isHeld, isNoisy, isSubtitles, customSubtitles);
-
- ///
- /// Plays the custom announcement with chance of 0f to 1f of adding a glitch or jam before each word. Values closer to 1f are higher chances.
- ///
- /// The sentence Cassie is supposed to say.
- /// The chance for glitch sound to be added before each word. Range from 0f to 1f.
- /// The chance for jam sound to be added before each word. Range from 0f to 1f.
- public static void GlitchyMessage(string message, float glitchChance, float jamChance) => singleton.ServerOnlyAddGlitchyPhrase(message, glitchChance, jamChance);
-
- ///
- /// Plays the termination announcement of a SCP player. If the specified player does not have an SCP role then nothing is played.
- ///
- /// The player who is being terminated as an SCP.
- /// Damage handler causing the death of the player.
- public static void ScpTermination(Player player, DamageHandlerBase info) => AnnounceScpTermination(player.ReferenceHub, info);
-
- ///
- /// Clears the Cassie announcements queue.
- ///
- public static void Clear() => singleton.ClearQueue();
-
- ///
- /// Converts player's team into Cassie-able word. Unit names are converted into NATO_X words, followed by a number. For example "Alpha-5" is converted to "NATO_A 5".
- ///
- /// Target team.
- /// MTF Unit name (for team ).
- /// Converted name.
- public static string ConvertTeam(Team team, string unitName) => NineTailedFoxAnnouncer.ConvertTeam(team, unitName);
-
- ///
- /// Converts number into string.
- ///
- /// The number.
- /// Number converted to string.
- public static string ConvertNumber(int num) => NineTailedFoxAnnouncer.ConvertNumber(num);
-
- ///
- /// Converts player's into an SCP number identifier.
- ///
- /// The target .
- /// The SCP number without spaces between. Used by Cassie.
- /// The SCP number with spaces between. Used by Subtitles.
- public static void ConvertScp(RoleTypeId role, out string withoutSpace, out string withSpace) => NineTailedFoxAnnouncer.ConvertSCP(role, out withoutSpace, out withSpace);
-
- ///
- /// Converts player's role name into an SCP number identifier.
- ///
- /// The targets role name
- /// The SCP number without spaces between. Used by Cassie.
- /// The SCP number with spaces between. Used by Subtitles.
- public static void ConvertScp(string roleName, out string withoutSpace, out string withSpace) => NineTailedFoxAnnouncer.ConvertSCP(roleName, out withoutSpace, out withSpace);
+ ///
+ [Obsolete("Use Announcer.IsSpeaking instead.", true)]
+ public static bool IsSpeaking
+ => Announcer.IsSpeaking;
+
+ ///
+ [Obsolete("Use Announcer.LineDatabase instead.", true)]
+ public static CassieLineDatabase? LineDatabase
+ => Announcer.LineDatabase;
+
+ ///
+ [Obsolete("Use Announcer.AllLines instead.", true)]
+ public static CassieLine[] AllLines
+ => Announcer.AllLines;
+
+ ///
+ [Obsolete("Use Announcer.CollectionNames instead.", true)]
+ public static string[] CollectionNames
+ => Announcer.CollectionNames;
+
+ ///
+ [Obsolete("Use Announcer.IsValid(string) instead.", true)]
+ public static bool IsValid(string word)
+ => Announcer.IsValid(word);
+
+ ///
+ [Obsolete("Use Announcer.CalculateDuration(string message, CassiePlaybackModifiers playbackModifiers) instead.", true)]
+ public static float CalculateDuration(string message, bool rawNumber = false, float speed = 1f)
+ => Announcer.CalculateDuration(message, rawNumber, speed);
+
+ ///
+ [Obsolete("Use Announcer.CalculateDuration(string, CassiePlaybackModifiers) instead.", true)]
+ public static double CalculateDuration(string message, CassiePlaybackModifiers playbackModifiers)
+ => Announcer.CalculateDuration(message, playbackModifiers);
+
+ ///
+ [Obsolete("Use Announcer.Message(string message, string customSubtitles = \"\", bool playBackground = true, float priority = 0f, float glitchScale = 1f) instead.", true)]
+ public static void Message(string message, bool isHeld = false, bool isNoisy = true, bool isSubtitles = true, string customSubtitles = "")
+ => Announcer.Message(message, customSubtitles);
+
+ ///
+ [Obsolete("Use Announcer.Message(string, string, bool, float, float) instead.", true)]
+ public static void Message(string message, string customSubtitles = "", bool playBackground = true, float priority = 0f, float glitchScale = 1f)
+ => Announcer.Message(message, customSubtitles, playBackground, priority, glitchScale);
+
+ ///
+ [Obsolete("Use Announcer.Message(CassieTtsPayload, float, float) instead.", true)]
+ public static void Message(CassieTtsPayload payload, float priority = 0f, float glitchScale = 1f)
+ => Announcer.Message(payload, priority, glitchScale);
+
+ ///
+ [Obsolete("Use Announcer.GlitchyMessage(string, float, float) instead.", true)]
+ public static void GlitchyMessage(string message, float glitchChance, float jamChance)
+ => Announcer.GlitchyMessage(message, glitchChance, jamChance);
+
+ ///
+ [Obsolete("Use Announcer.ScpTermination(Player, DamageHandlerBase) instead.", true)]
+ public static void ScpTermination(Player player, DamageHandlerBase info)
+ => Announcer.ScpTermination(player, info);
+
+ ///
+ [Obsolete("Use Announcer.Clear() instead.", true)]
+ public static void Clear()
+ => Announcer.Clear();
+
+ ///
+ [Obsolete("Use Announcer.ConvertTeam(Team, string) instead.", true)]
+ public static string ConvertTeam(Team team, string unitName)
+ => Announcer.ConvertTeam(team, unitName);
+
+ ///
+ [Obsolete("Use Announcer.ConvertNumber(int) instead.", true)]
+ public static string ConvertNumber(int num)
+ => Announcer.ConvertNumber(num);
+
+ ///
+ [Obsolete("Use Announcer.ConvertScp(RoleTypeId, out string, out string) instead.", true)]
+ public static void ConvertScp(RoleTypeId role, out string withoutSpace, out string withSpace)
+ => Announcer.ConvertScp(role, out withoutSpace, out withSpace);
+
+ ///
+ [Obsolete("Use Announcer.ConvertScp(string, out string, out string) instead.", true)]
+ public static void ConvertScp(string roleName, out string withoutSpace, out string withSpace)
+ => Announcer.ConvertScp(roleName, out withoutSpace, out withSpace);
+
+ ///
+ [Obsolete("Use Announcer.CalculateDuration(ReadOnlySpan{char}, CassiePlaybackModifiers, out double) instead.", true)]
+ public static void CalculateDuration(ReadOnlySpan remaining, CassiePlaybackModifiers modifiers, out double time)
+ => Announcer.CalculateDuration(remaining, modifiers, out time);
}
\ No newline at end of file
diff --git a/LabApi/Features/Wrappers/Facility/Decontamination.cs b/LabApi/Features/Wrappers/Facility/Decontamination.cs
index e752786f..5c048120 100644
--- a/LabApi/Features/Wrappers/Facility/Decontamination.cs
+++ b/LabApi/Features/Wrappers/Facility/Decontamination.cs
@@ -13,16 +13,7 @@ public static class Decontamination
public static DecontaminationStatus Status
{
get => Singleton.DecontaminationOverride;
- set
- {
- if (value == DecontaminationStatus.Forced)
- {
- Singleton.ForceDecontamination();
- return;
- }
-
- Singleton.DecontaminationOverride = value;
- }
+ set => Singleton.DecontaminationOverride = value;
}
///
@@ -31,7 +22,7 @@ public static DecontaminationStatus Status
public static bool IsDecontaminating => Singleton.IsDecontaminating;
///
- /// Gets the current server time since round has started plus the
+ /// Gets the current server time since round has started plus the .
///
public static double ServerTime => GetServerTime;
diff --git a/LabApi/Features/Wrappers/Facility/Doors/BreakableDoor.cs b/LabApi/Features/Wrappers/Facility/Doors/BreakableDoor.cs
index 03d0d0f3..47066280 100644
--- a/LabApi/Features/Wrappers/Facility/Doors/BreakableDoor.cs
+++ b/LabApi/Features/Wrappers/Facility/Doors/BreakableDoor.cs
@@ -13,12 +13,33 @@ public class BreakableDoor : Door
///
/// Contains all the cached instances, accessible through their .
///
- public new static Dictionary Dictionary { get; } = [];
+ public static new Dictionary Dictionary { get; } = [];
///
/// A reference to all instances currently in the game.
///
- public new static IReadOnlyCollection List => Dictionary.Values;
+ public static new IReadOnlyCollection List => Dictionary.Values;
+
+ ///
+ /// Gets the wrapper from the , or creates a new one if it doesn't exist.
+ ///
+ /// The of the door.
+ /// The requested door wrapper or null if the input was null.
+ [return: NotNullIfNotNull(nameof(baseBreakableDoor))]
+ public static BreakableDoor? Get(BaseBreakableDoor? baseBreakableDoor)
+ {
+ if (baseBreakableDoor == null)
+ {
+ return null;
+ }
+
+ if (Dictionary.TryGetValue(baseBreakableDoor, out BreakableDoor door))
+ {
+ return door;
+ }
+
+ return (BreakableDoor)CreateDoorWrapper(baseBreakableDoor);
+ }
///
/// An internal constructor to prevent external instantiation.
@@ -27,17 +48,12 @@ public class BreakableDoor : Door
internal BreakableDoor(BaseBreakableDoor baseBreakableDoor)
: base(baseBreakableDoor)
{
- Dictionary.Add(baseBreakableDoor, this);
Base = baseBreakableDoor;
- }
- ///
- /// An internal method to remove itself from the cache when the base object is destroyed.
- ///
- internal override void OnRemove()
- {
- base.OnRemove();
- Dictionary.Remove(Base);
+ if (CanCache)
+ {
+ Dictionary.Add(baseBreakableDoor, this);
+ }
}
///
@@ -118,19 +134,11 @@ public bool TryBreak(DoorDamageType type = DoorDamageType.ServerCommand)
public bool TryRepair() => Base.ServerRepair();
///
- /// Gets the wrapper from the , or creates a new one if it doesn't exist.
+ /// An internal method to remove itself from the cache when the base object is destroyed.
///
- /// The of the door.
- /// The requested door wrapper or null if the input was null.
- [return: NotNullIfNotNull(nameof(baseBreakableDoor))]
- public static BreakableDoor? Get(BaseBreakableDoor? baseBreakableDoor)
+ internal override void OnRemove()
{
- if (baseBreakableDoor == null)
- return null;
-
- if (Dictionary.TryGetValue(baseBreakableDoor, out BreakableDoor door))
- return door;
-
- return (BreakableDoor)CreateDoorWrapper(baseBreakableDoor);
+ base.OnRemove();
+ Dictionary.Remove(Base);
}
}
diff --git a/LabApi/Features/Wrappers/Facility/Doors/BulkheadDoor.cs b/LabApi/Features/Wrappers/Facility/Doors/BulkheadDoor.cs
index e9d46f47..e4d5edb3 100644
--- a/LabApi/Features/Wrappers/Facility/Doors/BulkheadDoor.cs
+++ b/LabApi/Features/Wrappers/Facility/Doors/BulkheadDoor.cs
@@ -13,12 +13,33 @@ public class BulkheadDoor : Gate
///
/// Contains all the cached instances, accessible through their .
///
- public new static Dictionary Dictionary { get; } = [];
+ public static new Dictionary Dictionary { get; } = [];
///
/// A reference to all instances currently in the game.
///
- public new static IReadOnlyCollection List => Dictionary.Values;
+ public static new IReadOnlyCollection List => Dictionary.Values;
+
+ ///
+ /// Gets the wrapper from the , or creates a new one if it doesn't exist.
+ ///
+ /// The of the door.
+ /// The requested door wrapper or null if the input was null.
+ [return: NotNullIfNotNull(nameof(pryableDoor))]
+ public static new BulkheadDoor? Get(PryableDoor? pryableDoor)
+ {
+ if (pryableDoor == null)
+ {
+ return null;
+ }
+
+ if (Dictionary.TryGetValue(pryableDoor, out BulkheadDoor door))
+ {
+ return door;
+ }
+
+ return (BulkheadDoor)CreateDoorWrapper(pryableDoor);
+ }
///
/// An internal constructor to prevent external instantiation.
@@ -27,20 +48,17 @@ public class BulkheadDoor : Gate
internal BulkheadDoor(PryableDoor pryableDoor)
: base(pryableDoor)
{
- Dictionary.Add(pryableDoor, this);
Base = pryableDoor;
DoorCrusherExtension extension = pryableDoor.gameObject.GetComponent();
if (extension != null)
+ {
Crusher = new DoorCrusher(extension);
- }
+ }
- ///
- /// An internal method to remove itself from the cache when the base object is destroyed.
- ///
- internal override void OnRemove()
- {
- base.OnRemove();
- Dictionary.Remove(Base);
+ if (CanCache)
+ {
+ Dictionary.Add(pryableDoor, this);
+ }
}
///
@@ -57,19 +75,11 @@ internal override void OnRemove()
public DoorCrusher? Crusher { get; }
///
- /// Gets the wrapper from the , or creates a new one if it doesn't exist.
+ /// An internal method to remove itself from the cache when the base object is destroyed.
///
- /// The of the door.
- /// The requested door wrapper or null if the input was null.
- [return: NotNullIfNotNull(nameof(pryableDoor))]
- public new static BulkheadDoor? Get(PryableDoor? pryableDoor)
+ internal override void OnRemove()
{
- if (pryableDoor == null)
- return null;
-
- if (Dictionary.TryGetValue(pryableDoor, out BulkheadDoor door))
- return door;
-
- return (BulkheadDoor)CreateDoorWrapper(pryableDoor);
+ base.OnRemove();
+ Dictionary.Remove(Base);
}
}
diff --git a/LabApi/Features/Wrappers/Facility/Doors/CheckpointDoor.cs b/LabApi/Features/Wrappers/Facility/Doors/CheckpointDoor.cs
index 4eeff4bd..d2f58955 100644
--- a/LabApi/Features/Wrappers/Facility/Doors/CheckpointDoor.cs
+++ b/LabApi/Features/Wrappers/Facility/Doors/CheckpointDoor.cs
@@ -15,12 +15,33 @@ public class CheckpointDoor : Door
///
/// Contains all the cached instances, accessible through their .
///
- public new static Dictionary Dictionary { get; } = [];
+ public static new Dictionary Dictionary { get; } = [];
///
/// A reference to all instances currently in the game.
///
- public new static IReadOnlyCollection List => Dictionary.Values;
+ public static new IReadOnlyCollection List => Dictionary.Values;
+
+ ///
+ /// Gets the wrapper from the , or creates a new one if it doesn't exist.
+ ///
+ /// The of the door.
+ /// The requested door wrapper or null if the input was null.
+ [return: NotNullIfNotNull(nameof(baseCheckpointDoor))]
+ public static CheckpointDoor? Get(BaseCheckpointDoor? baseCheckpointDoor)
+ {
+ if (baseCheckpointDoor == null)
+ {
+ return null;
+ }
+
+ if (Dictionary.TryGetValue(baseCheckpointDoor, out CheckpointDoor door))
+ {
+ return door;
+ }
+
+ return (CheckpointDoor)CreateDoorWrapper(baseCheckpointDoor);
+ }
///
/// An internal constructor to prevent external instantiation.
@@ -29,21 +50,18 @@ public class CheckpointDoor : Door
internal CheckpointDoor(BaseCheckpointDoor baseCheckpointDoor)
: base(baseCheckpointDoor)
{
- Dictionary.Add(baseCheckpointDoor, this);
Base = baseCheckpointDoor;
SubDoors = new Door[baseCheckpointDoor.SubDoors.Length];
for (int i = 0; i < baseCheckpointDoor.SubDoors.Length; i++)
+ {
SubDoors[i] = Get(baseCheckpointDoor.SubDoors[i]);
- }
+ }
- ///
- /// An internal method to remove itself from the cache when the base object is destroyed.
- ///
- internal override void OnRemove()
- {
- base.OnRemove();
- Dictionary.Remove(Base);
+ if (CanCache)
+ {
+ Dictionary.Add(baseCheckpointDoor, this);
+ }
}
///
@@ -155,19 +173,11 @@ public bool TryBreak(DoorDamageType type = DoorDamageType.ServerCommand)
=> TryDamage(float.MaxValue, type);
///
- /// Gets the wrapper from the , or creates a new one if it doesn't exist.
+ /// An internal method to remove itself from the cache when the base object is destroyed.
///
- /// The of the door.
- /// The requested door wrapper or null if the input was null.
- [return: NotNullIfNotNull(nameof(baseCheckpointDoor))]
- public static CheckpointDoor? Get(BaseCheckpointDoor? baseCheckpointDoor)
+ internal override void OnRemove()
{
- if (baseCheckpointDoor == null)
- return null;
-
- if (Dictionary.TryGetValue(baseCheckpointDoor, out CheckpointDoor door))
- return door;
-
- return (CheckpointDoor)CreateDoorWrapper(baseCheckpointDoor);
+ base.OnRemove();
+ Dictionary.Remove(Base);
}
}
diff --git a/LabApi/Features/Wrappers/Facility/Doors/Door.cs b/LabApi/Features/Wrappers/Facility/Doors/Door.cs
index 6e2c6ff5..03e8e6c5 100644
--- a/LabApi/Features/Wrappers/Facility/Doors/Door.cs
+++ b/LabApi/Features/Wrappers/Facility/Doors/Door.cs
@@ -17,31 +17,15 @@ namespace LabApi.Features.Wrappers;
///
public class Door
{
- [InitializeWrapper]
- internal static void Initialize()
- {
- DoorVariant.OnInstanceCreated += OnAdded;
- DoorVariant.OnInstanceRemoved += OnRemoved;
-
- Register(x => new BreakableDoor(x));
- Register(x => new ElevatorDoor(x));
- Register(x => new Timed173Gate(x));
- Register(x => x.name.StartsWith("HCZ BulkDoor") ? new BulkheadDoor(x) : new Gate(x));
- Register(x => new NonInteractableDoor(x));
- Register(x => new CheckpointDoor(x));
- Register(x => new DummyDoor(x));
- Register(x => new Door(x));
- }
-
///
/// Contains all the handlers for constructing wrappers for the associated base game types.
///
- private static readonly Dictionary> typeWrappers = [];
+ private static readonly Dictionary