diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml
index 16ff4dafa..7ee77d48a 100644
--- a/.github/workflows/dev.yml
+++ b/.github/workflows/dev.yml
@@ -4,9 +4,11 @@ on:
push:
branches:
- dev
+ - scpsl14
pull_request:
branches:
- dev
+ - scpsl14
workflow_dispatch:
defaults:
diff --git a/.github/workflows/pull_request_opened.yml b/.github/workflows/pull_request_opened.yml
index a54bed971..6e2248852 100644
--- a/.github/workflows/pull_request_opened.yml
+++ b/.github/workflows/pull_request_opened.yml
@@ -1,7 +1,9 @@
-name: Labeler
+name: Pull Request CI
on:
- - pull_request_target
+ pull_request_target:
+ branches:
+ - '**'
defaults:
run:
@@ -9,21 +11,28 @@ defaults:
jobs:
set-labels:
+ name: Set Labels
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- - name: Labeler
- uses: actions/labeler@v5.0.0
+ - uses: actions/labeler@v5.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/labeler.yml
sync-labels: true
assign-author:
+ name: Assign Author
runs-on: ubuntu-latest
permissions:
pull-requests: write
-
steps:
- uses: toshimaru/auto-author-assign@v2.1.1
+ validate-pr-title:
+ name: Validate PR title
+ runs-on: ubuntu-latest
+ steps:
+ - uses: amannn/action-semantic-pull-request@v5
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/push_nuget.yml b/.github/workflows/push_nuget.yml
index 87acc59b8..5150b0c7e 100644
--- a/.github/workflows/push_nuget.yml
+++ b/.github/workflows/push_nuget.yml
@@ -10,7 +10,7 @@ defaults:
working-directory: ./EXILED
env:
- EXILED_REFERENCES_URL: https://ExMod-Team.github.io/SL-References/Master.zip
+ EXILED_REFERENCES_URL: https://ExMod-Team.github.io/SL-References/Dev.zip
EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References
jobs:
diff --git a/.gitignore b/.gitignore
index ecdece2bb..958e3428c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -373,4 +373,7 @@ NuGet.config
_site/
# JSON Schemas
-JSON/
\ No newline at end of file
+JSON/
+
+# Mac DS_Store
+.DS_Store
\ No newline at end of file
diff --git a/EXILED/EXILED.props b/EXILED/EXILED.props
index 9b3f7ecab..8c70baeb8 100644
--- a/EXILED/EXILED.props
+++ b/EXILED/EXILED.props
@@ -2,7 +2,7 @@
- Exiled Official
+ ExMod Team
@@ -15,7 +15,7 @@
- 8.14.1
+ 9.0.0false
diff --git a/EXILED/Exiled.API/Enums/AdminToyType.cs b/EXILED/Exiled.API/Enums/AdminToyType.cs
index 6a4f1324a..c7f937721 100644
--- a/EXILED/Exiled.API/Enums/AdminToyType.cs
+++ b/EXILED/Exiled.API/Enums/AdminToyType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -27,5 +27,10 @@ public enum AdminToyType
/// ShootingTarget toy.
///
ShootingTarget,
+
+ ///
+ /// Speaker toy.
+ ///
+ Speaker,
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/AmmoType.cs b/EXILED/Exiled.API/Enums/AmmoType.cs
index 0673a8bbb..506d3067d 100644
--- a/EXILED/Exiled.API/Enums/AmmoType.cs
+++ b/EXILED/Exiled.API/Enums/AmmoType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/AuthenticationType.cs b/EXILED/Exiled.API/Enums/AuthenticationType.cs
index 0590ea097..8dd2cc7c1 100644
--- a/EXILED/Exiled.API/Enums/AuthenticationType.cs
+++ b/EXILED/Exiled.API/Enums/AuthenticationType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/BloodType.cs b/EXILED/Exiled.API/Enums/BloodType.cs
index 18a27255b..b054cc0e6 100644
--- a/EXILED/Exiled.API/Enums/BloodType.cs
+++ b/EXILED/Exiled.API/Enums/BloodType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/CameraType.cs b/EXILED/Exiled.API/Enums/CameraType.cs
index c72624b00..6248d2a24 100644
--- a/EXILED/Exiled.API/Enums/CameraType.cs
+++ b/EXILED/Exiled.API/Enums/CameraType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -68,9 +68,6 @@ public enum CameraType
HczElevSysB,
HczHallway,
HczThreeWay,
- HczServersBottom,
- HczServersStairs,
- HczServersTop,
HczTeslaGate,
HczTestroomBridge,
HczTestroomMain,
@@ -124,6 +121,19 @@ public enum CameraType
Hcz173ContChamber,
Hcz173Hallway,
HczCurve,
+ HczJunkMain,
+ HczJunkHallway,
+ HczCornerDeep,
+ HczDSS08,
+ HczMicroHIDStairs,
+ HczPipesHallway,
+ HczWarheadStarboardElevator,
+ HczMicroHIDMain,
+ HczWarheadTopElevators,
+ HczWarheadConnector,
+ HczWarheadPortElevator,
+ HczMicroHIDLab,
+ HczPipesMain,
#endregion
}
}
diff --git a/EXILED/Exiled.API/Enums/ConfigType.cs b/EXILED/Exiled.API/Enums/ConfigType.cs
index e928476aa..2ef00a18d 100644
--- a/EXILED/Exiled.API/Enums/ConfigType.cs
+++ b/EXILED/Exiled.API/Enums/ConfigType.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/DamageType.cs b/EXILED/Exiled.API/Enums/DamageType.cs
index 9aec9fc64..add8d86ca 100644
--- a/EXILED/Exiled.API/Enums/DamageType.cs
+++ b/EXILED/Exiled.API/Enums/DamageType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -120,6 +120,11 @@ public enum DamageType
///
SeveredHands,
+ ///
+ /// Damage caused by severed eyes.
+ ///
+ SeveredEyes,
+
///
/// Damage caused by a custom source.
///
@@ -250,4 +255,4 @@ public enum DamageType
///
Marshmallow,
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/DanceType.cs b/EXILED/Exiled.API/Enums/DanceType.cs
index c39a322a9..685c01ed0 100644
--- a/EXILED/Exiled.API/Enums/DanceType.cs
+++ b/EXILED/Exiled.API/Enums/DanceType.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/DangerType.cs b/EXILED/Exiled.API/Enums/DangerType.cs
index cb0ffee46..924ab1a64 100644
--- a/EXILED/Exiled.API/Enums/DangerType.cs
+++ b/EXILED/Exiled.API/Enums/DangerType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/DecontaminationState.cs b/EXILED/Exiled.API/Enums/DecontaminationState.cs
index 865a9734a..c415a6750 100644
--- a/EXILED/Exiled.API/Enums/DecontaminationState.cs
+++ b/EXILED/Exiled.API/Enums/DecontaminationState.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/DisruptorMode.cs b/EXILED/Exiled.API/Enums/DisruptorMode.cs
new file mode 100644
index 000000000..643ed0c30
--- /dev/null
+++ b/EXILED/Exiled.API/Enums/DisruptorMode.cs
@@ -0,0 +1,30 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Enums
+{
+ ///
+ /// Represents disruptor's fire modes.
+ ///
+ public enum DisruptorMode
+ {
+ ///
+ /// Unknown mode.
+ ///
+ None,
+
+ ///
+ /// Single shot mode.
+ ///
+ Disintegrator,
+
+ ///
+ /// Triple shot mode.
+ ///
+ BurstFire,
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/DoorBeepType.cs b/EXILED/Exiled.API/Enums/DoorBeepType.cs
index 59760b888..20fc305ce 100644
--- a/EXILED/Exiled.API/Enums/DoorBeepType.cs
+++ b/EXILED/Exiled.API/Enums/DoorBeepType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/DoorLockType.cs b/EXILED/Exiled.API/Enums/DoorLockType.cs
index f3bacad7a..a71aac702 100644
--- a/EXILED/Exiled.API/Enums/DoorLockType.cs
+++ b/EXILED/Exiled.API/Enums/DoorLockType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/DoorType.cs b/EXILED/Exiled.API/Enums/DoorType.cs
index 0feb0ffa7..36bb9b853 100644
--- a/EXILED/Exiled.API/Enums/DoorType.cs
+++ b/EXILED/Exiled.API/Enums/DoorType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -8,8 +8,7 @@
namespace Exiled.API.Enums
{
using Exiled.API.Features.Doors;
-
- using static Interactables.Interobjects.ElevatorManager;
+ using Interactables.Interobjects;
///
/// Unique identifier for the different types of doors.
@@ -133,11 +132,6 @@ public enum DoorType
///
EscapeSecondary,
- ///
- /// Represents the SERVERS_BOTTOM door.
- ///
- ServersBottom,
-
///
/// Represents the GATE_A door.
///
@@ -159,19 +153,24 @@ public enum DoorType
HeavyContainmentDoor,
///
- /// Represents the HID door.
+ /// Represents any heavy containment styled door.
+ ///
+ HeavyBulkDoor,
+
+ ///
+ /// Represents the HID_CHAMBER door.
///
- HID,
+ HIDChamber,
///
- /// Represents the HID_LEFT door.
+ /// Represents the HID_UPPER door.
///
- HIDLeft,
+ HIDUpper,
///
- /// Represents the HID_RIGHT door.
+ /// Represents the HID_LOWER door.
///
- HIDRight,
+ HIDLower,
///
/// Represents the INTERCOM door.
@@ -231,7 +230,12 @@ public enum DoorType
///
/// Represents the Gate in the Checkpoint between EZ and HCZ.
///
- CheckpointGate,
+ CheckpointGateA,
+
+ ///
+ /// Represents the Gate in the Checkpoint between EZ and HCZ.
+ ///
+ CheckpointGateB,
///
/// Represents the Gate in the Checkpoint between EZ and HCZ.
@@ -269,7 +273,7 @@ public enum DoorType
ElevatorGateB,
///
- /// Represents the Elevator door for .
+ /// Represents the Elevator door for .
///
ElevatorNuke,
@@ -307,5 +311,10 @@ public enum DoorType
/// Represents the New Gate where Scp173 spawn in the .
///
Scp173NewGate,
+
+ ///
+ /// Represents the ESCAPE_FINAL door.
+ ///
+ EscapeFinal,
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/EffectCategory.cs b/EXILED/Exiled.API/Enums/EffectCategory.cs
index 94622a637..c340fca10 100644
--- a/EXILED/Exiled.API/Enums/EffectCategory.cs
+++ b/EXILED/Exiled.API/Enums/EffectCategory.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/EffectType.cs b/EXILED/Exiled.API/Enums/EffectType.cs
index 734fdb8ce..b2894486e 100644
--- a/EXILED/Exiled.API/Enums/EffectType.cs
+++ b/EXILED/Exiled.API/Enums/EffectType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -21,7 +21,7 @@ public enum EffectType
///
/// This EffectType do not exist it's only use when not found or error.
///
- None = -1, // TODO: remove = -1
+ None,
///
/// The player isn't able to open their inventory or reload a weapon.
@@ -239,5 +239,25 @@ public enum EffectType
/// .
///
Slowness,
+
+ ///
+ /// .
+ ///
+ Scp1344,
+
+ ///
+ /// .
+ ///
+ SeveredEyes,
+
+ ///
+ /// .
+ ///
+ PitDeath,
+
+ ///
+ /// .
+ ///
+ Blurred,
}
}
diff --git a/EXILED/Exiled.API/Enums/ElevatorType.cs b/EXILED/Exiled.API/Enums/ElevatorType.cs
index 3c2518ea6..02783b718 100644
--- a/EXILED/Exiled.API/Enums/ElevatorType.cs
+++ b/EXILED/Exiled.API/Enums/ElevatorType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/EnvironmentType.cs b/EXILED/Exiled.API/Enums/EnvironmentType.cs
index 88d4f0fba..2f4a95d73 100644
--- a/EXILED/Exiled.API/Enums/EnvironmentType.cs
+++ b/EXILED/Exiled.API/Enums/EnvironmentType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/EscapeScenario.cs b/EXILED/Exiled.API/Enums/EscapeScenario.cs
index b02058ccd..4ac8c8b92 100644
--- a/EXILED/Exiled.API/Enums/EscapeScenario.cs
+++ b/EXILED/Exiled.API/Enums/EscapeScenario.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/FirearmType.cs b/EXILED/Exiled.API/Enums/FirearmType.cs
index d871fe9b2..aa814136f 100644
--- a/EXILED/Exiled.API/Enums/FirearmType.cs
+++ b/EXILED/Exiled.API/Enums/FirearmType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/GeneratorState.cs b/EXILED/Exiled.API/Enums/GeneratorState.cs
index 75e0cca9b..1b434908b 100644
--- a/EXILED/Exiled.API/Enums/GeneratorState.cs
+++ b/EXILED/Exiled.API/Enums/GeneratorState.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/GlassType.cs b/EXILED/Exiled.API/Enums/GlassType.cs
index 1f9a291c9..9857ed2a8 100644
--- a/EXILED/Exiled.API/Enums/GlassType.cs
+++ b/EXILED/Exiled.API/Enums/GlassType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/HazardType.cs b/EXILED/Exiled.API/Enums/HazardType.cs
index f05f8852f..43d16dac4 100644
--- a/EXILED/Exiled.API/Enums/HazardType.cs
+++ b/EXILED/Exiled.API/Enums/HazardType.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/KeycardPermissions.cs b/EXILED/Exiled.API/Enums/KeycardPermissions.cs
index e60ce521f..044e967eb 100644
--- a/EXILED/Exiled.API/Enums/KeycardPermissions.cs
+++ b/EXILED/Exiled.API/Enums/KeycardPermissions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/LeadingTeam.cs b/EXILED/Exiled.API/Enums/LeadingTeam.cs
index a8f7c64ec..01d62e6ec 100644
--- a/EXILED/Exiled.API/Enums/LeadingTeam.cs
+++ b/EXILED/Exiled.API/Enums/LeadingTeam.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/LockerType.cs b/EXILED/Exiled.API/Enums/LockerType.cs
index c44037a3a..ca176fb21 100644
--- a/EXILED/Exiled.API/Enums/LockerType.cs
+++ b/EXILED/Exiled.API/Enums/LockerType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/PingType.cs b/EXILED/Exiled.API/Enums/PingType.cs
index b67a2def8..ab9f8f5fd 100644
--- a/EXILED/Exiled.API/Enums/PingType.cs
+++ b/EXILED/Exiled.API/Enums/PingType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/PluginPriority.cs b/EXILED/Exiled.API/Enums/PluginPriority.cs
index da2280deb..786f2690d 100644
--- a/EXILED/Exiled.API/Enums/PluginPriority.cs
+++ b/EXILED/Exiled.API/Enums/PluginPriority.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/PrefabType.cs b/EXILED/Exiled.API/Enums/PrefabType.cs
index fbcd3dcbf..7ec8a851c 100644
--- a/EXILED/Exiled.API/Enums/PrefabType.cs
+++ b/EXILED/Exiled.API/Enums/PrefabType.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -16,10 +16,10 @@ public enum PrefabType
{
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
#pragma warning disable SA1602 // Enumeration items should be documented
- [Prefab(1883254029, "Player")]
+ [Prefab(3816198336, "Player")]
Player,
- [Prefab(2295511789, "EZ BreakableDoor")]
+ [Prefab(1883254029, "EZ BreakableDoor")]
EZBreakableDoor,
[Prefab(2295511789, "HCZ BreakableDoor")]
@@ -28,6 +28,42 @@ public enum PrefabType
[Prefab(3038351124, "LCZ BreakableDoor")]
LCZBreakableDoor,
+ [Prefab(400539138, "HCZ OneSided")]
+ HCZOneSided,
+
+ [Prefab(2060920286, "HCZ TwoSided")]
+ HCZTwoSided,
+
+ [Prefab(3343949480, "OpenHallway")]
+ HCZOpenHallway,
+
+ [Prefab(3999209566, "OpenHallway Construct A")]
+ HCZOpenHallway_Construct_A,
+
+ [Prefab(38976586, "OpenHallway Clutter A")]
+ HCZOpenHallway_Clutter_A,
+
+ [Prefab(1687661105, "OpenHallway Clutter B")]
+ HCZOpenHallway_Clutter_B,
+
+ [Prefab(147203050, "OpenHallway Clutter C")]
+ HCZOpenHallway_Clutter_C,
+
+ [Prefab(1102032353, "OpenHallway Clutter D")]
+ HCZOpenHallway_Clutter_D,
+
+ [Prefab(2490430134, "OpenHallway Clutter E")]
+ HCZOpenHallway_Clutter_E,
+
+ [Prefab(2673083832, "OpenHallway Clutter F")]
+ HCZOpenHallway_Clutter_F,
+
+ [Prefab(2536312960, "OpenHallway Clutter G")]
+ HCZOpenHallway_Clutter_G,
+
+ [Prefab(2176035362, "HCZ BulkDoor")]
+ HCZBulkDoor,
+
[Prefab(1704345398, "sportTargetPrefab")]
SportTarget,
@@ -46,6 +82,9 @@ public enum PrefabType
[Prefab(3956448839, "LightSourceToy")]
LightSourceToy,
+ [Prefab(712426663, "SpeakerToy")]
+ SpeakerToy,
+
[Prefab(2672653014, "RegularKeycardPickup")]
RegularKeycardPickup,
@@ -55,6 +94,9 @@ public enum PrefabType
[Prefab(248357067, "RadioPickup")]
RadioPickup,
+ [Prefab(1925130715, "FirearmPickup")]
+ FirearmPickup,
+
[Prefab(1925130715, "Com15Pickup")]
Com15Pickup,
@@ -181,6 +223,9 @@ public enum PrefabType
[Prefab(3532394942, "LanternPickup")]
LanternPickup,
+ [Prefab(4143962266, "SCP1344Pickup")]
+ Scp1344Pickup,
+
[Prefab(825024811, "Amnestic Cloud Hazard")]
AmnesticCloudHazard,
@@ -208,9 +253,18 @@ public enum PrefabType
[Prefab(3372339835, "Scp1576PedestalStructure Variant")]
Scp1576PedestalStructure,
+ [Prefab(2399831573, "AntiScp207PedestalStructure Variant")]
+ AntiScp207PedestalStructure,
+
+ [Prefab(1763950070, "Scp1344PedestalStructure Variant")]
+ Scp1344PedestalStructure,
+
[Prefab(2830750618, "LargeGunLockerStructure")]
LargeGunLockerStructure,
+ [Prefab(2372810204, "Experimental Weapon Locker")]
+ ExperimentalLockerStructure,
+
[Prefab(3352879624, "RifleRackStructure")]
RifleRackStructure,
@@ -273,5 +327,14 @@ public enum PrefabType
[Prefab(3721192489, "Scp3114_Ragdoll")]
Scp3114Ragdoll,
+
+ [Prefab(2588580243, "ElevatorChamber")]
+ ElevatorChamber,
+
+ [Prefab(1757973841, "ElevatorChamber_Gates")]
+ ElevatorChamber_Gates,
+
+ [Prefab(912031041, "ElevatorChamberNuke")]
+ ElevatorChamberNuke,
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/ProjectileType.cs b/EXILED/Exiled.API/Enums/ProjectileType.cs
index 48d33ae7b..1e065d67c 100644
--- a/EXILED/Exiled.API/Enums/ProjectileType.cs
+++ b/EXILED/Exiled.API/Enums/ProjectileType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/RadioRange.cs b/EXILED/Exiled.API/Enums/RadioRange.cs
index f5abb6cb8..c1675fcad 100644
--- a/EXILED/Exiled.API/Enums/RadioRange.cs
+++ b/EXILED/Exiled.API/Enums/RadioRange.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/ReservedSlotEventResult.cs b/EXILED/Exiled.API/Enums/ReservedSlotEventResult.cs
index fe2853271..3e773998d 100644
--- a/EXILED/Exiled.API/Enums/ReservedSlotEventResult.cs
+++ b/EXILED/Exiled.API/Enums/ReservedSlotEventResult.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/RespawnEffectType.cs b/EXILED/Exiled.API/Enums/RespawnEffectType.cs
index 77c0b26c6..672abb197 100644
--- a/EXILED/Exiled.API/Enums/RespawnEffectType.cs
+++ b/EXILED/Exiled.API/Enums/RespawnEffectType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -14,23 +14,16 @@ namespace Exiled.API.Enums
///
/// Layers game respawn effects.
///
- ///
- ///
- public enum RespawnEffectType : byte
+ public enum RespawnEffectType
{
- ///
- /// Plays the music to alive and .
- ///
- PlayChaosInsurgencyMusic = 0,
-
///
/// Summons the van.
///
- SummonChaosInsurgencyVan = 128,
+ SummonChaosInsurgencyVan,
///
/// Summons the NTF chopper.
///
- SummonNtfChopper = 129,
+ SummonNtfChopper,
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/RoomType.cs b/EXILED/Exiled.API/Enums/RoomType.cs
index e74f07ecf..054029601 100644
--- a/EXILED/Exiled.API/Enums/RoomType.cs
+++ b/EXILED/Exiled.API/Enums/RoomType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -149,16 +149,6 @@ public enum RoomType
///
HczTesla,
- ///
- /// Heavy Containment Zone's Servers room.
- ///
- HczServers,
-
- ///
- /// Heavy Containment Zone's 3-way intersection.
- ///
- HczTCross,
-
///
/// Heavy Containment Zone's cruved hall.
///
@@ -210,15 +200,25 @@ public enum RoomType
EzCollapsedTunnel,
///
- /// Entrance Zone's straight hall with Dr.L's locked room.
+ /// Entrance Zone's straight hall with Dr.L's or Dr. Gear's locked room.
///
EzConference,
///
- /// Entrance Zone's straight hall
+ /// Entrance Zone's straight hall with Chef's locked room.
+ ///
+ EzChef,
+
+ ///
+ /// Entrance Zone's straight hall.
///
EzStraight,
+ ///
+ /// Entrance Zone's straight hall with a different placement of seasonal objects.
+ ///
+ EzStraightColumn,
+
///
/// Entrance Zone's Cafeteria Room.
///
@@ -250,7 +250,7 @@ public enum RoomType
Surface,
///
- /// Heavy Containment Zone's straight hall.
+ /// Heavy Containment Zone's straight hall with ceiling fan.
///
HczStraight,
@@ -260,14 +260,19 @@ public enum RoomType
EzTCross,
///
- /// Light Containment ZOne's SCP-330 room.
+ /// Light Containment Zone's SCP-330 room.
///
Lcz330,
///
/// Entrance Zone's straight hall before the entrance/heavy checkpoint.
///
- EzCheckpointHallway,
+ EzCheckpointHallwayA,
+
+ ///
+ /// Entrance Zone's straight hall before the entrance/heavy checkpoint.
+ ///
+ EzCheckpointHallwayB,
///
/// Heavy Containment Zone's test room's straight hall.
@@ -283,5 +288,45 @@ public enum RoomType
/// Heavy Containment Elevator Zone's System B room.
///
HczElevatorB,
+
+ ///
+ /// Heavy Containment Zone's cross room with waterfall.
+ ///
+ HczCrossRoomWater,
+
+ ///
+ /// Heavy Containment Zone's corner.
+ ///
+ HczCornerDeep,
+
+ ///
+ /// Heavy Containment Zone's 3-way intersection with storage crates obstructing the passage.
+ ///
+ HczIntersectionJunk,
+
+ ///
+ /// Heavy Containment Zone's 3-way intersection.
+ ///
+ HczIntersection,
+
+ ///
+ /// Heavy Containment Zone's straight hall with pipelines and sanitary door.
+ ///
+ HczStraightC,
+
+ ///
+ /// Heavy Containment Zone's straight hall with pipelines obstructing the passage.
+ ///
+ HczStraightPipeRoom,
+
+ ///
+ /// Heavy Containment Zone's straight hall.
+ ///
+ HczStraightVariant,
+
+ ///
+ /// Entrance Zone's straight hall with Dr.L's and conference room 9b locked room.
+ ///
+ EzSmallrooms,
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/ScenesType.cs b/EXILED/Exiled.API/Enums/ScenesType.cs
index 2a7898ca6..60691443f 100644
--- a/EXILED/Exiled.API/Enums/ScenesType.cs
+++ b/EXILED/Exiled.API/Enums/ScenesType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/ShootingTargetButton.cs b/EXILED/Exiled.API/Enums/ShootingTargetButton.cs
index 9d183ca46..9e5249fe0 100644
--- a/EXILED/Exiled.API/Enums/ShootingTargetButton.cs
+++ b/EXILED/Exiled.API/Enums/ShootingTargetButton.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/ShootingTargetType.cs b/EXILED/Exiled.API/Enums/ShootingTargetType.cs
index 674b0818e..c04f37600 100644
--- a/EXILED/Exiled.API/Enums/ShootingTargetType.cs
+++ b/EXILED/Exiled.API/Enums/ShootingTargetType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/Side.cs b/EXILED/Exiled.API/Enums/Side.cs
index fdc329c90..5e9c063be 100644
--- a/EXILED/Exiled.API/Enums/Side.cs
+++ b/EXILED/Exiled.API/Enums/Side.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/SpawnLocationType.cs b/EXILED/Exiled.API/Enums/SpawnLocationType.cs
index 63568ba3b..0cd2c6dde 100644
--- a/EXILED/Exiled.API/Enums/SpawnLocationType.cs
+++ b/EXILED/Exiled.API/Enums/SpawnLocationType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -142,16 +142,5 @@ public enum SpawnLocationType
/// Just inside the LCZ WC door.
///
InsideLczWc,
-
- ///
- /// Just inside the door at the bottom of the server's room.
- ///
- InsideServersBottom,
-
- ///
- /// Inside a random locker on the map.
- ///
- [Obsolete("Use LockerSpawnPoint instead")]
- InsideLocker,
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/SpawnReason.cs b/EXILED/Exiled.API/Enums/SpawnReason.cs
index d5ab04e20..8bf27047c 100644
--- a/EXILED/Exiled.API/Enums/SpawnReason.cs
+++ b/EXILED/Exiled.API/Enums/SpawnReason.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/SpawnableFaction.cs b/EXILED/Exiled.API/Enums/SpawnableFaction.cs
new file mode 100644
index 000000000..0903253fc
--- /dev/null
+++ b/EXILED/Exiled.API/Enums/SpawnableFaction.cs
@@ -0,0 +1,40 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Enums
+{
+ ///
+ /// All spawnable factions.
+ ///
+ public enum SpawnableFaction
+ {
+ ///
+ /// Represents no wave.
+ ///
+ None,
+
+ ///
+ /// Normal NTF wave.
+ ///
+ NtfWave,
+
+ ///
+ /// Normal Chaos wave.
+ ///
+ ChaosWave,
+
+ ///
+ /// Mini NTF wave.
+ ///
+ NtfMiniWave,
+
+ ///
+ /// Mini Chaos wave.
+ ///
+ ChaosMiniWave,
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Enums/ThrowRequest.cs b/EXILED/Exiled.API/Enums/ThrowRequest.cs
index 645063bb9..89e1b5561 100644
--- a/EXILED/Exiled.API/Enums/ThrowRequest.cs
+++ b/EXILED/Exiled.API/Enums/ThrowRequest.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/UncuffReason.cs b/EXILED/Exiled.API/Enums/UncuffReason.cs
index 6b3018fda..977ad09fe 100644
--- a/EXILED/Exiled.API/Enums/UncuffReason.cs
+++ b/EXILED/Exiled.API/Enums/UncuffReason.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/UsableRippleType.cs b/EXILED/Exiled.API/Enums/UsableRippleType.cs
index 733e5d0ec..1abc6936f 100644
--- a/EXILED/Exiled.API/Enums/UsableRippleType.cs
+++ b/EXILED/Exiled.API/Enums/UsableRippleType.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/WarheadStatus.cs b/EXILED/Exiled.API/Enums/WarheadStatus.cs
index 1bbfb8f4f..e839c0b8d 100644
--- a/EXILED/Exiled.API/Enums/WarheadStatus.cs
+++ b/EXILED/Exiled.API/Enums/WarheadStatus.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Enums/ZoneType.cs b/EXILED/Exiled.API/Enums/ZoneType.cs
index 126757de9..382833528 100644
--- a/EXILED/Exiled.API/Enums/ZoneType.cs
+++ b/EXILED/Exiled.API/Enums/ZoneType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -51,9 +51,14 @@ public enum ZoneType
///
Surface = 8,
+ ///
+ /// The Pocket Dimension.
+ ///
+ Pocket = 16,
+
///
/// An unknown type of zone.
///
- Other = 16,
+ Other = 32,
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Exiled.API.csproj b/EXILED/Exiled.API/Exiled.API.csproj
index e0949b7ff..988d63157 100644
--- a/EXILED/Exiled.API/Exiled.API.csproj
+++ b/EXILED/Exiled.API/Exiled.API.csproj
@@ -32,11 +32,10 @@
+
-
- $(EXILED_REFERENCES)\UnityEngine.ParticleSystemModule.dll
-
+
diff --git a/EXILED/Exiled.API/Extensions/BitwiseExtensions.cs b/EXILED/Exiled.API/Extensions/BitwiseExtensions.cs
index 2f8473784..d26328475 100644
--- a/EXILED/Exiled.API/Extensions/BitwiseExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/BitwiseExtensions.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Extensions/CommonExtensions.cs b/EXILED/Exiled.API/Extensions/CommonExtensions.cs
index 6762935df..b4db94160 100644
--- a/EXILED/Exiled.API/Extensions/CommonExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/CommonExtensions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Extensions/DamageTypeExtensions.cs b/EXILED/Exiled.API/Extensions/DamageTypeExtensions.cs
index c8f0975ac..bb2a246f1 100644
--- a/EXILED/Exiled.API/Extensions/DamageTypeExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/DamageTypeExtensions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -49,6 +49,7 @@ public static class DamageTypeExtensions
{ DeathTranslations.MicroHID.Id, DamageType.MicroHid },
{ DeathTranslations.Hypothermia.Id, DamageType.Hypothermia },
{ DeathTranslations.MarshmallowMan.Id, DamageType.Marshmallow },
+ { DeathTranslations.Scp1344.Id, DamageType.SeveredEyes },
};
private static readonly Dictionary TranslationConversionInternal = new()
@@ -80,6 +81,7 @@ public static class DamageTypeExtensions
{ DeathTranslations.MicroHID, DamageType.MicroHid },
{ DeathTranslations.Hypothermia, DamageType.Hypothermia },
{ DeathTranslations.MarshmallowMan, DamageType.Marshmallow },
+ { DeathTranslations.Scp1344, DamageType.SeveredEyes },
};
private static readonly Dictionary ItemConversionInternal = new()
@@ -120,8 +122,8 @@ public static class DamageTypeExtensions
/// Check if a damage type is caused by a weapon.
///
/// The damage type to be checked.
- /// Indicates whether or not the MicroHid damage type should be taken into account.
- /// Returns whether or not the is caused by weapon.
+ /// Indicates whether the MicroHid damage type should be taken into account.
+ /// Returns whether the is caused by weapon.
public static bool IsWeapon(this DamageType type, bool checkMicro = true) => type switch
{
DamageType.Crossvec or DamageType.Logicer or DamageType.Revolver or DamageType.Shotgun or DamageType.AK or DamageType.Com15 or DamageType.Com18 or DamageType.E11Sr or DamageType.Fsp9 or DamageType.ParticleDisruptor or DamageType.Com45 or DamageType.Frmg0 or DamageType.A7 => true,
@@ -133,8 +135,8 @@ public static class DamageTypeExtensions
/// Check if a damage type is caused by a SCP.
///
/// The damage type to be checked.
- /// Indicates whether or not the SCP-items damage types should be taken into account.
- /// Returns whether or not the is caused by SCP.
+ /// Indicates whether the SCP-items damage types should be taken into account.
+ /// Returns whether the is caused by SCP.
public static bool IsScp(this DamageType type, bool checkItems = true) => type switch
{
DamageType.Scp or DamageType.Scp049 or DamageType.Scp096 or DamageType.Scp106 or DamageType.Scp173 or DamageType.Scp939 or DamageType.Scp0492 or DamageType.Scp3114 => true,
@@ -146,7 +148,7 @@ public static class DamageTypeExtensions
/// Check if a damage type is caused by a status effect.
///
/// The damage type to be checked.
- /// Returns whether or not the is caused by status effect.
+ /// Returns whether the is caused by status effect.
public static bool IsStatusEffect(this DamageType type) => type switch
{
DamageType.Asphyxiation or DamageType.Poison or DamageType.Bleeding or DamageType.Scp207 or DamageType.Hypothermia or DamageType.Strangled => true,
diff --git a/EXILED/Exiled.API/Extensions/DangerTypeExtensions.cs b/EXILED/Exiled.API/Extensions/DangerTypeExtensions.cs
index f4d18ac69..86c4c2709 100644
--- a/EXILED/Exiled.API/Extensions/DangerTypeExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/DangerTypeExtensions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -53,7 +53,7 @@ public static Type Type(this DangerType danger)
///
/// The enum.
/// The type found with the corresponding DangerType.
- /// Whether or not the type has been found.
+ /// Whether the type has been found.
public static bool TryGetType(this DangerType danger, out Type type)
=> DangerTypeToType.TryGetValue(danger, out type);
@@ -70,7 +70,7 @@ public static DangerType GetDangerType(this DangerStackBase dangerStackBase)
///
/// The enum.
/// The danger type found.
- /// Whether or not the danger has been found.
+ /// Whether the danger has been found.
public static bool TryGetDangerType(this DangerStackBase dangerStackBase, out DangerType danger)
{
if (dangerStackBase == null || !TypeToDangerType.TryGetValue(dangerStackBase.GetType(), out danger))
diff --git a/EXILED/Exiled.API/Extensions/DoorTypeExtensions.cs b/EXILED/Exiled.API/Extensions/DoorTypeExtensions.cs
index c4b512dd1..79164df2b 100644
--- a/EXILED/Exiled.API/Extensions/DoorTypeExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/DoorTypeExtensions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -18,7 +18,7 @@ public static class DoorTypeExtensions
/// Checks if a door type is a gate.
///
/// The door to be checked.
- /// Returns whether the is a gate or not.
+ /// Returns whether the is a gate.
public static bool IsGate(this DoorType door) => door is DoorType.GateA or DoorType.GateB or DoorType.Scp914Gate or
DoorType.Scp049Gate or DoorType.GR18Gate or DoorType.SurfaceGate or DoorType.Scp173Gate;
@@ -26,14 +26,14 @@ public static bool IsGate(this DoorType door) => door is DoorType.GateA or DoorT
/// Checks if a door type is a checkpoint.
///
/// The door to be checked.
- /// Returns whether the is a checkpoint or not.
+ /// Returns whether the is a checkpoint.
public static bool IsCheckpoint(this DoorType door) => door is DoorType.CheckpointLczA or DoorType.CheckpointLczB or DoorType.CheckpointEzHczA or DoorType.CheckpointEzHczB;
///
/// Checks if a door type is an elevator.
///
/// The door to be checked.
- /// Returns whether the is an elevator or not.
+ /// Returns whether the is an elevator.
public static bool IsElevator(this DoorType door) => door is DoorType.ElevatorGateA or DoorType.ElevatorGateB
or DoorType.ElevatorLczA or DoorType.ElevatorLczB or DoorType.ElevatorNuke or DoorType.ElevatorScp049;
}
diff --git a/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs b/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs
index 126b5eae4..0b977356e 100644
--- a/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs
+++ b/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -33,7 +33,7 @@ public static class EffectTypeExtension
{ EffectType.AmnesiaVision, typeof(AmnesiaVision) },
{ EffectType.Asphyxiated, typeof(Asphyxiated) },
{ EffectType.Bleeding, typeof(Bleeding) },
- { EffectType.Blinded, typeof(Blinded) },
+ { EffectType.Blinded, typeof(Blindness) },
{ EffectType.BodyshotReduction, typeof(BodyshotReduction) },
{ EffectType.Burned, typeof(Burned) },
{ EffectType.CardiacArrest, typeof(CardiacArrest) },
@@ -74,6 +74,10 @@ public static class EffectTypeExtension
{ EffectType.Ghostly, typeof(Ghostly) },
{ EffectType.FogControl, typeof(FogControl) },
{ EffectType.Slowness, typeof(Slowness) },
+ { EffectType.Scp1344, typeof(Scp1344) },
+ { EffectType.SeveredEyes, typeof(SeveredEyes) },
+ { EffectType.PitDeath, typeof(PitDeath) },
+ { EffectType.Blurred, typeof(Blurred) },
});
///
@@ -94,7 +98,7 @@ public static Type Type(this EffectType effect)
///
/// The enum.
/// The type found with the corresponding EffecType.
- /// Whether or not the effectType has been found.
+ /// Whether the effectType has been found.
public static bool TryGetType(this EffectType effect, out Type type)
=> EffectTypeToType.TryGetValue(effect, out type);
@@ -111,7 +115,7 @@ public static EffectType GetEffectType(this StatusEffectBase statusEffectBase)
///
/// The enum.
/// The effect found.
- /// Whether or not the effect has been found.
+ /// Whether the effect has been found.
public static bool TryGetEffectType(this StatusEffectBase statusEffectBase, out EffectType effect)
{
if (statusEffectBase == null || !TypeToEffectType.TryGetValue(statusEffectBase.GetType(), out effect))
@@ -131,28 +135,28 @@ public static bool TryGetEffectType(this StatusEffectBase statusEffectBase, out
public static void SetFogType(this FogControl fogControl, FogType fogType) => fogControl.Intensity = (byte)(fogType + 1);
///
- /// Returns whether or not the provided drains health over time.
+ /// Returns whether the provided drains health over time.
///
/// The .
- /// Whether or not the effect drains health over time.
+ /// Whether the effect drains health over time.
///
public static bool IsHarmful(this EffectType effect) => effect is EffectType.Asphyxiated or EffectType.Bleeding
or EffectType.Corroding or EffectType.Decontaminating or EffectType.Hemorrhage or EffectType.Hypothermia
or EffectType.Poisoned or EffectType.Scp207 or EffectType.SeveredHands or EffectType.Strangled;
///
- /// Returns whether or not the provided heals a player.
+ /// Returns whether the provided heals a player.
///
/// The .
- /// Whether or not the effect heals.
+ /// Whether the effect heals.
///
- public static bool IsHealing(this EffectType effect) => effect.TryGetType(out Type type) && typeof(IHealablePlayerEffect).IsAssignableFrom(type);
+ public static bool IsHealing(this EffectType effect) => effect.TryGetType(out Type type) && typeof(IHealableEffect).IsAssignableFrom(type);
///
- /// Returns whether or not the provided is a negative effect.
+ /// Returns whether the provided is a negative effect.
///
/// The .
- /// Whether or not the effect is a negative effect.
+ /// Whether the effect is a negative effect.
///
public static bool IsNegative(this EffectType effect) => IsHarmful(effect) || effect is EffectType.AmnesiaItems
or EffectType.AmnesiaVision or EffectType.Blinded or EffectType.Burned or EffectType.Concussed or EffectType.Deafened
@@ -160,27 +164,27 @@ or EffectType.Disabled or EffectType.Ensnared or EffectType.Exhausted or EffectT
or EffectType.Stained or EffectType.InsufficientLighting or EffectType.SoundtrackMute or EffectType.Scanned or EffectType.Slowness;
///
- /// Returns whether or not the provided is a positive effect.
+ /// Returns whether the provided is a positive effect.
///
/// The .
- /// Whether or not the effect is a positive effect.
+ /// Whether the effect is a positive effect.
///
public static bool IsPositive(this EffectType effect) => effect is EffectType.BodyshotReduction or EffectType.DamageReduction
or EffectType.Invigorated or EffectType.Invisible or EffectType.MovementBoost or EffectType.RainbowTaste
or EffectType.Scp207 or EffectType.Scp1853 or EffectType.Vitality or EffectType.AntiScp207 or EffectType.Ghostly;
///
- /// Returns whether or not the provided affects the player's movement speed.
+ /// Returns whether the provided affects the player's movement speed.
///
/// The .
- /// Whether or not the effect modifies the player's movement speed.
+ /// Whether the effect modifies the player's movement speed.
public static bool IsMovement(this EffectType effect) => effect.TryGetType(out Type type) && typeof(IMovementSpeedModifier).IsAssignableFrom(type);
///
- /// Returns whether or not the provided is displayed to spectators as text.
+ /// Returns whether the provided is displayed to spectators as text.
///
/// The .
- /// Whether or not the effect is displayed to spectators as text.
+ /// Whether the effect is displayed to spectators as text.
public static bool IsDisplayed(this EffectType effect) => effect.TryGetType(out Type type) && typeof(ISpectatorDataPlayerEffect).IsAssignableFrom(type);
///
diff --git a/EXILED/Exiled.API/Extensions/ItemExtensions.cs b/EXILED/Exiled.API/Extensions/ItemExtensions.cs
index 2aa7c90fc..3fc97516f 100644
--- a/EXILED/Exiled.API/Extensions/ItemExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/ItemExtensions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -18,6 +18,7 @@ namespace Exiled.API.Extensions
using InventorySystem;
using InventorySystem.Items;
using InventorySystem.Items.Firearms.Attachments;
+ using InventorySystem.Items.Firearms.Modules;
using InventorySystem.Items.Pickups;
using Structs;
@@ -30,57 +31,57 @@ public static class ItemExtensions
/// Check if an item is an ammo.
///
/// The item to be checked.
- /// Returns whether the is an ammo or not.
+ /// Returns whether the is an ammo.
public static bool IsAmmo(this ItemType item) => item.GetAmmoType() is not AmmoType.None;
///
/// Check if an item is a weapon.
///
/// The item to be checked.
- /// Indicates whether the MicroHID item should be taken into account or not.
- /// Returns whether the is a weapon or not.
+ /// Indicates whether the MicroHID item should be taken into account.
+ /// Returns whether the is a weapon.
public static bool IsWeapon(this ItemType type, bool checkMicro = true) => type.GetFirearmType() is not FirearmType.None || (checkMicro && type is ItemType.MicroHID);
///
/// Check if an item is an SCP.
///
/// The item to be checked.
- /// Returns whether or not the is an SCP.
+ /// Returns whether the is an SCP.
public static bool IsScp(this ItemType type) => GetCategory(type) == ItemCategory.SCPItem;
///
/// Check if an item is a throwable item.
///
/// The item to be checked.
- /// Returns whether or not the is a throwable item.
+ /// Returns whether the is a throwable item.
public static bool IsThrowable(this ItemType type) => type is ItemType.SCP018 or ItemType.GrenadeHE or ItemType.GrenadeFlash or ItemType.SCP2176;
///
/// Check if an item is a medical item.
///
/// The item to be checked.
- /// Returns whether or not the is a medical item.
+ /// Returns whether the is a medical item.
public static bool IsMedical(this ItemType type) => GetCategory(type) == ItemCategory.Medical;
///
/// Check if an item is a utility item.
///
/// The item to be checked.
- /// Returns whether or not the is an utilty item.
+ /// Returns whether the is an utilty item.
public static bool IsUtility(this ItemType type) => type is ItemType.Flashlight or ItemType.Radio;
///
/// Check if a is an armor item.
///
/// The item to be checked.
- /// Returns whether or not the is an armor.
+ /// Returns whether the is an armor.
public static bool IsArmor(this ItemType type) => GetCategory(type) == ItemCategory.Armor;
///
/// Check if an item is a keycard.
///
/// The item to be checked.
- /// Returns whether or not the is a keycard.
+ /// Returns whether the is a keycard.
public static bool IsKeycard(this ItemType type) => GetCategory(type) == ItemCategory.Keycard;
///
@@ -123,12 +124,12 @@ public static T GetItemBase(this ItemType type)
///
/// The weapon that you want to get maximum of.
/// Returns the maximum.
- public static byte GetMaxAmmo(this FirearmType item)
+ public static int GetMaxAmmo(this FirearmType item)
{
if (!InventoryItemLoader.AvailableItems.TryGetValue(item.GetItemType(), out ItemBase itemBase) || itemBase is not InventorySystem.Items.Firearms.Firearm firearm)
return 0;
- return firearm.AmmoManagerModule.MaxAmmo;
+ return (firearm.Modules.FirstOrDefault(x => x is IAmmoContainerModule) as IAmmoContainerModule).AmmoMax;
}
///
@@ -323,5 +324,13 @@ public static uint GetBaseCode(this FirearmType type)
/// The to check.
/// of the specified .
public static ItemCategory GetCategory(this ItemType type) => GetItemBase(type).Category;
+
+ ///
+ /// Checks if the specified has the specified .
+ ///
+ /// Weapon to check.
+ /// Attachment to check.
+ /// true if weapon has the specified attachment. Otherwise, false.
+ public static bool HasAttachment(this Firearm firearm, AttachmentName attachment) => firearm.Attachments.FirstOrDefault(x => x.Name == attachment)?.IsEnabled ?? false;
}
}
diff --git a/EXILED/Exiled.API/Extensions/LockerExtensions.cs b/EXILED/Exiled.API/Extensions/LockerExtensions.cs
index 7304cbd4e..c7c1a78ab 100644
--- a/EXILED/Exiled.API/Extensions/LockerExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/LockerExtensions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs
index 568eabf51..1e8187c09 100644
--- a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -19,8 +19,6 @@ namespace Exiled.API.Extensions
using Features;
using Features.Pools;
- using InventorySystem.Items.Firearms;
-
using Mirror;
using PlayerRoles;
@@ -151,7 +149,7 @@ public static ReadOnlyDictionary RpcFullNames
/// Plays a beep sound that only the target can hear.
///
/// Target to play sound to.
- public static void PlayBeepSound(this Player player) => SendFakeTargetRpc(player, ReferenceHub.HostHub.networkIdentity, typeof(AmbientSoundPlayer), nameof(AmbientSoundPlayer.RpcPlaySound), 7);
+ public static void PlayBeepSound(this Player player) => SendFakeTargetRpc(player, ReferenceHub._hostHub.networkIdentity, typeof(AmbientSoundPlayer), nameof(AmbientSoundPlayer.RpcPlaySound), 7);
///
/// Set on the player that only the can see.
@@ -171,6 +169,8 @@ public static ReadOnlyDictionary RpcFullNames
/// GunAudioMessage's audioClipId to set (default = 0).
public static void PlayGunSound(this Player player, Vector3 position, ItemType itemType, byte volume, byte audioClipId = 0)
{
+ // TODO: Not finish
+ /*
GunAudioMessage message = new()
{
Weapon = itemType,
@@ -180,7 +180,7 @@ public static void PlayGunSound(this Player player, Vector3 position, ItemType i
ShooterPosition = new RelativePosition(position),
};
- player.Connection.Send(message);
+ player.Connection.Send(message);*/
}
///
@@ -222,24 +222,13 @@ public static void SetName(this Player target, Player player, string name)
target.SendFakeSyncVar(player.NetworkIdentity, typeof(NicknameSync), nameof(NicknameSync.Network_displayName), name);
}
- ///
- /// Sets of a that only the player can see.
- ///
- /// Room to modify.
- /// Only this player can see room color.
- /// Light intensity multiplier to set.
- [Obsolete("This features has been remove by NW", true)]
- public static void SetRoomLightIntensityForTargetOnly(this Room room, Player target, float multiplier)
- {
- }
-
///
/// Change character model for appearance.
/// It will continue until 's changes.
///
/// Player to change.
/// Model type.
- /// Whether or not to skip the little jump that works around an invisibility issue.
+ /// Whether to skip the little jump that works around an invisibility issue.
/// The UnitNameId to use for the player's new role, if the player's new role uses unit names. (is NTF).
public static void ChangeAppearance(this Player player, RoleTypeId type, bool skipJump = false, byte unitId = 0) => ChangeAppearance(player, type, Player.List.Where(x => x != player), skipJump, unitId);
@@ -250,7 +239,7 @@ public static void SetRoomLightIntensityForTargetOnly(this Room room, Player tar
/// Player to change.
/// Model type.
/// The players who should see the changed appearance.
- /// Whether or not to skip the little jump that works around an invisibility issue.
+ /// Whether to skip the little jump that works around an invisibility issue.
/// The UnitNameId to use for the player's new role, if the player's new role uses unit names. (is NTF).
public static void ChangeAppearance(this Player player, RoleTypeId type, IEnumerable playersToAffect, bool skipJump = false, byte unitId = 0)
{
@@ -462,38 +451,6 @@ public static void ScaleNetworkIdentityObject(this NetworkIdentity identity, Vec
}
}
- ///
- /// Send fake values to client's .
- ///
- /// Target to send.
- /// of object that owns .
- /// 's type.
- /// Property name starting with Network.
- /// Value of send to target.
- [Obsolete("Use overload with type-template instead.")]
- public static void SendFakeSyncVar(this Player target, NetworkIdentity behaviorOwner, Type targetType, string propertyName, object value)
- {
- if (!target.IsConnected)
- return;
-
- NetworkWriterPooled writer = NetworkWriterPool.Get();
- NetworkWriterPooled writer2 = NetworkWriterPool.Get();
- MakeCustomSyncWriter(behaviorOwner, targetType, null, CustomSyncVarGenerator, writer, writer2);
- target.Connection.Send(new EntityStateMessage
- {
- netId = behaviorOwner.netId,
- payload = writer.ToArraySegment(),
- });
-
- NetworkWriterPool.Return(writer);
- NetworkWriterPool.Return(writer2);
- void CustomSyncVarGenerator(NetworkWriter targetWriter)
- {
- targetWriter.WriteULong(SyncVarDirtyBits[$"{targetType.Name}.{propertyName}"]);
- WriterExtensions[value.GetType()]?.Invoke(null, new object[2] { targetWriter, value });
- }
- }
-
///
/// Send fake values to client's .
///
diff --git a/EXILED/Exiled.API/Extensions/QueueExtensions.cs b/EXILED/Exiled.API/Extensions/QueueExtensions.cs
index 625a5a778..e382cf93b 100644
--- a/EXILED/Exiled.API/Extensions/QueueExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/QueueExtensions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Extensions/ReflectionExtensions.cs b/EXILED/Exiled.API/Extensions/ReflectionExtensions.cs
index 1725f5c9e..21b1d6104 100644
--- a/EXILED/Exiled.API/Extensions/ReflectionExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/ReflectionExtensions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Extensions/RoleExtensions.cs b/EXILED/Exiled.API/Extensions/RoleExtensions.cs
index c674af1bf..369910654 100644
--- a/EXILED/Exiled.API/Extensions/RoleExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/RoleExtensions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -12,12 +12,14 @@ namespace Exiled.API.Extensions
using System.Linq;
using Enums;
- using Exiled.API.Features.Spawn;
+ using Features.Spawn;
+ using Footprinting;
using InventorySystem;
using InventorySystem.Configs;
using PlayerRoles;
using PlayerRoles.FirstPersonControl;
-
+ using Respawning;
+ using Respawning.Waves;
using UnityEngine;
using Team = PlayerRoles.Team;
@@ -27,6 +29,22 @@ namespace Exiled.API.Extensions
///
public static class RoleExtensions
{
+ ///
+ /// Compares LifeIdentifier.
+ ///
+ /// The footprint to compare.
+ /// The other footprint.
+ /// If LifeIdentifier is the same (same role).
+ public static bool CompareLife(this Footprint footprint, Footprint other) => footprint.LifeIdentifier == other.LifeIdentifier;
+
+ ///
+ /// Compares LifeIdentifier.
+ ///
+ /// The footprint to compare.
+ /// The hub to compare to.
+ /// If LifeIdentifier is the same (same role).
+ public static bool CompareLife(this Footprint footprint, ReferenceHub other) => footprint.LifeIdentifier == other.roleManager.CurrentRole.UniqueLifeIdentifier;
+
///
/// Gets a role's.
///
@@ -123,6 +141,48 @@ public static bool TryGetRoleBase(this RoleTypeId roleType, out T roleBase)
/// Returns whether is an or not.
public static bool IsFpcRole(this RoleTypeId roleType) => roleType.GetRoleBase() is IFpcRole;
+ ///
+ /// Checks if the role is an SCP role.
+ ///
+ /// The .
+ /// A boolean which is true when the role is an SCP role.
+ public static bool IsScp(this RoleTypeId roleType) => roleType.GetTeam() == Team.SCPs;
+
+ ///
+ /// Checks if the role is a dead role.
+ ///
+ /// The .
+ /// A boolean which is true when the role is a dead role.
+ public static bool IsDead(this RoleTypeId roleType) => roleType.GetTeam() == Team.Dead;
+
+ ///
+ /// Checks if the role is an NTF role.
+ ///
+ /// The .
+ /// A boolean which is true when the role is an NTF role. Does not include Facility Guards.
+ public static bool IsNtf(this RoleTypeId roleType) => roleType.GetTeam() == Team.FoundationForces && roleType != RoleTypeId.FacilityGuard;
+
+ ///
+ /// Checks if the role is a Chaos role.
+ ///
+ /// The .
+ /// A boolean which is true when the role is a Chaos role.
+ public static bool IsChaos(this RoleTypeId roleType) => roleType.GetTeam() == Team.ChaosInsurgency;
+
+ ///
+ /// Checks if the role is a military role (Chaos Insurgency or NTF).
+ ///
+ /// The .
+ /// A boolean which is true when the role is a military role.
+ public static bool IsMilitary(this RoleTypeId roleType) => roleType.IsNtf() || roleType.IsChaos() || roleType == RoleTypeId.FacilityGuard;
+
+ ///
+ /// Checks if the role is a civilian role (Scientists and Class-D).
+ ///
+ /// 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;
+
///
/// Gets a random spawn point of a .
///
@@ -168,5 +228,56 @@ public static Dictionary GetStartingAmmo(this RoleTypeId roleT
return info.Ammo.ToDictionary(kvp => kvp.Key.GetAmmoType(), kvp => kvp.Value);
}
+
+ ///
+ /// Gets the of a .
+ ///
+ /// A instance.
+ /// associated with the wave.
+ public static SpawnableFaction GetSpawnableFaction(this SpawnableWaveBase waveBase) => waveBase switch
+ {
+ NtfSpawnWave => SpawnableFaction.NtfWave,
+ NtfMiniWave => SpawnableFaction.NtfMiniWave,
+ ChaosSpawnWave => SpawnableFaction.ChaosWave,
+ ChaosMiniWave => SpawnableFaction.ChaosMiniWave,
+ _ => SpawnableFaction.None
+ };
+
+ ///
+ /// Gets the associated with the provided .
+ ///
+ /// A member of the enum.
+ /// associated with the provided .
+ public static Faction GetFaction(this SpawnableFaction spawnableFaction) => spawnableFaction switch
+ {
+ SpawnableFaction.ChaosWave or SpawnableFaction.ChaosMiniWave => Faction.FoundationEnemy,
+ SpawnableFaction.NtfWave or SpawnableFaction.NtfMiniWave => Faction.FoundationStaff,
+ _ => Faction.Unclassified,
+ };
+
+ ///
+ /// Tries to get the associated with the provided and .
+ ///
+ /// A member of the enum.
+ /// The to return.
+ /// A determining whether to get a normal spawn wave or a mini one.
+ /// associated with the provided influenced by .
+ public static bool TryGetSpawnableFaction(this Faction faction, out SpawnableFaction spawnableFaction, bool mini = false)
+ {
+ switch (faction)
+ {
+ case Faction.FoundationStaff:
+ spawnableFaction = mini ? SpawnableFaction.NtfMiniWave : SpawnableFaction.NtfWave;
+ break;
+ case Faction.FoundationEnemy:
+ spawnableFaction = mini ? SpawnableFaction.ChaosMiniWave : SpawnableFaction.ChaosWave;
+ break;
+ default:
+ spawnableFaction = SpawnableFaction.None;
+ return false;
+ }
+
+ return true;
+ }
}
-}
\ No newline at end of file
+}
diff --git a/EXILED/Exiled.API/Extensions/RoomExtensions.cs b/EXILED/Exiled.API/Extensions/RoomExtensions.cs
index 796a9895b..14141a442 100644
--- a/EXILED/Exiled.API/Extensions/RoomExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/RoomExtensions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -20,14 +20,14 @@ public static class RoomExtensions
/// Checks if a room type is a gate.
///
/// The room to be checked.
- /// Returns whether the is a gate or not.
+ /// Returns whether the is a gate.
public static bool IsGate(this RoomType room) => room is RoomType.EzGateA or RoomType.EzGateB;
///
/// Checks if a room type is a checkpoint.
///
/// The room to be checked.
- /// Returns whether the is a checkpoint or not.
+ /// Returns whether the is a checkpoint.
public static bool IsCheckpoint(this RoomType room) => room is RoomType.LczCheckpointA
or RoomType.LczCheckpointB or RoomType.HczEzCheckpointA or RoomType.HczEzCheckpointB;
@@ -35,21 +35,21 @@ public static bool IsCheckpoint(this RoomType room) => room is RoomType.LczCheck
/// Checks if a room type is a Lcz checkpoint.
///
/// The room to be checked.
- /// Returns whether the is a Lcz checkpoint or not.
+ /// Returns whether the is a Lcz checkpoint.
public static bool IsLczCheckpoint(this RoomType room) => room is RoomType.LczCheckpointA or RoomType.LczCheckpointB;
///
/// Checks if a room type is a Hcz checkpoint.
///
/// The room to be checked.
- /// Returns whether the is a Hcz checkpoint or not.
+ /// Returns whether the is a Hcz checkpoint.
public static bool IsHczCheckpoint(this RoomType room) => room is RoomType.HczEzCheckpointA or RoomType.HczEzCheckpointB;
///
/// Checks if a room type contains any SCP.
///
/// The room to be checked.
- /// Returns whether the contains any SCP or not.
+ /// Returns whether the contains any SCP.
public static bool IsScp(this RoomType room)
=> room is RoomType.Lcz173 or RoomType.Lcz330 or RoomType.Lcz914 or RoomType.Hcz049 or RoomType.Hcz079 or
RoomType.Hcz096 or RoomType.Hcz106 or RoomType.Hcz939;
diff --git a/EXILED/Exiled.API/Extensions/SpawnExtensions.cs b/EXILED/Exiled.API/Extensions/SpawnExtensions.cs
index 0c50e783f..5c1c31f89 100644
--- a/EXILED/Exiled.API/Extensions/SpawnExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/SpawnExtensions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -23,7 +23,6 @@ public static class SpawnExtensions
///
public static readonly SpawnLocationType[] ReversedLocations =
{
- SpawnLocationType.InsideServersBottom,
SpawnLocationType.InsideHczArmory,
SpawnLocationType.Inside079First,
SpawnLocationType.InsideHidRight,
@@ -103,7 +102,6 @@ public static Vector3 GetPosition(this SpawnLocationType location)
SpawnLocationType.InsideSurfaceNuke => "SURFACE_NUKE",
SpawnLocationType.Inside079Secondary => "079_SECOND",
SpawnLocationType.Inside173Connector => "173_CONNECTOR",
- SpawnLocationType.InsideServersBottom => "SERVERS_BOTTOM",
SpawnLocationType.InsideEscapePrimary => "ESCAPE_PRIMARY",
SpawnLocationType.InsideEscapeSecondary => "ESCAPE_SECONDARY",
_ => default,
diff --git a/EXILED/Exiled.API/Extensions/StringExtensions.cs b/EXILED/Exiled.API/Extensions/StringExtensions.cs
index 37d1a6777..1cc8dc7c3 100644
--- a/EXILED/Exiled.API/Extensions/StringExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/StringExtensions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -78,7 +78,7 @@ public static (string commandName, string[] arguments) ExtractCommand(this strin
/// Converts a to snake_case convention.
///
/// The string to be converted.
- /// Indicates whether special chars has to be replaced or not.
+ /// Indicates whether special chars has to be replaced.
/// Returns the new snake_case string.
public static string ToSnakeCase(this string str, bool shouldReplaceSpecialChars = true)
{
@@ -92,7 +92,7 @@ public static string ToSnakeCase(this string str, bool shouldReplaceSpecialChars
///
/// The type of the IEnumerable.
/// The instance.
- /// Indicates whether the enumerator index should be shown or not.
+ /// Indicates whether the enumerator index should be shown.
/// Returns the converted .
public static string ToString(this IEnumerable enumerable, bool showIndex = true)
{
@@ -119,10 +119,10 @@ public static string ToString(this IEnumerable enumerable, bool showIndex
/// Name without brackets.
public static string RemoveBracketsOnEndOfName(this string name)
{
- int bracketStart = name.IndexOf('(') - 1;
+ int bracketStart = name.IndexOf('(');
if (bracketStart > 0)
- name = name.Remove(bracketStart, name.Length - bracketStart);
+ name = name.Remove(bracketStart, name.Length - bracketStart).TrimEnd();
return name;
}
diff --git a/EXILED/Exiled.API/Extensions/UserGroupExtensions.cs b/EXILED/Exiled.API/Extensions/UserGroupExtensions.cs
index 683548e95..7b9138618 100644
--- a/EXILED/Exiled.API/Extensions/UserGroupExtensions.cs
+++ b/EXILED/Exiled.API/Extensions/UserGroupExtensions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Attributes/CustomAbilityAttribute.cs b/EXILED/Exiled.API/Features/Attributes/CustomAbilityAttribute.cs
index d9ed492e6..b3328855e 100644
--- a/EXILED/Exiled.API/Features/Attributes/CustomAbilityAttribute.cs
+++ b/EXILED/Exiled.API/Features/Attributes/CustomAbilityAttribute.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Attributes/CustomItemAttribute.cs b/EXILED/Exiled.API/Features/Attributes/CustomItemAttribute.cs
index b85b30707..abe3a0e15 100644
--- a/EXILED/Exiled.API/Features/Attributes/CustomItemAttribute.cs
+++ b/EXILED/Exiled.API/Features/Attributes/CustomItemAttribute.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Attributes/CustomRoleAttribute.cs b/EXILED/Exiled.API/Features/Attributes/CustomRoleAttribute.cs
index f2bf5d380..c954e4ca5 100644
--- a/EXILED/Exiled.API/Features/Attributes/CustomRoleAttribute.cs
+++ b/EXILED/Exiled.API/Features/Attributes/CustomRoleAttribute.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Attributes/DynamicEventDispatcherAttribute.cs b/EXILED/Exiled.API/Features/Attributes/DynamicEventDispatcherAttribute.cs
index 8dfa6780f..bffbbcd5d 100644
--- a/EXILED/Exiled.API/Features/Attributes/DynamicEventDispatcherAttribute.cs
+++ b/EXILED/Exiled.API/Features/Attributes/DynamicEventDispatcherAttribute.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Attributes/PatchGroupAttribute.cs b/EXILED/Exiled.API/Features/Attributes/PatchGroupAttribute.cs
index f510eb0d3..298bff3bd 100644
--- a/EXILED/Exiled.API/Features/Attributes/PatchGroupAttribute.cs
+++ b/EXILED/Exiled.API/Features/Attributes/PatchGroupAttribute.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Attributes/PrefabAttribute.cs b/EXILED/Exiled.API/Features/Attributes/PrefabAttribute.cs
index b2ba66fb7..60d106b06 100644
--- a/EXILED/Exiled.API/Features/Attributes/PrefabAttribute.cs
+++ b/EXILED/Exiled.API/Features/Attributes/PrefabAttribute.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Badge.cs b/EXILED/Exiled.API/Features/Badge.cs
index 31a46f090..cb6fb8882 100644
--- a/EXILED/Exiled.API/Features/Badge.cs
+++ b/EXILED/Exiled.API/Features/Badge.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -20,7 +20,7 @@ public struct Badge
///
/// The badge text.
/// The badge color.
- /// Indicates whether the badge is global or not.
+ /// Indicates whether the badge is global.
public Badge(string text, string color, bool isGlobal = false)
{
Text = text;
@@ -39,16 +39,16 @@ public Badge(string text, string color, bool isGlobal = false)
public string Color { get; }
///
- /// Gets a value indicating whether the badge is global or not.
+ /// Gets a value indicating whether the badge is global.
///
public bool IsGlobal { get; }
///
- /// Gets whether or not the provided hex color code can be used in badges.
+ /// Gets whether the provided hex color code can be used in badges.
///
/// The hex color code, including the #.
/// If the method returns , this will be an enum representing the hex code. If the method returns , this will be .
- /// Whether or not the provided hex color code can be used in badges.
+ /// Whether the provided hex color code can be used in badges.
public static bool IsValidColor(string hex, out Misc.PlayerInfoColorTypes? colorType)
{
foreach (KeyValuePair option in Misc.AllowedColors)
diff --git a/EXILED/Exiled.API/Features/BanManager.cs b/EXILED/Exiled.API/Features/BanManager.cs
new file mode 100644
index 000000000..219c272eb
--- /dev/null
+++ b/EXILED/Exiled.API/Features/BanManager.cs
@@ -0,0 +1,58 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features
+{
+ using System;
+
+ ///
+ /// Useful class to manage player bans.
+ ///
+ public static class BanManager
+ {
+ ///
+ /// Bans an offline player.
+ ///
+ /// Type of the ban (UserID/IP).
+ /// The UserID or IP address to ban.
+ /// The ban reason.
+ /// A representing the duration.
+ /// The Nickname of the ban issuer.
+ /// Whether the ban was successful.
+ public static bool OfflineBanPlayer(BanHandler.BanType banType, string id, string reason, TimeSpan duration, string issuer = "SERVER CONSOLE") => OfflineBanPlayer(banType, id, reason, duration.TotalSeconds, issuer);
+
+ ///
+ /// Bans an offline player.
+ ///
+ /// Type of the ban (UserID/IP).
+ /// The UserID or IP address to ban.
+ /// The ban reason.
+ /// Duration in seconds.
+ /// The Nickname of the ban issuer.
+ /// Whether the ban was successful.
+ public static bool OfflineBanPlayer(BanHandler.BanType banType, string id, string reason, double duration, string issuer = "SERVER CONSOLE")
+ {
+ BanDetails details = new()
+ {
+ OriginalName = "Unknown - offline ban",
+ Id = id,
+ IssuanceTime = DateTime.UtcNow.Ticks,
+ Expires = DateTime.UtcNow.AddSeconds(duration).Ticks,
+ Reason = reason,
+ Issuer = issuer,
+ };
+ return BanHandler.IssueBan(details, banType);
+ }
+
+ ///
+ /// Unbans a player.
+ ///
+ /// Type of the ban (UserID/IP).
+ /// The UserID or IP address to ban.\
+ public static void UnbanPlayer(BanHandler.BanType banType, string id) => BanHandler.RemoveBan(id, banType);
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Broadcast.cs b/EXILED/Exiled.API/Features/Broadcast.cs
index d8196d181..6c82e747d 100644
--- a/EXILED/Exiled.API/Features/Broadcast.cs
+++ b/EXILED/Exiled.API/Features/Broadcast.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -27,7 +27,7 @@ public Broadcast()
///
/// The content of the broadcast>.
/// The duration of the broadcast, in seconds.
- /// Whether or not the broadcast should be shown.
+ /// Whether the broadcast should be shown.
/// The type of the broadcast.
public Broadcast(string content, ushort duration = 10, bool show = true, global::Broadcast.BroadcastFlags type = global::Broadcast.BroadcastFlags.Normal)
{
@@ -56,9 +56,9 @@ public Broadcast(string content, ushort duration = 10, bool show = true, global:
public global::Broadcast.BroadcastFlags Type { get; set; }
///
- /// Gets or sets a value indicating whether the broadcast should be shown or not.
+ /// Gets or sets a value indicating whether the broadcast should be shown.
///
- [Description("Indicates whether the broadcast should be shown or not")]
+ [Description("Indicates whether the broadcast should be shown")]
public bool Show { get; set; }
///
diff --git a/EXILED/Exiled.API/Features/Camera.cs b/EXILED/Exiled.API/Features/Camera.cs
index 56e7e7f24..6c7248573 100644
--- a/EXILED/Exiled.API/Features/Camera.cs
+++ b/EXILED/Exiled.API/Features/Camera.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -77,9 +77,6 @@ public class Camera : IWrapper, IWorldSpace
["HCZ ELEV SYS B"] = CameraType.HczElevSysB,
["HCZ HALLWAY"] = CameraType.HczHallway,
["HCZ THREE-WAY"] = CameraType.HczThreeWay,
- ["SERVERS BOTTOM"] = CameraType.HczServersBottom,
- ["SERVERS STAIRS"] = CameraType.HczServersStairs,
- ["SERVERS TOP"] = CameraType.HczServersTop,
["TESLA GATE"] = CameraType.HczTeslaGate,
["TESTROOM BRIDGE"] = CameraType.HczTestroomBridge,
["TESTROOM MAIN"] = CameraType.HczTestroomMain,
@@ -124,6 +121,21 @@ public class Camera : IWrapper, IWorldSpace
["SURFACE AIRLOCK"] = CameraType.SurfaceAirlock,
["SURFACE BRIDGE"] = CameraType.SurfaceBridge,
["TUNNEL ENTRANCE"] = CameraType.TunnelEntrance,
+
+ // new
+ ["JUNK MAIN"] = CameraType.HczJunkMain,
+ ["JUNK HALLWAY"] = CameraType.HczJunkHallway,
+ ["CORNER DEEP"] = CameraType.HczCornerDeep,
+ ["DSS-08"] = CameraType.HczDSS08,
+ ["MICROHID STAIRS"] = CameraType.HczMicroHIDStairs,
+ ["PIPES HALLWAY"] = CameraType.HczPipesHallway,
+ ["PIPES MAIN"] = CameraType.HczPipesMain,
+ ["WARHEAD STARBOARD ELEVATOR"] = CameraType.HczWarheadStarboardElevator,
+ ["MICROHID MAIN"] = CameraType.HczMicroHIDMain,
+ ["MICROHID LAB"] = CameraType.HczMicroHIDLab,
+ ["WARHEAD TOP ELEVATORS"] = CameraType.HczWarheadTopElevators,
+ ["WARHEAD CONNECTOR"] = CameraType.HczWarheadConnector,
+ ["WARHEAD PORT ELEVATOR"] = CameraType.HczWarheadPortElevator,
};
private Room room;
@@ -137,9 +149,9 @@ internal Camera(Scp079Camera camera079)
Base = camera079;
Camera079ToCamera.Add(camera079, this);
Type = GetCameraType();
-#if Debug
+#if DEBUG
if (Type is CameraType.Unknown)
- Log.Error($"[CAMERATYPE UNKNOWN] {this}");
+ Log.Error($"[CAMERATYPE UNKNOWN] {this} BASE = {Base}");
#endif
}
@@ -214,7 +226,7 @@ public Quaternion Rotation
public float Zoom => Base.ZoomAxis.CurrentZoom;
///
- /// Gets or sets a value indicating whether or not this camera is being used by SCP-079.
+ /// Gets or sets a value indicating whether this camera is being used by SCP-079.
///
public bool IsBeingUsed
{
diff --git a/EXILED/Exiled.API/Features/Cassie.cs b/EXILED/Exiled.API/Features/Cassie.cs
index 1cbb11d75..0730f9a5a 100644
--- a/EXILED/Exiled.API/Features/Cassie.cs
+++ b/EXILED/Exiled.API/Features/Cassie.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -35,7 +35,7 @@ public static class Cassie
public static NineTailedFoxAnnouncer Announcer => NineTailedFoxAnnouncer.singleton;
///
- /// Gets a value indicating whether or not C.A.S.S.I.E is currently announcing. Does not include decontamination or Alpha Warhead Messages.
+ /// Gets a value indicating whether C.A.S.S.I.E is currently announcing. Does not include decontamination or Alpha Warhead Messages.
///
public static bool IsSpeaking => Announcer.queue.Count != 0;
@@ -49,7 +49,7 @@ public static class Cassie
///
/// The message to be reproduced.
/// Indicates whether C.A.S.S.I.E has to hold the message.
- /// Indicates whether C.A.S.S.I.E has to make noises or not during the message.
+ /// Indicates whether C.A.S.S.I.E has to make noises during the message.
/// Indicates whether C.A.S.S.I.E has to make subtitles.
public static void Message(string message, bool isHeld = false, bool isNoisy = true, bool isSubtitles = false) =>
RespawnEffectsController.PlayCassieAnnouncement(message, isHeld, isNoisy, isSubtitles);
@@ -60,7 +60,7 @@ public static void Message(string message, bool isHeld = false, bool isNoisy = t
/// The message to be reproduced.
/// The translation should be show in the subtitles.
/// Indicates whether C.A.S.S.I.E has to hold the message.
- /// Indicates whether C.A.S.S.I.E has to make noises or not during the message.
+ /// Indicates whether C.A.S.S.I.E has to make noises during the message.
/// Indicates whether C.A.S.S.I.E has to make subtitles.
public static void MessageTranslated(string message, string translation, bool isHeld = false, bool isNoisy = true, bool isSubtitles = true)
{
@@ -89,7 +89,7 @@ public static void GlitchyMessage(string message, float glitchChance, float jamC
/// The message to be reproduced.
/// The seconds that have to pass before reproducing the message.
/// Indicates whether C.A.S.S.I.E has to hold the message.
- /// Indicates whether C.A.S.S.I.E has to make noises or not during the message.
+ /// Indicates whether C.A.S.S.I.E has to make noises during the message.
/// Indicates whether C.A.S.S.I.E has to make subtitles.
public static void DelayedMessage(string message, float delay, bool isHeld = false, bool isNoisy = true, bool isSubtitles = false) =>
Timing.CallDelayed(delay, () => RespawnEffectsController.PlayCassieAnnouncement(message, isHeld, isNoisy, isSubtitles));
@@ -170,14 +170,14 @@ public static void CustomScpTermination(string scpName, CustomHandlerBase info)
public static void Clear() => RespawnEffectsController.ClearQueue();
///
- /// Gets a value indicating whether or not the given word is a valid C.A.S.S.I.E word.
+ /// Gets a value indicating whether the given word is a valid C.A.S.S.I.E word.
///
/// The word to check.
/// if the word is valid; otherwise, .
public static bool IsValid(string word) => Announcer.voiceLines.Any(line => line.apiName.ToUpper() == word.ToUpper());
///
- /// Gets a value indicating whether or not the given sentence is all valid C.A.S.S.I.E word.
+ /// Gets a value indicating whether the given sentence is all valid C.A.S.S.I.E word.
///
/// The sentence to check.
/// if the sentence is valid; otherwise, .
diff --git a/EXILED/Exiled.API/Features/Components/CollisionHandler.cs b/EXILED/Exiled.API/Features/Components/CollisionHandler.cs
index db956103b..2cd1cd220 100644
--- a/EXILED/Exiled.API/Features/Components/CollisionHandler.cs
+++ b/EXILED/Exiled.API/Features/Components/CollisionHandler.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -56,9 +56,11 @@ private void OnCollisionEnter(Collision collision)
Log.Error("Grenade is null!");
if (collision is null)
Log.Error("wat");
- if (collision.gameObject == null)
+ if (collision.collider)
+ Log.Error("water");
+ if (collision.collider.gameObject == null)
Log.Error("pepehm");
- if (collision.gameObject == Owner || collision.gameObject.TryGetComponent(out _))
+ if (collision.collider.gameObject == Owner || collision.collider.gameObject.TryGetComponent(out _))
return;
Grenade.TargetTime = 0.1f;
diff --git a/EXILED/Exiled.API/Features/Components/FakeConnection.cs b/EXILED/Exiled.API/Features/Components/FakeConnection.cs
index 638a28cae..a6cfe4d20 100644
--- a/EXILED/Exiled.API/Features/Components/FakeConnection.cs
+++ b/EXILED/Exiled.API/Features/Components/FakeConnection.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/ComponentsEqualityComparer.cs b/EXILED/Exiled.API/Features/ComponentsEqualityComparer.cs
index 804bc8550..a61a7f160 100644
--- a/EXILED/Exiled.API/Features/ComponentsEqualityComparer.cs
+++ b/EXILED/Exiled.API/Features/ComponentsEqualityComparer.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Core/Attributes/ManagedObjectTypeAttribute.cs b/EXILED/Exiled.API/Features/Core/Attributes/ManagedObjectTypeAttribute.cs
index 2dfaee470..84e5800c0 100644
--- a/EXILED/Exiled.API/Features/Core/Attributes/ManagedObjectTypeAttribute.cs
+++ b/EXILED/Exiled.API/Features/Core/Attributes/ManagedObjectTypeAttribute.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Core/Attributes/StateAttribute.cs b/EXILED/Exiled.API/Features/Core/Attributes/StateAttribute.cs
index 4f36114d8..42feb6e13 100644
--- a/EXILED/Exiled.API/Features/Core/Attributes/StateAttribute.cs
+++ b/EXILED/Exiled.API/Features/Core/Attributes/StateAttribute.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Core/EActor.cs b/EXILED/Exiled.API/Features/Core/EActor.cs
index 5ee696f7a..f7f6beca7 100644
--- a/EXILED/Exiled.API/Features/Core/EActor.cs
+++ b/EXILED/Exiled.API/Features/Core/EActor.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Core/EBehaviour.cs b/EXILED/Exiled.API/Features/Core/EBehaviour.cs
index cede0af68..d14cdc7b0 100644
--- a/EXILED/Exiled.API/Features/Core/EBehaviour.cs
+++ b/EXILED/Exiled.API/Features/Core/EBehaviour.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Core/EObject.cs b/EXILED/Exiled.API/Features/Core/EObject.cs
index b0402ee06..bf6d85bab 100644
--- a/EXILED/Exiled.API/Features/Core/EObject.cs
+++ b/EXILED/Exiled.API/Features/Core/EObject.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Core/Generic/EBehaviour.cs b/EXILED/Exiled.API/Features/Core/Generic/EBehaviour.cs
index 403ad2daa..7bd14fb6e 100644
--- a/EXILED/Exiled.API/Features/Core/Generic/EBehaviour.cs
+++ b/EXILED/Exiled.API/Features/Core/Generic/EBehaviour.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Core/Generic/EnumClass.cs b/EXILED/Exiled.API/Features/Core/Generic/EnumClass.cs
index e0e083fc7..5f883d0bc 100644
--- a/EXILED/Exiled.API/Features/Core/Generic/EnumClass.cs
+++ b/EXILED/Exiled.API/Features/Core/Generic/EnumClass.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Core/Generic/Singleton.cs b/EXILED/Exiled.API/Features/Core/Generic/Singleton.cs
index 9b4809e65..eb18c0c2c 100644
--- a/EXILED/Exiled.API/Features/Core/Generic/Singleton.cs
+++ b/EXILED/Exiled.API/Features/Core/Generic/Singleton.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Core/Generic/StaticActor.cs b/EXILED/Exiled.API/Features/Core/Generic/StaticActor.cs
index 90019ede2..c50e9c181 100644
--- a/EXILED/Exiled.API/Features/Core/Generic/StaticActor.cs
+++ b/EXILED/Exiled.API/Features/Core/Generic/StaticActor.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Core/Generic/UnmanagedEnumClass.cs b/EXILED/Exiled.API/Features/Core/Generic/UnmanagedEnumClass.cs
index 3fd300482..7928f3878 100644
--- a/EXILED/Exiled.API/Features/Core/Generic/UnmanagedEnumClass.cs
+++ b/EXILED/Exiled.API/Features/Core/Generic/UnmanagedEnumClass.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Core/Interfaces/IEntity.cs b/EXILED/Exiled.API/Features/Core/Interfaces/IEntity.cs
index 1d75e9c41..8e14c4053 100644
--- a/EXILED/Exiled.API/Features/Core/Interfaces/IEntity.cs
+++ b/EXILED/Exiled.API/Features/Core/Interfaces/IEntity.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -102,7 +102,7 @@ public abstract bool TryGetComponent(Type type, out T component)
/// Checks if the has an active component.
///
/// The to look for.
- /// A value indicating whether or not subclasses should be considered.
+ /// A value indicating whether subclasses should be considered.
/// if the component was found; otherwise, .
public abstract bool HasComponent(bool depthInheritance = false);
@@ -110,7 +110,7 @@ public abstract bool TryGetComponent(Type type, out T component)
/// Checks if the has an active component.
///
/// The to look for.
- /// A value indicating whether or not subclasses should be considered.
+ /// A value indicating whether subclasses should be considered.
/// if the component was found; otherwise, .
public abstract bool HasComponent(Type type, bool depthInheritance = false);
}
diff --git a/EXILED/Exiled.API/Features/Core/StateMachine/IState.cs b/EXILED/Exiled.API/Features/Core/StateMachine/IState.cs
index b580ce728..9d338ff71 100644
--- a/EXILED/Exiled.API/Features/Core/StateMachine/IState.cs
+++ b/EXILED/Exiled.API/Features/Core/StateMachine/IState.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Core/StateMachine/State.cs b/EXILED/Exiled.API/Features/Core/StateMachine/State.cs
index ecab41aa0..e790e61a8 100644
--- a/EXILED/Exiled.API/Features/Core/StateMachine/State.cs
+++ b/EXILED/Exiled.API/Features/Core/StateMachine/State.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Core/StateMachine/StateController.cs b/EXILED/Exiled.API/Features/Core/StateMachine/StateController.cs
index e3f1b485b..bce10ed68 100644
--- a/EXILED/Exiled.API/Features/Core/StateMachine/StateController.cs
+++ b/EXILED/Exiled.API/Features/Core/StateMachine/StateController.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Core/StaticActor.cs b/EXILED/Exiled.API/Features/Core/StaticActor.cs
index 7362ce74b..e6c4cc08b 100644
--- a/EXILED/Exiled.API/Features/Core/StaticActor.cs
+++ b/EXILED/Exiled.API/Features/Core/StaticActor.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Core/TickComponent.cs b/EXILED/Exiled.API/Features/Core/TickComponent.cs
index 8ed3890b3..c315c7409 100644
--- a/EXILED/Exiled.API/Features/Core/TickComponent.cs
+++ b/EXILED/Exiled.API/Features/Core/TickComponent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Core/TypeCastObject.cs b/EXILED/Exiled.API/Features/Core/TypeCastObject.cs
index 376ad0e86..4fba56d5a 100644
--- a/EXILED/Exiled.API/Features/Core/TypeCastObject.cs
+++ b/EXILED/Exiled.API/Features/Core/TypeCastObject.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Core/UserSettings/ButtonSetting.cs b/EXILED/Exiled.API/Features/Core/UserSettings/ButtonSetting.cs
new file mode 100644
index 000000000..5144f81ff
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Core/UserSettings/ButtonSetting.cs
@@ -0,0 +1,88 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Core.UserSettings
+{
+ using System;
+ using System.Diagnostics;
+
+ using Exiled.API.Interfaces;
+ using global::UserSettings.ServerSpecific;
+
+ ///
+ /// Represents a button setting.
+ ///
+ public class ButtonSetting : SettingBase, IWrapper
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public ButtonSetting(int id, string label, string buttonText, float holdTime = 0.0f, string hintDescription = null, HeaderSetting header = null, Action onChanged = null)
+ : base(new SSButton(id, label, buttonText, holdTime, hintDescription), header, onChanged)
+ {
+ Base = (SSButton)base.Base;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// A instance.
+ internal ButtonSetting(SSButton settingBase)
+ : base(settingBase)
+ {
+ Base = settingBase;
+
+ if (OriginalDefinition.Is(out ButtonSetting setting))
+ {
+ Text = setting.Text;
+ HoldTime = setting.HoldTime;
+ }
+ }
+
+ ///
+ public new SSButton Base { get; }
+
+ ///
+ /// Gets the last press time.
+ ///
+ public Stopwatch LastPress => Base.SyncLastPress;
+
+ ///
+ /// Gets or sets the button text.
+ ///
+ public string Text
+ {
+ get => Base.ButtonText;
+ set => Base.ButtonText = value;
+ }
+
+ ///
+ /// Gets or sets the hold time in seconds.
+ ///
+ public float HoldTime
+ {
+ get => Base.HoldTimeSeconds;
+ set => Base.HoldTimeSeconds = value;
+ }
+
+ ///
+ /// Returns a representation of this .
+ ///
+ /// A string in human-readable format.
+ public override string ToString()
+ {
+ return base.ToString() + $" ={Text}= -{HoldTime}- /{LastPress}/";
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Core/UserSettings/DropdownSetting.cs b/EXILED/Exiled.API/Features/Core/UserSettings/DropdownSetting.cs
new file mode 100644
index 000000000..f03e6c070
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Core/UserSettings/DropdownSetting.cs
@@ -0,0 +1,128 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Core.UserSettings
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ using Exiled.API.Interfaces;
+ using global::UserSettings.ServerSpecific;
+
+ ///
+ /// Represents a dropdown setting.
+ ///
+ public class DropdownSetting : SettingBase, IWrapper
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public DropdownSetting(
+ int id,
+ string label,
+ IEnumerable options,
+ int defaultOptionIndex = 0,
+ SSDropdownSetting.DropdownEntryType dropdownEntryType = SSDropdownSetting.DropdownEntryType.Regular,
+ string hintDescription = null,
+ HeaderSetting header = null,
+ Action onChanged = null)
+ : base(new SSDropdownSetting(id, label, options.ToArray(), defaultOptionIndex, dropdownEntryType, hintDescription), header, onChanged)
+ {
+ Base = (SSDropdownSetting)base.Base;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// A instance.
+ internal DropdownSetting(SSDropdownSetting settingBase)
+ : base(settingBase)
+ {
+ Base = settingBase;
+
+ if (OriginalDefinition.Is(out DropdownSetting dropdown))
+ {
+ Options = dropdown.Options;
+ }
+ }
+
+ ///
+ public new SSDropdownSetting Base { get; }
+
+ ///
+ /// Gets or sets a collection of all options in dropdown.
+ ///
+ public IEnumerable Options
+ {
+ get => Base.Options;
+ set => Base.Options = value.ToArray();
+ }
+
+ ///
+ /// Gets or sets an index of default option.
+ ///
+ public int DefaultOptionIndex
+ {
+ get => Base.DefaultOptionIndex;
+ set => Base.DefaultOptionIndex = value;
+ }
+
+ ///
+ /// Gets or sets a default option.
+ ///
+ public string DefaultOption
+ {
+ get => Base.Options[DefaultOptionIndex];
+ set => DefaultOptionIndex = Array.IndexOf(Base.Options, value);
+ }
+
+ ///
+ /// Gets or sets a type of dropdown.
+ ///
+ public SSDropdownSetting.DropdownEntryType DropdownType
+ {
+ get => Base.EntryType;
+ set => Base.EntryType = value;
+ }
+
+ ///
+ /// Gets or sets an index of selected option.
+ ///
+ public int SelectedIndex
+ {
+ get => Base.SyncSelectionIndexRaw;
+ set => Base.SyncSelectionIndexRaw = value;
+ }
+
+ ///
+ /// Gets or sets a selected option.
+ ///
+ public string SelectedOption
+ {
+ get => Base.SyncSelectionText;
+ set => SelectedIndex = Array.IndexOf(Base.Options, value);
+ }
+
+ ///
+ /// Gets a string representation of this .
+ ///
+ /// A string in human-readable format.
+ public override string ToString()
+ {
+ return base.ToString() + $" ={DefaultOptionIndex}= -{SelectedIndex}- /{string.Join(";", Options)}/";
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Core/UserSettings/HeaderSetting.cs b/EXILED/Exiled.API/Features/Core/UserSettings/HeaderSetting.cs
new file mode 100644
index 000000000..78fd4ee32
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Core/UserSettings/HeaderSetting.cs
@@ -0,0 +1,64 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Core.UserSettings
+{
+ using Exiled.API.Interfaces;
+ using global::UserSettings.ServerSpecific;
+
+ ///
+ /// Represents a header setting.
+ ///
+ public class HeaderSetting : SettingBase, IWrapper
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ ///
+ ///
+ public HeaderSetting(string name, string hintDescription = "", bool paddling = false)
+ : this(new SSGroupHeader(name, paddling, hintDescription))
+ {
+ Base = (SSGroupHeader)base.Base;
+
+ Base.SetId(null, name);
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// A instance.
+ internal HeaderSetting(SSGroupHeader settingBase)
+ : base(settingBase)
+ {
+ Base = settingBase;
+ Base.SetId(null, settingBase.Label);
+ }
+
+ ///
+ public new SSGroupHeader Base { get; }
+
+ ///
+ /// Gets or sets a value indicating whether to reduce padding.
+ ///
+ public bool ReducedPaddling
+ {
+ get => Base.ReducedPadding;
+ set => Base.ReducedPadding = value;
+ }
+
+ ///
+ /// Returns a representation of this .
+ ///
+ /// A string in human-readable format.
+ public override string ToString()
+ {
+ return base.ToString() + $" /{ReducedPaddling}/";
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Core/UserSettings/KeybindSetting.cs b/EXILED/Exiled.API/Features/Core/UserSettings/KeybindSetting.cs
new file mode 100644
index 000000000..cfb6b3bbc
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Core/UserSettings/KeybindSetting.cs
@@ -0,0 +1,82 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Core.UserSettings
+{
+ using System;
+
+ using Exiled.API.Interfaces;
+ using global::UserSettings.ServerSpecific;
+ using UnityEngine;
+
+ ///
+ /// Represents a keybind setting.
+ ///
+ public class KeybindSetting : SettingBase, IWrapper
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public KeybindSetting(int id, string label, KeyCode suggested, bool preventInteractionOnGUI = false, string hintDescription = "", HeaderSetting header = null, Action onChanged = null)
+ : base(new SSKeybindSetting(id, label, suggested, preventInteractionOnGUI, hintDescription), header, onChanged)
+ {
+ Base = (SSKeybindSetting)base.Base;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// A instance.
+ internal KeybindSetting(SSKeybindSetting settingBase)
+ : base(settingBase)
+ {
+ Base = settingBase;
+ }
+
+ ///
+ public new SSKeybindSetting Base { get; }
+
+ ///
+ /// Gets a value indicating whether the key is pressed.
+ ///
+ public bool IsPressed => Base.SyncIsPressed;
+
+ ///
+ /// Gets or sets a value indicating whether the interaction is prevented while player is in RA, Settings etc.
+ ///
+ public bool PreventInteractionOnGUI
+ {
+ get => Base.PreventInteractionOnGUI;
+ set => Base.PreventInteractionOnGUI = value;
+ }
+
+ ///
+ /// Gets or sets the assigned key.
+ ///
+ public KeyCode KeyCode
+ {
+ get => Base.SuggestedKey;
+ set => Base.SuggestedKey = value;
+ }
+
+ ///
+ /// Returns a representation of this .
+ ///
+ /// A string in human-readable format.
+ public override string ToString()
+ {
+ return base.ToString() + $" /{IsPressed}/ *{KeyCode}* +{PreventInteractionOnGUI}+";
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Core/UserSettings/SettingBase.cs b/EXILED/Exiled.API/Features/Core/UserSettings/SettingBase.cs
new file mode 100644
index 000000000..840128485
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Core/UserSettings/SettingBase.cs
@@ -0,0 +1,334 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Core.UserSettings
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Collections.ObjectModel;
+ using System.Linq;
+
+ using Exiled.API.Features.Pools;
+ using Exiled.API.Interfaces;
+ using global::UserSettings.ServerSpecific;
+
+ ///
+ /// A base class for all Server Specific Settings.
+ ///
+ public class SettingBase : TypeCastObject, IWrapper
+ {
+ ///
+ /// A that contains that were received by a players.
+ ///
+ internal static readonly Dictionary> ReceivedSettings = new();
+
+ ///
+ /// A collection that contains all settings that were sent to clients.
+ ///
+ internal static readonly List Settings = new();
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// A instance.
+ ///
+ ///
+ internal SettingBase(ServerSpecificSettingBase settingBase, HeaderSetting header, Action onChanged)
+ {
+ Base = settingBase;
+
+ Header = header;
+ OnChanged = onChanged;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ internal SettingBase(ServerSpecificSettingBase settingBase)
+ {
+ Base = settingBase;
+
+ if (OriginalDefinition != null)
+ {
+ Header = OriginalDefinition.Header;
+ OnChanged = OriginalDefinition.OnChanged;
+ Label = OriginalDefinition.Label;
+ HintDescription = OriginalDefinition.HintDescription;
+ }
+ }
+
+ ///
+ /// Gets the list of all synced settings.
+ ///
+ public static IReadOnlyDictionary> SyncedList
+ => new ReadOnlyDictionary>(ReceivedSettings.ToDictionary(x => x.Key, x => x.Value.AsReadOnly()));
+
+ ///
+ /// Gets the list of settings that were used as a prefabs.
+ ///
+ public static IReadOnlyCollection List => Settings;
+
+ ///
+ /// Gets or sets the predicate for syncing this setting when a player joins.
+ ///
+ public static Predicate SyncOnJoin { get; set; }
+
+ ///
+ public ServerSpecificSettingBase Base { get; }
+
+ ///
+ /// Gets or sets the id of this setting.
+ ///
+ public int Id
+ {
+ get => Base.SettingId;
+ set => Base.SetId(value, string.Empty);
+ }
+
+ ///
+ /// Gets or sets the label of this setting.
+ ///
+ public string Label
+ {
+ get => Base.Label;
+ set => Base.Label = value;
+ }
+
+ ///
+ /// Gets or sets the description of this setting.
+ ///
+ public string HintDescription
+ {
+ get => Base.HintDescription;
+ set => Base.HintDescription = value;
+ }
+
+ ///
+ /// Gets the response mode of this setting.
+ ///
+ public ServerSpecificSettingBase.UserResponseMode ResponseMode => Base.ResponseMode;
+
+ ///
+ /// Gets the setting that was sent to players.
+ ///
+ /// Can be null if this is a prefab.
+ public SettingBase OriginalDefinition => Settings.Find(x => x.Id == Id);
+
+ ///
+ /// Gets or sets the header of this setting.
+ ///
+ /// Can be null.
+ public HeaderSetting Header { get; set; }
+
+ ///
+ /// Gets or sets the action to be executed when this setting is changed.
+ ///
+ public Action OnChanged { get; set; }
+
+ ///
+ /// Tries ti get the setting with the specified id.
+ ///
+ /// Player who has received the setting.
+ /// Id of the setting.
+ /// A instance if found. Otherwise, null.
+ /// Type of the setting.
+ /// true if the setting was found, false otherwise.
+ public static bool TryGetSetting(Player player, int id, out T setting)
+ where T : SettingBase
+ {
+ setting = null;
+
+ if (!ReceivedSettings.TryGetValue(player, out List list))
+ return false;
+
+ setting = (T)list.FirstOrDefault(x => x.Id == id);
+ return setting != null;
+ }
+
+ ///
+ /// Tries to get the setting with the specified id.
+ ///
+ /// Player who has received the setting.
+ /// Id of the setting.
+ /// A instance if found. Otherwise, null.
+ /// true if the setting was found, false otherwise.
+ public static bool TryGetSetting(Player player, int id, out SettingBase setting) => TryGetSetting(player, id, out setting);
+
+ ///
+ /// Creates a new instance of this setting.
+ ///
+ /// A instance.
+ /// A new instance of this setting.
+ ///
+ /// This method is used only to create a new instance of from an existing instance.
+ /// New setting won't be synced with players.
+ ///
+ public static SettingBase Create(ServerSpecificSettingBase settingBase) => settingBase switch
+ {
+ SSButton button => new ButtonSetting(button),
+ SSDropdownSetting dropdownSetting => new DropdownSetting(dropdownSetting),
+ SSTextArea textArea => new TextInputSetting(textArea),
+ SSGroupHeader header => new HeaderSetting(header),
+ SSKeybindSetting keybindSetting => new KeybindSetting(keybindSetting),
+ SSTwoButtonsSetting twoButtonsSetting => new TwoButtonsSetting(twoButtonsSetting),
+ _ => new SettingBase(settingBase)
+ };
+
+ ///
+ /// Creates a new instance of this setting.
+ ///
+ /// A instance.
+ /// Type of the setting.
+ /// A new instance of this setting.
+ ///
+ /// This method is used only to create a new instance of from an existing instance.
+ /// New setting won't be synced with players.
+ ///
+ public static T Create(ServerSpecificSettingBase settingBase)
+ where T : SettingBase => (T)Create(settingBase);
+
+ ///
+ /// Syncs setting with all players.
+ ///
+ public static void SendToAll() => ServerSpecificSettingsSync.SendToAll();
+
+ ///
+ /// Syncs setting with all players according to the specified predicate.
+ ///
+ /// A requirement to meet.
+ public static void SendToAll(Func predicate)
+ {
+ foreach (Player player in Player.List)
+ {
+ if (predicate(player))
+ SendToPlayer(player);
+ }
+ }
+
+ ///
+ /// Syncs setting with the specified target.
+ ///
+ /// Target player.
+ public static void SendToPlayer(Player player) => ServerSpecificSettingsSync.SendToPlayer(player.ReferenceHub);
+
+ ///
+ /// Registers all settings from the specified collection.
+ ///
+ /// A collection of settings to register.
+ /// A requirement to meet when sending settings to players.
+ /// A of instances that were successfully registered.
+ /// This method is used to sync new settings with players.
+ public static IEnumerable Register(IEnumerable settings, Func predicate = null)
+ {
+ List list = ListPool.Pool.Get(settings);
+ List list2 = new(list.Count);
+
+ while (list.Exists(x => x.Header != null))
+ {
+ SettingBase setting = list.Find(x => x.Header != null);
+ SettingBase header = list.Find(x => x == setting.Header);
+ List range = list.FindAll(x => x.Header?.Id == setting.Header.Id);
+
+ list2.Add(header);
+ list2.AddRange(range);
+
+ list.Remove(header);
+ list.RemoveAll(x => x.Header?.Id == setting.Header.Id);
+ }
+
+ list2.AddRange(list);
+
+ List list3 = ListPool.Pool.Get(ServerSpecificSettingsSync.DefinedSettings ?? Array.Empty());
+ list3.AddRange(list2.Select(x => x.Base));
+
+ ServerSpecificSettingsSync.DefinedSettings = list3.ToArray();
+ Settings.AddRange(list2);
+
+ if (predicate == null)
+ SendToAll();
+ else
+ SendToAll(predicate);
+
+ ListPool.Pool.Return(list3);
+ ListPool.Pool.Return(list);
+
+ return list2;
+ }
+
+ ///
+ /// Removes settings from players.
+ ///
+ /// Determines which players will receive this update.
+ /// Settings to remove. If null, all settings will be removed.
+ /// A of instances that were successfully removed.
+ /// This method is used to unsync settings from players. Using it with provides an opportunity to update synced settings.
+ public static IEnumerable Unregister(Func predicate = null, IEnumerable settings = null)
+ {
+ List list = ListPool.Pool.Get(ServerSpecificSettingsSync.DefinedSettings);
+ List list2 = new((settings ?? Settings).Where(setting => list.Remove(setting.Base)));
+
+ ServerSpecificSettingsSync.DefinedSettings = list.ToArray();
+
+ if (predicate == null)
+ SendToAll();
+ else
+ SendToAll(predicate);
+
+ ListPool.Pool.Return(list);
+
+ return list2;
+ }
+
+ ///
+ /// Returns a string representation of this .
+ ///
+ /// A string in human-readable format.
+ public override string ToString()
+ {
+ return $"{Id} ({Label}) [{HintDescription}] {{{ResponseMode}}} ^{Header}^";
+ }
+
+ ///
+ /// Internal method that fires when a setting is updated.
+ ///
+ /// that has updates the setting.
+ /// A new updated setting.
+ internal static void OnSettingUpdated(ReferenceHub hub, ServerSpecificSettingBase settingBase)
+ {
+ if (!Player.TryGet(hub, out Player player) || hub.IsHost)
+ return;
+
+ SettingBase setting;
+
+ if (!ReceivedSettings.TryGetValue(player, out List list))
+ {
+ setting = Create(settingBase);
+ ReceivedSettings.Add(player, new() { setting });
+
+ if (setting.Is(out ButtonSetting _))
+ setting.OriginalDefinition.OnChanged?.Invoke(player, setting);
+
+ return;
+ }
+
+ if (!list.Exists(x => x.Id == settingBase.SettingId))
+ {
+ setting = Create(settingBase);
+ list.Add(setting);
+
+ if (setting.Is(out ButtonSetting _))
+ setting.OriginalDefinition.OnChanged?.Invoke(player, setting);
+
+ return;
+ }
+
+ setting = list.Find(x => x.Id == settingBase.SettingId);
+ setting.OriginalDefinition.OnChanged?.Invoke(player, setting);
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Core/UserSettings/TextInputSetting.cs b/EXILED/Exiled.API/Features/Core/UserSettings/TextInputSetting.cs
new file mode 100644
index 000000000..69c7875ad
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Core/UserSettings/TextInputSetting.cs
@@ -0,0 +1,93 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Core.UserSettings
+{
+ using System;
+
+ using Exiled.API.Interfaces;
+ using global::UserSettings.ServerSpecific;
+ using TMPro;
+
+ ///
+ /// Represents a text input setting.
+ ///
+ public class TextInputSetting : SettingBase, IWrapper
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public TextInputSetting(
+ int id,
+ string label,
+ SSTextArea.FoldoutMode foldoutMode = SSTextArea.FoldoutMode.NotCollapsable,
+ TextAlignmentOptions alignment = TextAlignmentOptions.TopLeft,
+ string hintDescription = null,
+ HeaderSetting header = null,
+ Action onChanged = null)
+ : base(new SSTextArea(id, label, foldoutMode, hintDescription, alignment), header, onChanged)
+ {
+ Base = (SSTextArea)base.Base;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// A instance.
+ internal TextInputSetting(SSTextArea settingBase)
+ : base(settingBase)
+ {
+ Base = settingBase;
+ }
+
+ ///
+ public new SSTextArea Base { get; }
+
+ ///
+ /// Gets or sets the text for the setting.
+ ///
+ public new string Label
+ {
+ get => Base.Label;
+ set => Base.SendTextUpdate(value);
+ }
+
+ ///
+ /// Gets or sets the foldout mode.
+ ///
+ public SSTextArea.FoldoutMode FoldoutMode
+ {
+ get => Base.Foldout;
+ set => Base.Foldout = value;
+ }
+
+ ///
+ /// Gets or sets the text alignment options.
+ ///
+ public TextAlignmentOptions Alignment
+ {
+ get => Base.AlignmentOptions;
+ set => Base.AlignmentOptions = value;
+ }
+
+ ///
+ /// Returns a representation of this .
+ ///
+ /// A string in human-readable format.
+ public override string ToString()
+ {
+ return base.ToString() + $" /{FoldoutMode}/ *{Alignment}*";
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Core/UserSettings/TwoButtonsSetting.cs b/EXILED/Exiled.API/Features/Core/UserSettings/TwoButtonsSetting.cs
new file mode 100644
index 000000000..4b2f03a0c
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Core/UserSettings/TwoButtonsSetting.cs
@@ -0,0 +1,110 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Core.UserSettings
+{
+ using System;
+
+ using Exiled.API.Interfaces;
+ using global::UserSettings.ServerSpecific;
+
+ ///
+ /// Represents a two-button setting.
+ ///
+ public class TwoButtonsSetting : SettingBase, IWrapper
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public TwoButtonsSetting(int id, string label, string firstOption, string secondOption, bool defaultIsSecond = false, string hintDescription = "", HeaderSetting header = null, Action onChanged = null)
+ : base(new SSTwoButtonsSetting(id, label, firstOption, secondOption, defaultIsSecond, hintDescription), header, onChanged)
+ {
+ Base = (SSTwoButtonsSetting)base.Base;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// A instance.
+ internal TwoButtonsSetting(SSTwoButtonsSetting settingBase)
+ : base(settingBase)
+ {
+ Base = settingBase;
+
+ if (OriginalDefinition.Is(out TwoButtonsSetting setting))
+ {
+ FirstOption = setting.FirstOption;
+ SecondOption = setting.SecondOption;
+ }
+ }
+
+ ///
+ public new SSTwoButtonsSetting Base { get; }
+
+ ///
+ /// Gets or sets a value indicating whether the second option is chosen.
+ ///
+ public bool IsSecond
+ {
+ get => Base.SyncIsB;
+ set => Base.SyncIsB = value;
+ }
+
+ ///
+ /// Gets or sets a value indicating whether the first option is chosen.
+ ///
+ public bool IsFirst
+ {
+ get => Base.SyncIsA;
+ set => Base.SyncIsB = !value;
+ }
+
+ ///
+ /// Gets or sets a value indicating whether the second option is default.
+ ///
+ public bool IsSecondDefault
+ {
+ get => Base.DefaultIsB;
+ set => Base.DefaultIsB = value;
+ }
+
+ ///
+ /// Gets or sets a label for the first option.
+ ///
+ public string FirstOption
+ {
+ get => Base.OptionA;
+ set => Base.OptionA = value;
+ }
+
+ ///
+ /// Gets or sets a label for the second option.
+ ///
+ public string SecondOption
+ {
+ get => Base.OptionB;
+ set => Base.OptionB = value;
+ }
+
+ ///
+ /// Returns a representation of this .
+ ///
+ /// A string in human-readable format.
+ public override string ToString()
+ {
+ return base.ToString() + $" /{FirstOption}/ *{SecondOption}* +{IsSecondDefault}+ '{IsFirst}'";
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/CustomHealthStat.cs b/EXILED/Exiled.API/Features/CustomHealthStat.cs
index 9cd59ae56..af351bf7a 100644
--- a/EXILED/Exiled.API/Features/CustomHealthStat.cs
+++ b/EXILED/Exiled.API/Features/CustomHealthStat.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/DamageHandlers/AttackerDamageHandler.cs b/EXILED/Exiled.API/Features/DamageHandlers/AttackerDamageHandler.cs
index b7d51716a..577db82ca 100644
--- a/EXILED/Exiled.API/Features/DamageHandlers/AttackerDamageHandler.cs
+++ b/EXILED/Exiled.API/Features/DamageHandlers/AttackerDamageHandler.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/DamageHandlers/CustomDamageHandler.cs b/EXILED/Exiled.API/Features/DamageHandlers/CustomDamageHandler.cs
index 47aa8f4f1..67b464474 100644
--- a/EXILED/Exiled.API/Features/DamageHandlers/CustomDamageHandler.cs
+++ b/EXILED/Exiled.API/Features/DamageHandlers/CustomDamageHandler.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -71,7 +71,7 @@ public CustomDamageHandler(Player target, Player attacker, float damage, DamageT
Base = { Owner = attacker.ReferenceHub },
};
- CustomBase = new FirearmDamageHandler(firearm, target, new BaseFirearmHandler(firearm.Base, damage));
+ CustomBase = new FirearmDamageHandler(firearm, target, new PlayerStatsSystem.FirearmDamageHandler() { Firearm = firearm.Base, Damage = damage });
}
///
diff --git a/EXILED/Exiled.API/Features/DamageHandlers/DamageHandler.cs b/EXILED/Exiled.API/Features/DamageHandlers/DamageHandler.cs
index 41be3a34b..0fb82947b 100644
--- a/EXILED/Exiled.API/Features/DamageHandlers/DamageHandler.cs
+++ b/EXILED/Exiled.API/Features/DamageHandlers/DamageHandler.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/DamageHandlers/DamageHandlerBase.cs b/EXILED/Exiled.API/Features/DamageHandlers/DamageHandlerBase.cs
index c4eed3f05..4446475b8 100644
--- a/EXILED/Exiled.API/Features/DamageHandlers/DamageHandlerBase.cs
+++ b/EXILED/Exiled.API/Features/DamageHandlers/DamageHandlerBase.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/DamageHandlers/FirearmDamageHandler.cs b/EXILED/Exiled.API/Features/DamageHandlers/FirearmDamageHandler.cs
index bef059900..adcd074a3 100644
--- a/EXILED/Exiled.API/Features/DamageHandlers/FirearmDamageHandler.cs
+++ b/EXILED/Exiled.API/Features/DamageHandlers/FirearmDamageHandler.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/DamageHandlers/GenericDamageHandler.cs b/EXILED/Exiled.API/Features/DamageHandlers/GenericDamageHandler.cs
index 56c6ad282..2008936be 100644
--- a/EXILED/Exiled.API/Features/DamageHandlers/GenericDamageHandler.cs
+++ b/EXILED/Exiled.API/Features/DamageHandlers/GenericDamageHandler.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -10,14 +10,12 @@ namespace Exiled.API.Features.DamageHandlers
using Enums;
using Footprinting;
-
using Items;
using PlayerRoles.PlayableScps.Scp096;
using PlayerRoles.PlayableScps.Scp939;
using PlayerStatsSystem;
-
using UnityEngine;
///
@@ -92,6 +90,9 @@ public GenericDamageHandler(Player player, Player attacker, float damage, Damage
case DamageType.SeveredHands:
Base = new UniversalDamageHandler(damage, DeathTranslations.SeveredHands, cassieAnnouncement);
break;
+ case DamageType.SeveredEyes:
+ Base = new UniversalDamageHandler(damage, DeathTranslations.Scp1344, cassieAnnouncement);
+ break;
case DamageType.Warhead:
Base = new WarheadDamageHandler();
break;
@@ -110,10 +111,10 @@ public GenericDamageHandler(Player player, Player attacker, float damage, Damage
case DamageType.MicroHid:
InventorySystem.Items.MicroHID.MicroHIDItem microHidOwner = new();
microHidOwner.Owner = attacker.ReferenceHub;
- Base = new MicroHidDamageHandler(microHidOwner, damage);
+ Base = new MicroHidDamageHandler(damage, microHidOwner);
break;
case DamageType.Explosion:
- Base = new ExplosionDamageHandler(attacker.Footprint, UnityEngine.Vector3.zero, damage, 0);
+ Base = new ExplosionDamageHandler(attacker.Footprint, UnityEngine.Vector3.zero, damage, 0, ExplosionType.Grenade);
break;
case DamageType.Firearm:
GenericFirearm(player, attacker, damage, damageType, ItemType.GunAK);
@@ -155,7 +156,7 @@ public GenericDamageHandler(Player player, Player attacker, float damage, Damage
GenericFirearm(player, attacker, damage, damageType, ItemType.GunA7);
break;
case DamageType.ParticleDisruptor:
- Base = new DisruptorDamageHandler(Attacker, damage);
+ Base = new DisruptorDamageHandler(new (Item.Create(ItemType.ParticleDisruptor, attacker).Base as InventorySystem.Items.Firearms.Firearm, InventorySystem.Items.Firearms.Modules.DisruptorActionModule.FiringState.FiringSingle), Vector3.up, damage);
break;
case DamageType.Scp096:
Scp096Role curr096 = attacker.ReferenceHub.roleManager.CurrentRole as Scp096Role ?? new Scp096Role();
@@ -259,7 +260,7 @@ private void GenericFirearm(Player player, Player attacker, float amount, Damage
Owner = attacker.ReferenceHub,
},
};
- Base = new PlayerStatsSystem.FirearmDamageHandler(firearm.Base, amount);
+ Base = new PlayerStatsSystem.FirearmDamageHandler() { Firearm = firearm.Base, Damage = amount };
}
}
}
diff --git a/EXILED/Exiled.API/Features/DamageHandlers/ScpDamageHandler.cs b/EXILED/Exiled.API/Features/DamageHandlers/ScpDamageHandler.cs
index ebeeedf61..6d44b06d0 100644
--- a/EXILED/Exiled.API/Features/DamageHandlers/ScpDamageHandler.cs
+++ b/EXILED/Exiled.API/Features/DamageHandlers/ScpDamageHandler.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Doors/AirlockController.cs b/EXILED/Exiled.API/Features/Doors/AirlockController.cs
index eceda5f31..6c3a3dae9 100644
--- a/EXILED/Exiled.API/Features/Doors/AirlockController.cs
+++ b/EXILED/Exiled.API/Features/Doors/AirlockController.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -54,7 +54,7 @@ public AirlockController(BaseController controller)
public Door DoorB => Door.Get(Base._doorB);
///
- /// Gets or sets a value indicating whether or not both subdoors are locked.
+ /// Gets or sets a value indicating whether both subdoors are locked.
///
public bool DoorsLocked
{
diff --git a/EXILED/Exiled.API/Features/Doors/BasicDoor.cs b/EXILED/Exiled.API/Features/Doors/BasicDoor.cs
index cfc01cf2c..39316fdd3 100644
--- a/EXILED/Exiled.API/Features/Doors/BasicDoor.cs
+++ b/EXILED/Exiled.API/Features/Doors/BasicDoor.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Doors/BasicNonInteractableDoor.cs b/EXILED/Exiled.API/Features/Doors/BasicNonInteractableDoor.cs
index 477ad176e..55da99e51 100644
--- a/EXILED/Exiled.API/Features/Doors/BasicNonInteractableDoor.cs
+++ b/EXILED/Exiled.API/Features/Doors/BasicNonInteractableDoor.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Doors/BreakableDoor.cs b/EXILED/Exiled.API/Features/Doors/BreakableDoor.cs
index a6b30617d..862332c89 100644
--- a/EXILED/Exiled.API/Features/Doors/BreakableDoor.cs
+++ b/EXILED/Exiled.API/Features/Doors/BreakableDoor.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -47,7 +47,7 @@ public float MaxHealth
}
///
- /// Gets or sets a value indicating whether or not door is destroyed.
+ /// Gets or sets a value indicating whether door is destroyed.
///
public bool IsDestroyed
{
@@ -56,7 +56,7 @@ public bool IsDestroyed
}
///
- /// Gets a value indicating whether or not this door is breakable.
+ /// Gets a value indicating whether this door is breakable.
///
public bool IsBreakable => !IsDestroyed;
@@ -92,6 +92,11 @@ public bool IgnoreRemoteAdmin
set => Base._nonInteractable = value;
}
+ ///
+ /// Repair the door.
+ ///
+ public void Repair() => Base.ServerRepair();
+
///
/// Damages the door.
///
diff --git a/EXILED/Exiled.API/Features/Doors/CheckpointDoor.cs b/EXILED/Exiled.API/Features/Doors/CheckpointDoor.cs
index 1e31e72ae..837bd5ff7 100644
--- a/EXILED/Exiled.API/Features/Doors/CheckpointDoor.cs
+++ b/EXILED/Exiled.API/Features/Doors/CheckpointDoor.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -133,6 +133,11 @@ public DoorDamageType IgnoredDamage
///
internal List SubDoorsValue { get; } = new();
+ ///
+ /// Repair the door.
+ ///
+ public void Repair() => Base.ServerRepair();
+
///
/// Toggles the state of the doors from .
///
diff --git a/EXILED/Exiled.API/Features/Doors/Door.cs b/EXILED/Exiled.API/Features/Doors/Door.cs
index c06a13b9b..63b4f62ce 100644
--- a/EXILED/Exiled.API/Features/Doors/Door.cs
+++ b/EXILED/Exiled.API/Features/Doors/Door.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -14,17 +14,13 @@ namespace Exiled.API.Features.Doors
using Exiled.API.Enums;
using Exiled.API.Extensions;
using Exiled.API.Features.Core;
- using Exiled.API.Features.Hazards;
using Exiled.API.Interfaces;
- using global::Hazards;
using Interactables.Interobjects;
using Interactables.Interobjects.DoorUtils;
using MEC;
using Mirror;
using UnityEngine;
- using static Interactables.Interobjects.ElevatorManager;
-
using BaseBreakableDoor = Interactables.Interobjects.BreakableDoor;
using BaseKeycardPermissions = Interactables.Interobjects.DoorUtils.KeycardPermissions;
using Breakable = BreakableDoor;
@@ -59,9 +55,9 @@ internal Door(DoorVariant door, List rooms)
}
Type = GetDoorType();
-#if Debug
- if (Type is DoorType.Unknown)
- Log.Error($"[DOORTYPE UNKNOWN] {this}");
+#if DEBUG
+ if (Type is DoorType.UnknownDoor or DoorType.UnknownGate or DoorType.UnknownElevator)
+ Log.Error($"[DOORTYPE UNKNOWN] {this} BASE = {Base}");
#endif
}
@@ -101,7 +97,7 @@ internal Door(DoorVariant door, List rooms)
public IReadOnlyCollection Rooms { get; }
///
- /// Gets a value indicating whether or not the door is fully closed.
+ /// Gets a value indicating whether the door is fully closed.
///
public virtual bool IsFullyClosed => ExactState is 0;
@@ -111,7 +107,7 @@ internal Door(DoorVariant door, List rooms)
public virtual bool IsFullyOpen => ExactState is 1;
///
- /// Gets a value indicating whether or not the door is currently moving.
+ /// Gets a value indicating whether the door is currently moving.
///
public virtual bool IsMoving => !(IsFullyOpen || IsFullyClosed);
@@ -135,32 +131,32 @@ public bool IsOpen
}
///
- /// Gets a value indicating whether or not this door is a gate.
+ /// Gets a value indicating whether this door is a gate.
///
public bool IsGate => this is Gate;
///
- /// Gets a value indicating whether or not this door is a checkpoint door.
+ /// Gets a value indicating whether this door is a checkpoint door.
///
public bool IsCheckpoint => this is Checkpoint;
///
- /// Gets a value indicating whether or not this door is an elevator door.
+ /// Gets a value indicating whether this door is an elevator door.
///
public bool IsElevator => this is Elevator;
///
- /// Gets a value indicating whether or not this door can be damaged.
+ /// Gets a value indicating whether this door can be damaged.
///
public bool IsDamageable => this is Interfaces.IDamageableDoor;
///
- /// Gets a value indicating whether or not this door is non-interactable.
+ /// Gets a value indicating whether this door is non-interactable.
///
public bool IsNonInteractable => this is Interfaces.INonInteractableDoor;
///
- /// Gets a value indicating whether or not this door is subdoor belonging to a checkpoint.
+ /// Gets a value indicating whether this door is subdoor belonging to a checkpoint.
///
public bool IsPartOfCheckpoint => ParentCheckpointDoor is not null;
@@ -170,7 +166,7 @@ public bool IsOpen
public Checkpoint ParentCheckpointDoor { get; internal set; }
///
- /// Gets a value indicating whether or not this door requires a keycard to open.
+ /// Gets a value indicating whether this door requires a keycard to open.
///
///
/// This value is if is equal to .
@@ -204,7 +200,7 @@ public Vector3 Position
}
///
- /// Gets or sets a value indicating whether or not SCP-106 can walk through the door.
+ /// Gets or sets a value indicating whether SCP-106 can walk through the door.
///
public bool AllowsScp106
{
@@ -217,7 +213,7 @@ public bool AllowsScp106
}
///
- /// Gets a value indicating whether or not the door is locked.
+ /// Gets a value indicating whether the door is locked.
///
public bool IsLocked => DoorLockType > 0;
@@ -518,10 +514,22 @@ public void ChangeLock(DoorLockType lockType)
/// The of the lockdown.
public void Lock(float time, DoorLockType lockType)
{
- ChangeLock(lockType);
+ Lock(lockType);
Unlock(time, lockType);
}
+ ///
+ /// Locks all active locks on the door for infinite time.
+ ///
+ /// The of the lockdown.
+ public void Lock(DoorLockType lockType)
+ {
+ DoorLockType locks = DoorLockType;
+ locks |= lockType;
+ Base.NetworkActiveLocks = (ushort)locks;
+ DoorEvents.TriggerAction(Base, IsLocked ? DoorAction.Locked : DoorAction.Unlocked, null);
+ }
+
///
/// Unlocks and clears all active locks on the door.
///
@@ -545,7 +553,7 @@ public void Lock(float time, DoorLockType lockType)
/// Returns the Door in a human-readable format.
///
/// A string containing Door-related data.
- public override string ToString() => $"{Type} ({Zone}) [{Room}] *{DoorLockType}* ={RequiredPermissions.RequiredPermissions}=";
+ public override string ToString() => $"{Type} ({Zone}) [{Room}] *{DoorLockType}* ={RequiredPermissions?.RequiredPermissions}=";
///
/// Creates the door object associated with a specific .
@@ -576,38 +584,38 @@ private DoorType GetDoorType()
{
if (Nametag is null)
{
- string doorName = GameObject.name.GetBefore(' ');
+ string doorName = GameObject.name.GetBefore('(').TrimEnd();
+
return doorName switch
{
- "LCZ" => Room?.Type switch
- {
- RoomType.LczAirlock => (Base.GetComponentInParent() != null) ? DoorType.Airlock : DoorType.LightContainmentDoor,
- _ => DoorType.LightContainmentDoor,
- },
- "HCZ" => DoorType.HeavyContainmentDoor,
- "EZ" => DoorType.EntranceDoor,
- "Prison" => DoorType.PrisonDoor,
- "914" => DoorType.Scp914Door,
- "Intercom" => Room?.Type switch
+ "LCZ PortallessBreakableDoor" => DoorType.Airlock,
+ "LCZ BreakableDoor" => DoorType.LightContainmentDoor,
+ "HCZ BreakableDoor" => DoorType.HeavyContainmentDoor,
+ "HCZ BulkDoor" => DoorType.HeavyBulkDoor,
+ "EZ BreakableDoor" => DoorType.EntranceDoor,
+ "Prison BreakableDoor" => DoorType.PrisonDoor,
+ "914 Door" => DoorType.Scp914Door,
+ "Intercom BreakableDoor" => Room?.Type switch
{
RoomType.HczEzCheckpointA => DoorType.CheckpointArmoryA,
RoomType.HczEzCheckpointB => DoorType.CheckpointArmoryB,
_ => DoorType.UnknownDoor,
},
- "Unsecured" => Room?.Type switch
+ "Unsecured Pryable GateDoor" => Room?.Type switch
{
- RoomType.EzCheckpointHallway => DoorType.CheckpointGate,
+ RoomType.EzCheckpointHallwayA => DoorType.CheckpointGateA,
+ RoomType.EzCheckpointHallwayB => DoorType.CheckpointGateB,
RoomType.Hcz049 => Position.y < -805 ? DoorType.Scp049Gate : DoorType.Scp173NewGate,
_ => DoorType.UnknownGate,
},
- "Elevator" => (Base as Interactables.Interobjects.ElevatorDoor)?.Group switch
+ "Elevator Door" or "Nuke Elevator Door" or "Elevator Door 02" => (Base as Interactables.Interobjects.ElevatorDoor)?.Group switch
{
- ElevatorGroup.Nuke => DoorType.ElevatorNuke,
ElevatorGroup.Scp049 => DoorType.ElevatorScp049,
ElevatorGroup.GateB => DoorType.ElevatorGateB,
ElevatorGroup.GateA => DoorType.ElevatorGateA,
ElevatorGroup.LczA01 or ElevatorGroup.LczA02 => DoorType.ElevatorLczA,
ElevatorGroup.LczB01 or ElevatorGroup.LczB02 => DoorType.ElevatorLczB,
+ ElevatorGroup.Nuke01 or ElevatorGroup.Nuke02 => DoorType.ElevatorNuke,
_ => DoorType.UnknownElevator,
},
_ => DoorType.UnknownDoor,
@@ -629,7 +637,6 @@ private DoorType GetDoorType()
"NUKE_ARMORY" => DoorType.NukeArmory,
"LCZ_ARMORY" => DoorType.LczArmory,
"SURFACE_NUKE" => DoorType.NukeSurface,
- "HID" => DoorType.HID,
"HCZ_ARMORY" => DoorType.HczArmory,
"096" => DoorType.Scp096,
"049_ARMORY" => DoorType.Scp049Armory,
@@ -639,11 +646,11 @@ private DoorType GetDoorType()
"079_FIRST" => DoorType.Scp079First,
"GATE_B" => DoorType.GateB,
"079_SECOND" => DoorType.Scp079Second,
- "SERVERS_BOTTOM" => DoorType.ServersBottom,
"173_CONNECTOR" => DoorType.Scp173Connector,
"LCZ_WC" => DoorType.LczWc,
- "HID_RIGHT" => DoorType.HIDRight,
- "HID_LEFT" => DoorType.HIDLeft,
+ "HID_CHAMBER" => DoorType.HIDChamber,
+ "HID_UPPER" => DoorType.HIDUpper,
+ "HID_LOWER" => DoorType.HIDLower,
"173_ARMORY" => DoorType.Scp173Armory,
"173_GATE" => DoorType.Scp173Gate,
"GR18" => DoorType.GR18Gate,
@@ -652,6 +659,7 @@ private DoorType GetDoorType()
"330_CHAMBER" => DoorType.Scp330Chamber,
"GR18_INNER" => DoorType.GR18Inner,
"939_CRYO" => DoorType.Scp939Cryo,
+ "ESCAPE_FINAL" => DoorType.EscapeFinal,
// Doors spawned by the DoorSpawnPoint component
"LCZ_CAFE" => DoorType.LczCafe,
diff --git a/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs b/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs
index d5d303d10..797378312 100644
--- a/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs
+++ b/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -12,6 +12,7 @@ namespace Exiled.API.Features.Doors
using Exiled.API.Enums;
using Interactables.Interobjects;
+ using UnityEngine;
///
/// Represents an elevator door.
@@ -28,6 +29,8 @@ internal ElevatorDoor(Interactables.Interobjects.ElevatorDoor door, List r
{
Base = door;
Lift = Lift.Get(x => x.Group == Group).FirstOrDefault();
+
+ Panel = Object.FindObjectsOfType().FirstOrDefault(x => x._door == door);
}
///
@@ -36,29 +39,29 @@ internal ElevatorDoor(Interactables.Interobjects.ElevatorDoor door, List r
public new Interactables.Interobjects.ElevatorDoor Base { get; }
///
- /// Gets the that this door's belongs to.
+ /// Gets the that this door's belongs to.
+ ///
+ public ElevatorGroup Group => Base.Group;
+
+ ///
+ /// Gets the associated with this lift.
///
- public ElevatorManager.ElevatorGroup Group => Base.Group;
+ public ElevatorPanel Panel { get; }
///
/// Gets the type according to .
///
public ElevatorType ElevatorType => Group switch
{
- ElevatorManager.ElevatorGroup.Scp049 => ElevatorType.Scp049,
- ElevatorManager.ElevatorGroup.GateA => ElevatorType.GateA,
- ElevatorManager.ElevatorGroup.GateB => ElevatorType.GateB,
- ElevatorManager.ElevatorGroup.LczA01 or ElevatorManager.ElevatorGroup.LczA02 => ElevatorType.LczA,
- ElevatorManager.ElevatorGroup.LczB01 or ElevatorManager.ElevatorGroup.LczB02 => ElevatorType.LczB,
- ElevatorManager.ElevatorGroup.Nuke => ElevatorType.Nuke,
+ ElevatorGroup.Scp049 => ElevatorType.Scp049,
+ ElevatorGroup.GateA => ElevatorType.GateA,
+ ElevatorGroup.GateB => ElevatorType.GateB,
+ ElevatorGroup.LczA01 or ElevatorGroup.LczA02 => ElevatorType.LczA,
+ ElevatorGroup.LczB01 or ElevatorGroup.LczB02 => ElevatorType.LczB,
+ ElevatorGroup.Nuke01 or ElevatorGroup.Nuke02 => ElevatorType.Nuke,
_ => ElevatorType.Unknown,
};
- ///
- /// Gets the target panel for this lift.
- ///
- public ElevatorPanel Panel => Base.TargetPanel;
-
///
/// Gets the associated with this elevator door.
///
diff --git a/EXILED/Exiled.API/Features/Doors/Gate.cs b/EXILED/Exiled.API/Features/Doors/Gate.cs
index 20679cf58..89cbc3ced 100644
--- a/EXILED/Exiled.API/Features/Doors/Gate.cs
+++ b/EXILED/Exiled.API/Features/Doors/Gate.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -41,7 +41,7 @@ public Gate(PryableDoor door, List room)
public IEnumerable PryPositions => Base.PryPositions;
///
- /// Gets a value indicating whether or not the door is fully closed.
+ /// Gets a value indicating whether the door is fully closed.
///
public override bool IsFullyClosed => base.IsFullyClosed && RemainingPryCooldown <= 0;
@@ -51,7 +51,7 @@ public Gate(PryableDoor door, List room)
public override bool IsFullyOpen => base.IsFullyOpen || (Base is Timed173PryableDoor && ExactState is 0.5845918f);
///
- /// Gets a value indicating whether or not the door is currently moving.
+ /// Gets a value indicating whether the door is currently moving.
///
public override bool IsMoving => base.IsMoving || RemainingPryCooldown > 0;
diff --git a/EXILED/Exiled.API/Features/DynamicEvents/DynamicDelegate.cs b/EXILED/Exiled.API/Features/DynamicEvents/DynamicDelegate.cs
index aa584941e..d16a19b35 100644
--- a/EXILED/Exiled.API/Features/DynamicEvents/DynamicDelegate.cs
+++ b/EXILED/Exiled.API/Features/DynamicEvents/DynamicDelegate.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/DynamicEvents/DynamicEventDispatcher.cs b/EXILED/Exiled.API/Features/DynamicEvents/DynamicEventDispatcher.cs
index 11ca0d27e..e594a4bb2 100644
--- a/EXILED/Exiled.API/Features/DynamicEvents/DynamicEventDispatcher.cs
+++ b/EXILED/Exiled.API/Features/DynamicEvents/DynamicEventDispatcher.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/DynamicEvents/DynamicEventManager.cs b/EXILED/Exiled.API/Features/DynamicEvents/DynamicEventManager.cs
index 0a155bbd9..d10818b29 100644
--- a/EXILED/Exiled.API/Features/DynamicEvents/DynamicEventManager.cs
+++ b/EXILED/Exiled.API/Features/DynamicEvents/DynamicEventManager.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/DynamicEvents/IDynamicEventDispatcher.cs b/EXILED/Exiled.API/Features/DynamicEvents/IDynamicEventDispatcher.cs
index 4023bd8e9..95efd40f6 100644
--- a/EXILED/Exiled.API/Features/DynamicEvents/IDynamicEventDispatcher.cs
+++ b/EXILED/Exiled.API/Features/DynamicEvents/IDynamicEventDispatcher.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/DynamicEvents/TDynamicDelegate.cs b/EXILED/Exiled.API/Features/DynamicEvents/TDynamicDelegate.cs
index 351c82ad5..7577b7ccd 100644
--- a/EXILED/Exiled.API/Features/DynamicEvents/TDynamicDelegate.cs
+++ b/EXILED/Exiled.API/Features/DynamicEvents/TDynamicDelegate.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/DynamicEvents/TDynamicEventDispatcher.cs b/EXILED/Exiled.API/Features/DynamicEvents/TDynamicEventDispatcher.cs
index f0c971d1b..dd08e5b64 100644
--- a/EXILED/Exiled.API/Features/DynamicEvents/TDynamicEventDispatcher.cs
+++ b/EXILED/Exiled.API/Features/DynamicEvents/TDynamicEventDispatcher.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Effect.cs b/EXILED/Exiled.API/Features/Effect.cs
index 0f8474a24..f90196691 100644
--- a/EXILED/Exiled.API/Features/Effect.cs
+++ b/EXILED/Exiled.API/Features/Effect.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -47,7 +47,7 @@ public Effect(StatusEffectBase statusEffectBase)
/// The duration of the effect, in seconds.
/// The intensity of the effect.
/// Whether the effect will add duration onto the effect if already active or not.
- /// Whether or not the effect should be enabled.
+ /// Whether the effect should be enabled.
public Effect(EffectType type, float duration, byte intensity = 1, bool addDurationIfActive = false, bool isEnabled = true)
{
Type = type;
@@ -82,9 +82,9 @@ public Effect(EffectType type, float duration, byte intensity = 1, bool addDurat
public bool AddDurationIfActive { get; set; }
///
- /// Gets or sets a value indicating whether the effect should be enabled or not.
+ /// Gets or sets a value indicating whether the effect should be enabled.
///
- [Description("Indicates whether the effect should be enabled or not")]
+ [Description("Indicates whether the effect should be enabled")]
public bool IsEnabled { get; set; }
///
diff --git a/EXILED/Exiled.API/Features/Generator.cs b/EXILED/Exiled.API/Features/Generator.cs
index 315f9af0f..7b8a6b6ba 100644
--- a/EXILED/Exiled.API/Features/Generator.cs
+++ b/EXILED/Exiled.API/Features/Generator.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -247,7 +247,7 @@ public static IEnumerable Get(GeneratorState state)
///
/// The instance.
/// A or if not found.
- /// Whether or not a generator was found.
+ /// Whether a generator was found.
public static bool TryGet(Scp079Generator scp079Generator, out Generator generator)
{
generator = Get(scp079Generator);
@@ -259,7 +259,7 @@ public static bool TryGet(Scp079Generator scp079Generator, out Generator generat
///
/// The to search for.
/// A of matching the .
- /// Whether or not at least one generator was found.
+ /// Whether at least one generator was found.
public static bool TryGet(GeneratorState state, out IEnumerable generators)
{
generators = Get(state);
@@ -271,7 +271,7 @@ public static bool TryGet(GeneratorState state, out IEnumerable gener
///
/// The condition to satify.
/// A of which contains elements that satify the condition.
- /// Whether or not at least one generator was found.
+ /// Whether at least one generator was found.
public static bool TryGet(Func predicate, out IEnumerable generators)
{
generators = Get(predicate);
diff --git a/EXILED/Exiled.API/Features/GlobalPatchProcessor.cs b/EXILED/Exiled.API/Features/GlobalPatchProcessor.cs
index dee1ceda1..f14d8feac 100644
--- a/EXILED/Exiled.API/Features/GlobalPatchProcessor.cs
+++ b/EXILED/Exiled.API/Features/GlobalPatchProcessor.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Hazards/AmnesticCloudHazard.cs b/EXILED/Exiled.API/Features/Hazards/AmnesticCloudHazard.cs
index 31c9ad244..cc9bff8d6 100644
--- a/EXILED/Exiled.API/Features/Hazards/AmnesticCloudHazard.cs
+++ b/EXILED/Exiled.API/Features/Hazards/AmnesticCloudHazard.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// ------------------------------------------------------------------------
@@ -105,7 +105,7 @@ public float MaxHoldTime
}
///
- /// Gets or sets a value indicating whether or not hazard is active or not.
+ /// Gets or sets a value indicating whether hazard is active.
///
public bool TargetState
{
diff --git a/EXILED/Exiled.API/Features/Hazards/Hazard.cs b/EXILED/Exiled.API/Features/Hazards/Hazard.cs
index 09bd880d3..22d620092 100644
--- a/EXILED/Exiled.API/Features/Hazards/Hazard.cs
+++ b/EXILED/Exiled.API/Features/Hazards/Hazard.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -86,7 +86,7 @@ public float MaxHeightDistance
}
///
- /// Gets a value indicating whether or not hazard is active.
+ /// Gets a value indicating whether hazard is active.
///
public bool IsActive => Base.IsActive;
diff --git a/EXILED/Exiled.API/Features/Hazards/SinkholeHazard.cs b/EXILED/Exiled.API/Features/Hazards/SinkholeHazard.cs
index 34cbaacd5..5e368dfd2 100644
--- a/EXILED/Exiled.API/Features/Hazards/SinkholeHazard.cs
+++ b/EXILED/Exiled.API/Features/Hazards/SinkholeHazard.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Hazards/TantrumHazard.cs b/EXILED/Exiled.API/Features/Hazards/TantrumHazard.cs
index 906bd4faf..2e36627d8 100644
--- a/EXILED/Exiled.API/Features/Hazards/TantrumHazard.cs
+++ b/EXILED/Exiled.API/Features/Hazards/TantrumHazard.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -53,7 +53,7 @@ public static TantrumEnvironmentalHazard TantrumPrefab
public override HazardType Type => HazardType.Tantrum;
///
- /// Gets or sets a value indicating whether or not sizzle should be played.
+ /// Gets or sets a value indicating whether sizzle should be played.
///
public bool PlaySizzle
{
@@ -83,7 +83,7 @@ public Transform CorrectPosition
/// Places a Tantrum (SCP-173's ability) in the indicated position.
///
/// The position where you want to spawn the Tantrum.
- /// Whether or not the tantrum will apply the effect.
+ /// Whether the tantrum will apply the effect.
/// If is , the tantrum is moved slightly up from its original position. Otherwise, the collision will not be detected and the slowness will not work.
/// The instance.
public static TantrumHazard PlaceTantrum(Vector3 position, bool isActive = true)
diff --git a/EXILED/Exiled.API/Features/Hazards/TemporaryHazard.cs b/EXILED/Exiled.API/Features/Hazards/TemporaryHazard.cs
index e4afa3dca..0e701a809 100644
--- a/EXILED/Exiled.API/Features/Hazards/TemporaryHazard.cs
+++ b/EXILED/Exiled.API/Features/Hazards/TemporaryHazard.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -30,7 +30,7 @@ public TemporaryHazard(BaseHazard hazard)
public new BaseHazard Base { get; }
///
- /// Gets or sets a value indicating whether or not hazard is destroyed.
+ /// Gets or sets a value indicating whether hazard is destroyed.
///
public bool IsDestroyed
{
diff --git a/EXILED/Exiled.API/Features/Hint.cs b/EXILED/Exiled.API/Features/Hint.cs
index ce74c2e44..eff896874 100644
--- a/EXILED/Exiled.API/Features/Hint.cs
+++ b/EXILED/Exiled.API/Features/Hint.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -27,7 +27,7 @@ public Hint()
///
/// The content of the hint>.
/// The duration of the hint, in seconds.
- /// Whether or not the hint should be shown.
+ /// Whether the hint should be shown.
public Hint(string content, float duration = 3, bool show = true)
{
Content = content;
@@ -48,9 +48,9 @@ public Hint(string content, float duration = 3, bool show = true)
public float Duration { get; set; }
///
- /// Gets or sets a value indicating whether the hint should be shown or not.
+ /// Gets or sets a value indicating whether the hint should be shown.
///
- [Description("Indicates whether the hint should be shown or not")]
+ [Description("Indicates whether the hint should be shown")]
public bool Show { get; set; }
///
diff --git a/EXILED/Exiled.API/Features/Intercom.cs b/EXILED/Exiled.API/Features/Intercom.cs
index 5dbee7241..dde962f91 100644
--- a/EXILED/Exiled.API/Features/Intercom.cs
+++ b/EXILED/Exiled.API/Features/Intercom.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -54,7 +54,7 @@ public static IntercomState State
public static Transform Transform => GameIntercom._singleton.transform;
///
- /// Gets a value indicating whether or not the intercom is currently being used.
+ /// Gets a value indicating whether the intercom is currently being used.
///
public static bool InUse => State is IntercomState.InUse or IntercomState.Starting;
@@ -85,7 +85,7 @@ public static float SpeechRemainingTime
///
/// Plays the intercom's sound.
///
- /// Sets a value indicating whether or not the sound is the intercom's start speaking sound.
+ /// Sets a value indicating whether the sound is the intercom's start speaking sound.
public static void PlaySound(bool isStarting) => GameIntercom._singleton.RpcPlayClip(isStarting);
///
diff --git a/EXILED/Exiled.API/Features/Items/Ammo.cs b/EXILED/Exiled.API/Features/Items/Ammo.cs
index 64c598ad7..d6cf39475 100644
--- a/EXILED/Exiled.API/Features/Items/Ammo.cs
+++ b/EXILED/Exiled.API/Features/Items/Ammo.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Items/Armor.cs b/EXILED/Exiled.API/Features/Items/Armor.cs
index 1a46bc360..6fe2bc097 100644
--- a/EXILED/Exiled.API/Features/Items/Armor.cs
+++ b/EXILED/Exiled.API/Features/Items/Armor.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -60,7 +60,7 @@ internal Armor(ItemType type)
public bool Holsterable => Base.AllowHolster;
///
- /// Gets a value indicating whether or not this is a worn item.
+ /// Gets a value indicating whether this is a worn item.
///
public bool IsWorn => Base.IsWorn;
@@ -74,7 +74,7 @@ internal Armor(ItemType type)
}
///
- /// Gets or sets a value indicating whether or not excess ammo should be removed when the armor is dropped.
+ /// Gets or sets a value indicating whether excess ammo should be removed when the armor is dropped.
///
public bool RemoveExcessOnDrop
{
@@ -115,14 +115,9 @@ public float StaminaUseMultiplier
public float StaminaRegenMultiplier { get; set; } = 1f;
///
- /// Gets or sets how much the users movement speed should be affected when wearing this armor. (higher values = slower movement).
+ /// Gets how much the users movement speed should be affected when wearing this armor. (higher values = slower movement).
///
- public float MovementSpeedMultiplier
- {
- get => Base._movementSpeedMultiplier;
- [Obsolete("This Setter was causing desync to client", true)]
- set => _ = value;
- }
+ public float MovementSpeedMultiplier => Base._movementSpeedMultiplier;
///
/// Gets how much worse and s are affected by wearing this armor.
diff --git a/EXILED/Exiled.API/Features/Items/Consumable.cs b/EXILED/Exiled.API/Features/Items/Consumable.cs
index 55851c04b..6b4ec6c5c 100644
--- a/EXILED/Exiled.API/Features/Items/Consumable.cs
+++ b/EXILED/Exiled.API/Features/Items/Consumable.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Items/ExplosiveGrenade.cs b/EXILED/Exiled.API/Features/Items/ExplosiveGrenade.cs
index 0002d5d76..1ee536c43 100644
--- a/EXILED/Exiled.API/Features/Items/ExplosiveGrenade.cs
+++ b/EXILED/Exiled.API/Features/Items/ExplosiveGrenade.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Items/Firearm.cs b/EXILED/Exiled.API/Features/Items/Firearm.cs
index f9b4b2cec..fb83411f2 100644
--- a/EXILED/Exiled.API/Features/Items/Firearm.cs
+++ b/EXILED/Exiled.API/Features/Items/Firearm.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -12,15 +12,11 @@ namespace Exiled.API.Features.Items
using System.Linq;
using CameraShaking;
-
using Enums;
-
using Exiled.API.Features.Pickups;
using Exiled.API.Interfaces;
using Exiled.API.Structs;
-
using Extensions;
-
using InventorySystem;
using InventorySystem.Items;
using InventorySystem.Items.Firearms;
@@ -29,7 +25,7 @@ namespace Exiled.API.Features.Items
using InventorySystem.Items.Firearms.BasicMessages;
using InventorySystem.Items.Firearms.Modules;
using InventorySystem.Items.Pickups;
-
+ using MEC;
using UnityEngine;
using BaseFirearm = InventorySystem.Items.Firearms.Firearm;
@@ -68,11 +64,10 @@ public Firearm(BaseFirearm itemBase)
internal Firearm(ItemType type)
: this((BaseFirearm)Server.Host.Inventory.CreateItemInstance(new(type, 0), false))
{
- FirearmStatusFlags firearmStatusFlags = FirearmStatusFlags.MagazineInserted;
- if (Base.HasAdvantageFlag(AttachmentDescriptiveAdvantages.Flashlight))
- firearmStatusFlags |= FirearmStatusFlags.FlashlightEnabled;
+ FlashlightAttachment flashlight = Attachments.OfType().FirstOrDefault();
- Base.Status = new FirearmStatus(MaxAmmo, firearmStatusFlags, Base.Status.Attachments);
+ if (flashlight != null && flashlight.IsEnabled)
+ flashlight.ServerSendStatus(true);
}
/// .
@@ -112,37 +107,20 @@ public static IReadOnlyDictionary
/// Gets or sets the amount of ammo in the firearm.
///
- public byte Ammo
+ public int Ammo
{
- get => Base.Status.Ammo;
- set => Base.Status = new FirearmStatus(value, Base.Status.Flags, Base.Status.Attachments);
+ get => (Base.Modules[Array.IndexOf(Base.Modules, typeof(MagazineModule))] as MagazineModule).AmmoStored;
+ set => (Base.Modules[Array.IndexOf(Base.Modules, typeof(MagazineModule))] as MagazineModule).AmmoStored = value;
}
///
/// Gets or sets the max ammo for this firearm.
///
/// Disruptor can't be used for MaxAmmo.
- public byte MaxAmmo
+ public int MaxAmmo
{
- get => Base.AmmoManagerModule.MaxAmmo;
- set
- {
- switch (Base.AmmoManagerModule)
- {
- case TubularMagazineAmmoManager tubularMagazineAmmoManager:
- tubularMagazineAmmoManager.MaxAmmo = (byte)(value - Base.AttachmentsValue(AttachmentParam.MagazineCapacityModifier) - (Base.Status.Flags.HasFlagFast(FirearmStatusFlags.Cocked) ? tubularMagazineAmmoManager.ChamberedRounds : 0));
- break;
- case ClipLoadedInternalMagAmmoManager clipLoadedInternalMagAmmoManager:
- clipLoadedInternalMagAmmoManager.MaxAmmo = (byte)(value - Base.AttachmentsValue(AttachmentParam.MagazineCapacityModifier));
- break;
- case AutomaticAmmoManager automaticAmmoManager:
- automaticAmmoManager.MaxAmmo = (byte)(value - Base.AttachmentsValue(AttachmentParam.MagazineCapacityModifier) - automaticAmmoManager.ChamberedAmount);
- break;
- default:
- Log.Warn($"MaxAmmo can't be used for this Item: {Type} ({Base.AmmoManagerModule})");
- return;
- }
- }
+ get => (Base.Modules[Array.IndexOf(Base.Modules, typeof(MagazineModule))] as MagazineModule).AmmoMax;
+ set => (Base.Modules[Array.IndexOf(Base.Modules, typeof(MagazineModule))] as MagazineModule)._defaultCapacity = value; // Synced?
}
///
@@ -153,17 +131,17 @@ public byte MaxAmmo
///
/// Gets the of the firearm.
///
- public AmmoType AmmoType => Base.AmmoType.GetAmmoType();
+ public AmmoType AmmoType => (Base.Modules.OfType().FirstOrDefault()?.AmmoType ?? ItemType.None).GetAmmoType();
///
/// Gets a value indicating whether the firearm is being aimed.
///
- public bool Aiming => Base.AdsModule.ServerAds;
+ public bool Aiming => Base.Modules.OfType().FirstOrDefault()?.AdsTarget ?? false;
///
/// Gets a value indicating whether the firearm's flashlight module is enabled.
///
- public bool FlashlightEnabled => Base.Status.Flags.HasFlagFast(FirearmStatusFlags.FlashlightEnabled);
+ public bool FlashlightEnabled => Base.IsEmittingLight;
///
/// Gets a value indicating whether the firearm's NightVision is being used.
@@ -176,9 +154,9 @@ public byte MaxAmmo
public bool CanSeeThroughDark => FlashlightEnabled || NightVisionEnabled;
///
- /// Gets a value indicating whether or not the firearm is automatic.
+ /// Gets a value indicating whether the firearm is automatic.
///
- public bool IsAutomatic => Base is AutomaticFirearm;
+ public bool IsAutomatic => Array.Exists(Base.Modules, x => x is AutomaticActionModule);
///
/// Gets the s of the firearm.
@@ -209,11 +187,13 @@ public IEnumerable AttachmentIdentifiers
///
public float FireRate
{
- get => Base is AutomaticFirearm auto ? auto._fireRate : 1f;
+ get => Base.Modules.OfType().FirstOrDefault()?.BaseFireRate ?? 0f;
set
{
- if (Base is AutomaticFirearm auto)
- auto._fireRate = value;
+ AutomaticActionModule module = Base.Modules.OfType().FirstOrDefault();
+
+ if (module != null)
+ module.BaseFireRate = value;
}
}
@@ -224,18 +204,22 @@ public float FireRate
///
public RecoilSettings Recoil
{
- get => Base is AutomaticFirearm auto ? auto._recoil : default;
+ get => Base.Modules.OfType().FirstOrDefault()?.BaseRecoil ?? default;
set
{
- if (Base is AutomaticFirearm auto)
- auto.ActionModule = new AutomaticAction(Base, auto._semiAutomatic, auto._boltTravelTime, 1f / auto._fireRate, auto._dryfireClipId, auto._triggerClipId, auto._gunshotPitchRandomization, value, auto._recoilPattern, false, Mathf.Max(1, auto._chamberSize));
+ RecoilPatternModule module = Base.Modules.OfType().FirstOrDefault();
+
+ if (module != null)
+ module.BaseRecoil = value;
}
}
+ /*
///
/// Gets the firearm's . Will be for non-automatic weapons.
///
public FirearmRecoilPattern RecoilPattern => Base is AutomaticFirearm auto ? auto._recoilPattern : null;
+ */
///
/// Gets a of and [] which contains all available attachments for all firearms.
@@ -277,7 +261,9 @@ public void AddAttachment(AttachmentIdentifier identifier)
: identifier.Code;
Base.ApplyAttachmentsCode((Base.GetCurrentAttachmentsCode() & ~toRemove) | newCode, true);
- Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags, Base.GetCurrentAttachmentsCode());
+
+ // TODO Not finish
+ // Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags, Base.GetCurrentAttachmentsCode());
}
///
@@ -319,10 +305,12 @@ public void RemoveAttachment(AttachmentIdentifier identifier)
Base.ApplyAttachmentsCode(Base.GetCurrentAttachmentsCode() & ~code, true);
+ // TODO: Not finish
+ /*
if (identifier.Name == AttachmentName.Flashlight)
Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags & ~FirearmStatusFlags.FlashlightEnabled, Base.GetCurrentAttachmentsCode());
else
- Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags, Base.GetCurrentAttachmentsCode());
+ Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags, Base.GetCurrentAttachmentsCode());*/
}
///
@@ -335,10 +323,12 @@ public void RemoveAttachment(AttachmentName attachmentName)
Base.ApplyAttachmentsCode(Base.GetCurrentAttachmentsCode() & ~code, true);
+ // TODO Not finish
+ /*
if (attachmentName == AttachmentName.Flashlight)
Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags & ~FirearmStatusFlags.FlashlightEnabled, Base.GetCurrentAttachmentsCode());
else
- Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags, Base.GetCurrentAttachmentsCode());
+ Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags, Base.GetCurrentAttachmentsCode());*/
}
///
@@ -356,10 +346,12 @@ public void RemoveAttachment(AttachmentSlot attachmentSlot)
Base.ApplyAttachmentsCode(Base.GetCurrentAttachmentsCode() & ~code, true);
+ // TODO Not finish
+ /*
if (firearmAttachment.Name == AttachmentName.Flashlight)
Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags & ~FirearmStatusFlags.FlashlightEnabled, Base.GetCurrentAttachmentsCode());
else
- Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags, Base.GetCurrentAttachmentsCode());
+ Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags, Base.GetCurrentAttachmentsCode());*/
}
///
@@ -397,16 +389,6 @@ public void RemoveAttachment(IEnumerable attachmentSlots)
///
public void ClearAttachments() => Base.ApplyAttachmentsCode(BaseCode, true);
- ///
- /// Creates the that based on this .
- ///
- /// The location to spawn the item.
- /// The rotation of the item.
- /// Whether the should be initially spawned.
- /// The created .
- public override Pickup CreatePickup(Vector3 position, Quaternion rotation = default, bool spawn = true)
- => base.CreatePickup(position, rotation, spawn); // TODO: Deleted this overide
-
///
/// Gets a of the specified .
///
@@ -419,7 +401,7 @@ public override Pickup CreatePickup(Vector3 position, Quaternion rotation = defa
///
/// The to check.
/// The corresponding .
- /// A value indicating whether or not the firearm has the specified .
+ /// A value indicating whether the firearm has the specified .
public bool TryGetAttachment(AttachmentIdentifier identifier, out Attachment firearmAttachment)
{
firearmAttachment = default;
@@ -437,7 +419,7 @@ public bool TryGetAttachment(AttachmentIdentifier identifier, out Attachment fir
///
/// The to check.
/// The corresponding .
- /// A value indicating whether or not the firearm has the specified .
+ /// A value indicating whether the firearm has the specified .
public bool TryGetAttachment(AttachmentName attachmentName, out Attachment firearmAttachment)
{
firearmAttachment = default;
@@ -602,6 +584,28 @@ public void ClearPreferences()
ClearPreferences(player);
}
+ ///
+ /// Reloads current .
+ ///
+ /// Whether empty magazine should be loaded.
+ public void Reload(bool emptyMagazine = false)
+ {
+ MagazineModule magazineModule = Base.Modules.OfType().FirstOrDefault();
+
+ if (magazineModule == null)
+ return;
+
+ magazineModule.ServerRemoveMagazine();
+
+ Timing.CallDelayed(0.1f, () =>
+ {
+ if (emptyMagazine)
+ magazineModule.ServerInsertEmptyMagazine();
+ else
+ magazineModule.ServerInsertMagazine();
+ });
+ }
+
///
/// Clones current object.
///
@@ -613,11 +617,13 @@ public override Item Clone()
Ammo = Ammo,
};
+ // TODO Not finish
+ /*
if (cloneableItem.Base is AutomaticFirearm)
{
cloneableItem.FireRate = FireRate;
cloneableItem.Recoil = Recoil;
- }
+ }*/
cloneableItem.AddAttachment(AttachmentIdentifiers);
@@ -632,14 +638,19 @@ public override Item Clone()
internal override void ChangeOwner(Player oldOwner, Player newOwner)
{
Base.Owner = newOwner.ReferenceHub;
+ Base._footprintCacheSet = false;
+ }
- if (Base.HitregModule is StandardHitregBase hitReg)
+ ///
+ internal override void ReadPickupInfo(Pickup pickup)
+ {
+ base.ReadPickupInfo(pickup);
+
+ if (pickup is FirearmPickup firearmPickup)
{
- hitReg.Hub = Base.Owner;
+ // TODO If synced
+ // MaxAmmo = firearmPickup.MaxAmmo;
}
-
- Base._sendStatusNextFrame = true;
- Base._footprintValid = false;
}
}
}
diff --git a/EXILED/Exiled.API/Features/Items/FlashGrenade.cs b/EXILED/Exiled.API/Features/Items/FlashGrenade.cs
index 979784f2c..ccebfa394 100644
--- a/EXILED/Exiled.API/Features/Items/FlashGrenade.cs
+++ b/EXILED/Exiled.API/Features/Items/FlashGrenade.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Items/Flashlight.cs b/EXILED/Exiled.API/Features/Items/Flashlight.cs
index 75cccfd12..93a3876ca 100644
--- a/EXILED/Exiled.API/Features/Items/Flashlight.cs
+++ b/EXILED/Exiled.API/Features/Items/Flashlight.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -45,14 +45,6 @@ internal Flashlight(ItemType type)
/// Can be or .
public new ToggleableLightItemBase Base { get; }
- ///
- [Obsolete("Use IsEmittingLight instead.")]
- public bool Active
- {
- get => IsEmittingLight;
- set => IsEmittingLight = value;
- }
-
///
/// Gets or sets a value indicating whether the item is emitting light.
///
diff --git a/EXILED/Exiled.API/Features/Items/Item.cs b/EXILED/Exiled.API/Features/Items/Item.cs
index 96d02257f..4f2025076 100644
--- a/EXILED/Exiled.API/Features/Items/Item.cs
+++ b/EXILED/Exiled.API/Features/Items/Item.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -13,7 +13,6 @@ namespace Exiled.API.Features.Items
using Exiled.API.Features.Core;
using Exiled.API.Features.Pickups;
using Exiled.API.Interfaces;
-
using InventorySystem;
using InventorySystem.Items;
using InventorySystem.Items.Armor;
@@ -26,6 +25,7 @@ namespace Exiled.API.Features.Items
using InventorySystem.Items.ThrowableProjectiles;
using InventorySystem.Items.ToggleableLights;
using InventorySystem.Items.Usables;
+ using InventorySystem.Items.Usables.Scp1344;
using InventorySystem.Items.Usables.Scp1576;
using InventorySystem.Items.Usables.Scp244;
using InventorySystem.Items.Usables.Scp330;
@@ -125,47 +125,52 @@ public ushort Serial
public float Weight => Base.Weight;
///
- /// Gets a value indicating whether or not this item is ammunition.
+ /// Gets a value indicating whether this item is ammunition.
///
public bool IsAmmo => this is Ammo;
///
- /// Gets a value indicating whether or not this item is armor.
+ /// Gets a value indicating whether this item is armor.
///
public bool IsArmor => this is Armor;
///
- /// Gets a value indicating whether or not this item is a keycard.
+ /// Gets a value indicating whether this item is a keycard.
///
public bool IsKeycard => this is Keycard;
///
- /// Gets a value indicating whether or not this item will be destroy when being used.
+ /// Gets a value indicating whether this item will be destroy when being used.
///
public bool IsConsumable => this is Consumable;
///
- /// Gets a value indicating whether or not this item is a throwable item.
+ /// Gets a value indicating whether this item is a throwable item.
///
public bool IsThrowable => this is Throwable;
///
- /// Gets a value indicating whether or not this item can be used by a player.
+ /// Gets a value indicating whether this item can be used by a player.
///
public bool IsUsable => this is Usable;
///
- /// Gets a value indicating whether or not this item is a weapon.
+ /// Gets a value indicating whether this item is a weapon.
+ ///
+ public bool IsWeapon => this is Firearm || Type is ItemType.Jailbird or ItemType.MicroHID;
+
+ ///
+ /// Gets a value indicating whether or not this item is a firearm.
///
- public bool IsWeapon => this is Firearm;
+ public bool IsFirearm => this is Firearm;
///
- /// Gets a value indicating whether or not this item emits light.
+ /// Gets a value indicating whether this item emits light.
///
public bool IsLightEmitter => Base is ILightEmittingItem;
///
- /// Gets a value indicating whether or not this item can be used to disarm players.
+ /// Gets a value indicating whether this item can be used to disarm players.
///
public bool IsDisarmer => Base is IDisarmingItem;
@@ -174,6 +179,15 @@ public ushort Serial
///
public Player Owner => Player.Get(Base.Owner) ?? Server.Host;
+ ///
+ /// Gets or sets a reason for adding this item to the inventory.
+ ///
+ public ItemAddReason AddReason
+ {
+ get => Base.ServerAddReason;
+ set => Base.ServerAddReason = value;
+ }
+
///
/// Gets an existing or creates a new instance of one.
///
@@ -196,6 +210,7 @@ public static Item Get(ItemBase itemBase)
Scp330Bag scp330Bag => new Scp330(scp330Bag),
Scp244Item scp244Item => new Scp244(scp244Item),
Scp1576Item scp1576 => new Scp1576(scp1576),
+ Scp1344Item scp1344 => new Scp1344(scp1344),
BaseConsumable consumable => new Consumable(consumable),
_ => new Usable(usable),
},
@@ -213,7 +228,7 @@ public static Item Get(ItemBase itemBase)
Scp018Projectile => new Scp018(throwable),
_ => new Throwable(throwable),
},
- _ => new Item(itemBase),
+ _ => new(itemBase),
};
}
@@ -233,6 +248,15 @@ public static T Get(ItemBase itemBase)
/// Returns the Item found or if not found.
public static Item Get(ushort serial) => List.FirstOrDefault(x => x.Serial == serial);
+ ///
+ /// Gets the Item belonging to the specified serial.
+ ///
+ /// The Item serial.
+ /// The specified type.
+ /// Returns the Item found or if not found.
+ public static T Get(ushort serial)
+ where T : Item => Get(serial) as T;
+
///
/// Creates a new with the proper inherited subclass.
///
@@ -254,6 +278,7 @@ public static T Get(ItemBase itemBase)
/// - SCP-330 can be casted to .
/// - SCP-2176 can be casted to the class.
/// - SCP-1576 can be casted to the class.
+ /// - SCP-1344 can be casted to the class.
/// - Jailbird can be casted to the class.
///
///
@@ -282,6 +307,7 @@ ItemType.KeycardGuard or ItemType.KeycardJanitor or ItemType.KeycardO5 or ItemTy
ItemType.SCP330 => new Scp330(),
ItemType.SCP2176 => new Scp2176(owner),
ItemType.SCP1576 => new Scp1576(),
+ ItemType.SCP1344 => new Scp1344(),
ItemType.Jailbird => new Jailbird(),
_ => new Item(type),
};
@@ -307,6 +333,7 @@ ItemType.KeycardGuard or ItemType.KeycardJanitor or ItemType.KeycardO5 or ItemTy
/// - SCP-330 can be casted to .
/// - SCP-2176 can be casted to the class.
/// - SCP-1576 can be casted to the class.
+ /// - SCP-1344 can be casted to the class.
/// - Jailbird can be casted to the class.
///
///
@@ -338,11 +365,11 @@ public static Item Create(ItemType type, Player owner = null)
/// The rotation of the item.
/// Whether the should be initially spawned.
/// The created .
- public virtual Pickup CreatePickup(Vector3 position, Quaternion rotation = default, bool spawn = true)
+ public virtual Pickup CreatePickup(Vector3 position, Quaternion? rotation = null, bool spawn = true)
{
PickupSyncInfo info = new(Type, Weight, Serial);
- ItemPickupBase ipb = InventoryExtensions.ServerCreatePickup(Base, info, position, rotation);
+ ItemPickupBase ipb = InventoryExtensions.ServerCreatePickup(Base, info, position, rotation ?? Quaternion.identity);
Base.OnRemoved(ipb);
diff --git a/EXILED/Exiled.API/Features/Items/Jailbird.cs b/EXILED/Exiled.API/Features/Items/Jailbird.cs
index 2f8bfb524..b7a48eae6 100644
--- a/EXILED/Exiled.API/Features/Items/Jailbird.cs
+++ b/EXILED/Exiled.API/Features/Items/Jailbird.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -11,6 +11,7 @@ namespace Exiled.API.Features.Items
using Exiled.API.Features.Pickups;
using Exiled.API.Interfaces;
+ using InventorySystem.Items;
using InventorySystem.Items.Autosync;
using InventorySystem.Items.Jailbird;
using Mirror;
@@ -152,13 +153,14 @@ public float GetDamage(JailbirdWearState wearState)
public void Break()
{
WearState = JailbirdWearState.Broken;
- using (new AutosyncRpc(Base, true, out NetworkWriter networkWriter))
+ ItemIdentifier identifier = new(Base);
+ using (new AutosyncRpc(identifier, out NetworkWriter networkWriter))
{
networkWriter.WriteByte(0);
networkWriter.WriteByte((byte)JailbirdWearState.Broken);
}
- using (new AutosyncRpc(Base, true, out NetworkWriter networkWriter2))
+ using (new AutosyncRpc(identifier, out NetworkWriter networkWriter2))
{
networkWriter2.WriteByte(1);
}
diff --git a/EXILED/Exiled.API/Features/Items/Keycard.cs b/EXILED/Exiled.API/Features/Items/Keycard.cs
index 08d11db56..6bd7ca93a 100644
--- a/EXILED/Exiled.API/Features/Items/Keycard.cs
+++ b/EXILED/Exiled.API/Features/Items/Keycard.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Items/MicroHid.cs b/EXILED/Exiled.API/Features/Items/MicroHid.cs
index 2527707de..f83dab90d 100644
--- a/EXILED/Exiled.API/Features/Items/MicroHid.cs
+++ b/EXILED/Exiled.API/Features/Items/MicroHid.cs
@@ -1,15 +1,21 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.API.Features.Items
{
- using Exiled.API.Interfaces;
+ using System;
+ using System.Reflection;
+ using Exiled.API.Features.Pickups;
+ using Exiled.API.Interfaces;
using InventorySystem.Items.MicroHID;
+ using InventorySystem.Items.MicroHID.Modules;
+
+ using Random = UnityEngine.Random;
///
/// A wrapper class for .
@@ -34,13 +40,34 @@ internal MicroHid()
{
}
+ ///
+ /// Gets the of the MicroHID.
+ ///
+ public EnergyManagerModule EnergyManager => Base.EnergyManager;
+
+ ///
+ /// Gets the of the MicroHID.
+ ///
+ public BrokenSyncModule BrokenModule => Base.BrokenSync;
+
+ ///
+ /// Gets the of the MicroHID.
+ ///
+ public InputSyncModule InputModule => Base.InputSync;
+
+ ///
+ /// Gets the of the MicroHID.
+ ///
+ public CycleController CycleController => Base.CycleController;
+
///
/// Gets or sets the remaining energy in the MicroHID.
///
+ /// Maximum energy is 1. Minimum energy is 0.
public float Energy
{
- get => Base.RemainingEnergy;
- set => Base.RemainingEnergy = value;
+ get => EnergyManager.Energy;
+ set => EnergyManager.ServerSetEnergy(Serial, value);
}
///
@@ -49,23 +76,128 @@ public float Energy
public new MicroHIDItem Base { get; }
///
- /// Gets or sets the .
+ /// Gets or sets a value indicating whether the MicroHID is broken.
///
- public HidState State
+ public bool IsBroken
{
- get => Base.State;
- set => Base.State = value;
+ get => BrokenModule.Broken;
+ set => BrokenModule.ServerSetBroken(Serial, value);
}
+ ///
+ /// Gets a time when this was broken.
+ ///
+ /// A time when this was broken, or 0 if it is not broken.
+ public float BrokeTime => BrokenSyncModule.TryGetBrokenElapsed(Serial, out float time) ? time : 0;
+
+ ///
+ /// Gets or sets the .
+ ///
+ public MicroHidPhase State
+ {
+ get => CycleController.Phase;
+ set => CycleController.Phase = value;
+ }
+
+ ///
+ /// Gets or sets progress of winging up.
+ ///
+ /// A value between 0 and 1.
+ public float WindUpProgress
+ {
+ get => CycleController.ServerWindUpProgress;
+ set => CycleController.ServerWindUpProgress = value;
+ }
+
+ ///
+ /// Gets or sets the last received .
+ ///
+ public MicroHidFiringMode LastFiringMode
+ {
+ get => CycleController.LastFiringMode;
+ set => CycleController.LastFiringMode = value;
+ }
+
+ ///
+ /// Gets or sets the last received .
+ ///
+ public InputSyncModule.SyncData LastReceived
+ {
+ get => InputModule._lastReceived;
+ set => InputModule._lastReceived = value;
+ }
+
+ ///
+ /// Gets a value indicating whether the is .
+ ///
+ public bool IsPrimary => InputModule.Primary;
+
///
/// Starts firing the MicroHID.
///
- public void Fire() => Base.Fire();
+ /// Fire mode.
+ public void Fire(MicroHidFiringMode firingMode = MicroHidFiringMode.PrimaryFire)
+ {
+ switch (firingMode)
+ {
+ case MicroHidFiringMode.PrimaryFire:
+ if (TryGetFireController(MicroHidFiringMode.PrimaryFire, out PrimaryFireModeModule primaryFireModeModule))
+ primaryFireModeModule.ServerFire();
+ break;
+ case MicroHidFiringMode.ChargeFire:
+ if (TryGetFireController(MicroHidFiringMode.ChargeFire, out ChargeFireModeModule chargeFireModeModule))
+ chargeFireModeModule.ServerFire();
+ break;
+ default:
+ if (TryGetFireController(MicroHidFiringMode.BrokenFire, out BrokenFireModeModule brokenFireModeModule))
+ brokenFireModeModule.ServerFire();
+ break;
+ }
+ }
///
/// Recharges the MicroHID.
///
- public void Recharge() => Base.Recharge();
+ public void Recharge()
+ {
+ if (IsBroken)
+ Energy = Random.value;
+ else
+ Energy = 1;
+ }
+
+ ///
+ /// Explodes the MicroHID.
+ ///
+ public void Explode()
+ {
+ if (TryGetFireController(MicroHidFiringMode.ChargeFire, out ChargeFireModeModule module))
+ module.ServerExplode();
+ }
+
+ ///
+ /// Tries to get a assosiated with the specified .
+ ///
+ /// Target firing mode.
+ /// Found module or null.
+ /// Type of module.
+ /// true if module was found, false otherwise.
+ public bool TryGetFireController(MicroHidFiringMode firingMode, out T module)
+ where T : FiringModeControllerModule
+ {
+ if (CycleController._firingModeControllers.Count == 0)
+ CycleController.RecacheFiringModes(Base);
+
+ module = (T)CycleController._firingModeControllers.Find(x => x.AssignedMode == firingMode);
+ return module != null;
+ }
+
+ ///
+ /// Tries to get a assosiated with the last .
+ ///
+ /// Found module or null.
+ /// true if module was found, false otherwise.
+ public bool TryGetLastFireController(out FiringModeControllerModule module) => TryGetFireController(LastFiringMode, out module);
///
/// Clones current object.
diff --git a/EXILED/Exiled.API/Features/Items/Radio.cs b/EXILED/Exiled.API/Features/Items/Radio.cs
index 3207e085f..d54abae2d 100644
--- a/EXILED/Exiled.API/Features/Items/Radio.cs
+++ b/EXILED/Exiled.API/Features/Items/Radio.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -82,7 +82,7 @@ public RadioRangeSettings RangeSettings
}
///
- /// Gets or sets a value indicating whether the radio is enabled or not.
+ /// Gets or sets a value indicating whether the radio is enabled.
///
public bool IsEnabled
{
diff --git a/EXILED/Exiled.API/Features/Items/Scp018.cs b/EXILED/Exiled.API/Features/Items/Scp018.cs
index 7c08c7c6d..37be245a8 100644
--- a/EXILED/Exiled.API/Features/Items/Scp018.cs
+++ b/EXILED/Exiled.API/Features/Items/Scp018.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Items/Scp1344.cs b/EXILED/Exiled.API/Features/Items/Scp1344.cs
new file mode 100644
index 000000000..460aeb8c0
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Items/Scp1344.cs
@@ -0,0 +1,89 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Items
+{
+ using Exiled.API.Interfaces;
+
+ using InventorySystem.Items.Usables;
+ using InventorySystem.Items.Usables.Scp1344;
+ using PlayerRoles.FirstPersonControl.Thirdperson.Subcontrollers;
+
+ ///
+ /// A wrapper class for .
+ ///
+ public class Scp1344 : Usable, IWrapper
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The base class.
+ public Scp1344(Scp1344Item itemBase)
+ : base(itemBase)
+ {
+ Base = itemBase;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ internal Scp1344()
+ : this((Scp1344Item)Server.Host.Inventory.CreateItemInstance(new(ItemType.SCP1344, 0), false))
+ {
+ }
+
+ ///
+ /// Gets the that this class is encapsulating.
+ ///
+ public new Scp1344Item Base { get; }
+
+ ///
+ /// Gets a value indicating whether the item is worn.
+ ///
+ public bool IsWorn => Base.IsWorn;
+
+ ///
+ /// Gets a value indicating whether it can be started to use.
+ ///
+ public bool CanStartUsing => Base.CanStartUsing;
+
+ ///
+ /// Gets or sets the status of Scp1344.
+ ///
+ public Scp1344Status Status
+ {
+ get => Base.Status;
+ set => Base.Status = value;
+ }
+
+ ///
+ /// Forcefully deactivate SCP-1344.
+ ///
+ /// Whether or not 1344 should be dropped.
+ public void Deactivate(bool dropItem = false)
+ {
+ if (Status is not(Scp1344Status.Active or Scp1344Status.Stabbing or Scp1344Status.Dropping))
+ {
+ return;
+ }
+
+ Base.Owner.DisableWearables(WearableElements.Scp1344Goggles);
+ Base.ActivateFinalEffects();
+ Status = Scp1344Status.Idle;
+
+ if (dropItem)
+ {
+ Base.ServerDropItem(true);
+ }
+ }
+
+ ///
+ /// Forcefully activated SCP-1344.
+ ///
+ public void Actived() => Status = Scp1344Status.Stabbing;
+ }
+}
diff --git a/EXILED/Exiled.API/Features/Items/Scp1576.cs b/EXILED/Exiled.API/Features/Items/Scp1576.cs
index 571eeae1e..3ff4514e4 100644
--- a/EXILED/Exiled.API/Features/Items/Scp1576.cs
+++ b/EXILED/Exiled.API/Features/Items/Scp1576.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Items/Scp2176.cs b/EXILED/Exiled.API/Features/Items/Scp2176.cs
index 0ca9fc54d..7264f778c 100644
--- a/EXILED/Exiled.API/Features/Items/Scp2176.cs
+++ b/EXILED/Exiled.API/Features/Items/Scp2176.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Items/Scp244.cs b/EXILED/Exiled.API/Features/Items/Scp244.cs
index 9e88a5375..0cfea6c3a 100644
--- a/EXILED/Exiled.API/Features/Items/Scp244.cs
+++ b/EXILED/Exiled.API/Features/Items/Scp244.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -51,7 +51,7 @@ internal Scp244(ItemType scp244Type)
public new Scp244Item Base { get; }
///
- /// Gets or sets a value indicating whether or not SCP-244 will spawn primed.
+ /// Gets or sets a value indicating whether SCP-244 will spawn primed.
///
public bool Primed
{
@@ -82,11 +82,11 @@ public bool Primed
/// The rotation of the item.
/// Whether the should be initially spawned.
/// The created .
- public override Pickup CreatePickup(Vector3 position, Quaternion rotation = default, bool spawn = true)
+ public override Pickup CreatePickup(Vector3 position, Quaternion? rotation = null, bool spawn = true)
{
PickupSyncInfo info = new(Type, Weight, Serial);
- Scp244DeployablePickup ipb = (Scp244DeployablePickup)InventoryExtensions.ServerCreatePickup(Base, info, position, rotation);
+ Scp244DeployablePickup ipb = (Scp244DeployablePickup)InventoryExtensions.ServerCreatePickup(Base, info, position, rotation ?? Quaternion.identity);
Base.OnRemoved(ipb);
diff --git a/EXILED/Exiled.API/Features/Items/Scp330.cs b/EXILED/Exiled.API/Features/Items/Scp330.cs
index d0f902184..38c9ded76 100644
--- a/EXILED/Exiled.API/Features/Items/Scp330.cs
+++ b/EXILED/Exiled.API/Features/Items/Scp330.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -87,11 +87,6 @@ internal Scp330()
///
public CandyKindID ExposedType { get; set; } = CandyKindID.None;
- ///
- /// Gets or sets the candy that will be added to the bag. Used for events.
- ///
- internal CandyKindID CandyToAdd { get; set; } = CandyKindID.None;
-
///
/// Adds a specific candy to the bag.
///
@@ -136,7 +131,7 @@ public int AddCandy(IEnumerable candies, out CandyAddStatus status)
/// Removes a specific candy from the bag.
///
/// The to be removed.
- /// Whether or not to only remove all matching candy. (If , all candies of the given type are removed).
+ /// Whether to only remove all matching candy. (If , all candies of the given type are removed).
/// The total amount of candies that were removed from the bag.
public int RemoveCandy(CandyKindID type, bool removeAll = false)
{
@@ -175,8 +170,8 @@ public int RemoveAllCandy()
/// Drops candies from the bag.
///
/// The of candies to drop.
- /// Whether or not to drop all candies matching the given type, or just one.
- /// Whether or not to drop all candies individually, or as a bag, when dropping more than one candy.
+ /// Whether to drop all candies matching the given type, or just one.
+ /// Whether to drop all candies individually, or as a bag, when dropping more than one candy.
/// The to use, if the override is set to true.
/// a of s generated by this method. *Can be empty!*.
public IEnumerable DropCandy(CandyKindID type, bool dropAll = false, bool dropIndividual = false, CandyKindID exposedType = CandyKindID.None)
@@ -245,11 +240,11 @@ public IEnumerable DropCandy(CandyKindID type, bool dropAll = fals
/// The rotation to give the item.
/// Whether the should be initially spawned.
/// The created .
- public override Pickup CreatePickup(Vector3 position, Quaternion rotation = default, bool spawn = true)
+ public override Pickup CreatePickup(Vector3 position, Quaternion? rotation = null, bool spawn = true)
{
PickupSyncInfo info = new(Type, Weight, Serial);
- InventorySystem.Items.Usables.Scp330.Scp330Pickup ipb = (InventorySystem.Items.Usables.Scp330.Scp330Pickup)InventoryExtensions.ServerCreatePickup(Base, info, position, rotation);
+ InventorySystem.Items.Usables.Scp330.Scp330Pickup ipb = (InventorySystem.Items.Usables.Scp330.Scp330Pickup)InventoryExtensions.ServerCreatePickup(Base, info, position, rotation ?? Quaternion.identity);
Base.OnRemoved(ipb);
diff --git a/EXILED/Exiled.API/Features/Items/Throwable.cs b/EXILED/Exiled.API/Features/Items/Throwable.cs
index 4de522295..548b1037e 100644
--- a/EXILED/Exiled.API/Features/Items/Throwable.cs
+++ b/EXILED/Exiled.API/Features/Items/Throwable.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Items/Usable.cs b/EXILED/Exiled.API/Features/Items/Usable.cs
index aba803d38..6ba68e2cb 100644
--- a/EXILED/Exiled.API/Features/Items/Usable.cs
+++ b/EXILED/Exiled.API/Features/Items/Usable.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -109,11 +109,11 @@ public float RemainingCooldown
/// The rotation of the item.
/// Whether the should be initially spawned.
/// The created .
- public override Pickup CreatePickup(Vector3 position, Quaternion rotation = default, bool spawn = true)
+ public override Pickup CreatePickup(Vector3 position, Quaternion? rotation = null, bool spawn = true)
{
PickupSyncInfo info = new(Type, Weight, Serial);
- ItemPickupBase ipb = InventoryExtensions.ServerCreatePickup(Base, info, position, rotation);
+ ItemPickupBase ipb = InventoryExtensions.ServerCreatePickup(Base, info, position, rotation ?? Quaternion.identity);
Pickup pickup = Pickup.Get(ipb);
diff --git a/EXILED/Exiled.API/Features/Lift.cs b/EXILED/Exiled.API/Features/Lift.cs
index 9a3b183c2..c38e146a3 100644
--- a/EXILED/Exiled.API/Features/Lift.cs
+++ b/EXILED/Exiled.API/Features/Lift.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -21,7 +21,6 @@ namespace Exiled.API.Features
using UnityEngine;
using static Interactables.Interobjects.ElevatorChamber;
- using static Interactables.Interobjects.ElevatorManager;
using Elevator = Interactables.Interobjects.ElevatorDoor;
@@ -33,7 +32,7 @@ public class Lift : IWrapper, IWorldSpace
///
/// A containing all known s and their corresponding .
///
- internal static readonly Dictionary ElevatorChamberToLift = new(8, new ComponentsEqualityComparer());
+ internal static readonly Dictionary ElevatorChamberToLift = new(9, new ComponentsEqualityComparer());
///
/// Internal list that contains all ElevatorDoor for current group.
@@ -121,8 +120,8 @@ public Quaternion Rotation
///
public ElevatorSequence Status
{
- get => Base._curSequence;
- set => Base._curSequence = value;
+ get => Base.CurSequence;
+ set => Base.CurSequence = value;
}
///
@@ -140,7 +139,7 @@ public ElevatorSequence Status
ElevatorGroup.GateB => ElevatorType.GateB,
ElevatorGroup.LczA01 or ElevatorGroup.LczA02 => ElevatorType.LczA,
ElevatorGroup.LczB01 or ElevatorGroup.LczB02 => ElevatorType.LczB,
- ElevatorGroup.Nuke => ElevatorType.Nuke,
+ ElevatorGroup.Nuke01 or ElevatorGroup.Nuke02 => ElevatorType.Nuke,
_ => ElevatorType.Unknown,
};
@@ -162,7 +161,7 @@ public ElevatorSequence Status
///
/// Gets a value indicating whether the lift is locked.
///
- public bool IsLocked => Base.ActiveLocks > 0;
+ public bool IsLocked => Base.ActiveLocksAnyDoors > 0 || Base.ActiveLocksAllDoors > 0;
///
/// Gets or sets the .
@@ -196,12 +195,12 @@ public float AnimationTime
///
/// Gets the .
///
- public int CurrentLevel => Base.CurrentLevel;
+ public int CurrentLevel => Base.DestinationLevel;
///
/// Gets the .
///
- public Doors.ElevatorDoor CurrentDestination => Door.Get(Base.CurrentDestination);
+ public Doors.ElevatorDoor CurrentDestination => Door.Get(Base.DestinationDoor);
///
/// Gets a of which contains all the instances from the specified .
@@ -272,9 +271,8 @@ public static bool TryMeltPlayer(Player player)
/// Tries to start the lift.
///
/// The destination level.
- /// Indicates whether the start will be forced or not.
- /// if the lift was started successfully; otherwise, .
- public bool TryStart(int level, bool isForced = false) => TrySetDestination(Group, level, isForced);
+ /// Allowing queing.
+ public void TryStart(int level, bool allowQueueing = false) => Base.ServerSetDestination(level, allowQueueing);
///
/// Changes lock of the lift.
@@ -295,17 +293,12 @@ public void ChangeLock(DoorLockReason lockReason)
else
{
door.ChangeLock((DoorLockType)lockReason);
-
- if (CurrentLevel != 1)
- TrySetDestination(Group, 1, true);
}
-
- Base.RefreshLocks(Group, door.Base);
}
}
///
- /// Returns whether or not the provided position is inside the lift.
+ /// Returns whether the provided position is inside the lift.
///
/// The position.
/// if the point is inside the elevator. Otherwise, .
diff --git a/EXILED/Exiled.API/Features/Lockers/Chamber.cs b/EXILED/Exiled.API/Features/Lockers/Chamber.cs
index 72304774f..72e1c67bd 100644
--- a/EXILED/Exiled.API/Features/Lockers/Chamber.cs
+++ b/EXILED/Exiled.API/Features/Lockers/Chamber.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -142,7 +142,7 @@ public Transform Spawnpoint
}
///
- /// Gets or sets a value indicating whether or not items should be spawned as soon as they one chamber is opened.
+ /// Gets or sets a value indicating whether items should be spawned as soon as they one chamber is opened.
///
public bool InitiallySpawn
{
diff --git a/EXILED/Exiled.API/Features/Lockers/Locker.cs b/EXILED/Exiled.API/Features/Lockers/Locker.cs
index 509f243ef..0e04382fc 100644
--- a/EXILED/Exiled.API/Features/Lockers/Locker.cs
+++ b/EXILED/Exiled.API/Features/Lockers/Locker.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Log.cs b/EXILED/Exiled.API/Features/Log.cs
index caf9cf331..48203577c 100644
--- a/EXILED/Exiled.API/Features/Log.cs
+++ b/EXILED/Exiled.API/Features/Log.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Map.cs b/EXILED/Exiled.API/Features/Map.cs
index d0b31f391..081999068 100644
--- a/EXILED/Exiled.API/Features/Map.cs
+++ b/EXILED/Exiled.API/Features/Map.cs
@@ -1,40 +1,32 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.API.Features
{
+#pragma warning disable SA1401
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
- using Decals;
using Enums;
using Exiled.API.Extensions;
using Exiled.API.Features.Hazards;
- using Exiled.API.Features.Lockers;
using Exiled.API.Features.Pickups;
using Exiled.API.Features.Toys;
- using global::Hazards;
using InventorySystem;
- using InventorySystem.Items.Firearms;
- using InventorySystem.Items.Firearms.BasicMessages;
using InventorySystem.Items.Pickups;
using InventorySystem.Items.ThrowableProjectiles;
using Items;
using LightContainmentZoneDecontamination;
using MapGeneration;
- using MapGeneration.Distributors;
- using PlayerRoles.PlayableScps.Scp939;
using PlayerRoles.Ragdolls;
- using RelativePositioning;
using UnityEngine;
using Utils;
- using Utils.Networking;
using Object = UnityEngine.Object;
@@ -44,24 +36,14 @@ namespace Exiled.API.Features
public static class Map
{
///
- /// A list of s on the map.
+ /// Gets a list of s on the map.
///
- internal static readonly List TeleportsValue = new(8);
+ internal static List TeleportsValue = new();
private static AmbientSoundPlayer ambientSoundPlayer;
private static SqueakSpawner squeakSpawner;
- ///
- /// Gets the tantrum prefab.
- ///
- public static TantrumEnvironmentalHazard TantrumPrefab => TantrumHazard.TantrumPrefab; // TODO: Remove this.
-
- ///
- /// Gets the amnestic cloud prefab.
- ///
- public static Scp939AmnesticCloudInstance AmnesticCloudPrefab => AmnesticCloudHazard.AmnesticCloudPrefab; // TODO: Remove this.
-
///
/// Gets a value indicating whether decontamination has begun in the light containment zone.
///
@@ -79,20 +61,6 @@ DecontaminationController.Singleton.NetworkDecontaminationOverride is Decontamin
///
public static ReadOnlyCollection PocketDimensionTeleports { get; } = TeleportsValue.AsReadOnly();
- ///
- /// Gets all objects in the current map.
- ///
- ///
- /// This property is obsolete. Use instead to retrieve a collection of all instances.
- ///
- [Obsolete("Use Locker.List instead.")]
- public static ReadOnlyCollection Lockers { get; } = Features.Lockers.Locker.BaseToExiledLockers.Keys.ToList().AsReadOnly();
-
- ///
- /// Gets all objects.
- ///
- public static ReadOnlyCollection Toys => AdminToy.BaseToAdminToy.Values.ToList().AsReadOnly(); // TODO: Obsolete it and make people use AdminToy.List
-
///
/// Gets or sets the current seed of the map.
///
@@ -102,7 +70,7 @@ public static int Seed
set
{
if (!SeedSynchronizer.MapGenerated)
- SeedSynchronizer._singleton.Network_syncSeed = value;
+ SeedSynchronizer.Seed = value;
}
}
@@ -121,7 +89,7 @@ public static bool IsDecontaminationEnabled
///
/// Gets the .
///
- public static AmbientSoundPlayer AmbientSoundPlayer => ambientSoundPlayer ??= ReferenceHub.HostHub.GetComponent();
+ public static AmbientSoundPlayer AmbientSoundPlayer => ambientSoundPlayer ??= ReferenceHub._hostHub.GetComponent();
///
/// Gets the .
@@ -229,16 +197,6 @@ public static void ResetLightsColor()
light.NetworkOverrideColor = Color.clear;
}
- ///
- /// Gets a random object from the current map.
- ///
- ///
- /// This method is obsolete. Use instead to get a random instance.
- ///
- /// A randomly selected object.
- [Obsolete("Use Locker.Random() instead.")]
- public static MapGeneration.Distributors.Locker GetRandomLocker() => Lockers.GetRandomValue();
-
///
/// Gets a random .
///
@@ -267,15 +225,6 @@ public static void PlayAmbientSound(int id)
AmbientSoundPlayer.RpcPlaySound(AmbientSoundPlayer.clips[id].index);
}
- ///
- /// Places a Tantrum (SCP-173's ability) in the indicated position.
- ///
- /// The position where you want to spawn the Tantrum.
- /// Whether or not the tantrum will apply the effect.
- /// If is , the tantrum is moved slightly up from its original position. Otherwise, the collision will not be detected and the slowness will not work.
- /// The instance.
- public static TantrumHazard PlaceTantrum(Vector3 position, bool isActive = true) => TantrumHazard.PlaceTantrum(position, isActive); // TODO: Remove this.
-
///
/// Destroy all objects.
///
@@ -319,7 +268,7 @@ public static void CleanAllRagdolls(IEnumerable ragDolls)
///
/// The position of the blood decal.
/// The direction of the blood decal.
- public static void PlaceBlood(Vector3 position, Vector3 direction) => new GunDecalMessage(position, direction, DecalPoolType.Blood).SendToAuthenticated(0);
+ public static void PlaceBlood(Vector3 position, Vector3 direction) => _ = 0; /* new GunDecalMessage(position, direction, DecalPoolType.Blood).SendToAuthenticated(0);*/ // TODO: Not finish
///
/// Gets all the near cameras.
@@ -380,15 +329,17 @@ public static void ExplodeEffect(Vector3 position, ProjectileType projectileType
/// The audio clip ID to play.
public static void PlayGunSound(Vector3 position, ItemType firearmType, byte maxDistance = 45, byte audioClipId = 0)
{
+ // TODO: Not finish
+ /*
GunAudioMessage msg = new()
{
Weapon = firearmType,
AudioClipId = audioClipId,
MaxDistance = maxDistance,
- ShooterHub = ReferenceHub.HostHub,
+ ShooterHub = ReferenceHub._hostHub,
ShooterPosition = new RelativePosition(position),
};
- msg.SendToAuthenticated();
+ msg.SendToAuthenticated();*/
}
///
@@ -413,9 +364,9 @@ internal static void ClearCache()
Ragdoll.BasicRagdollToRagdoll.Clear();
- Items.Firearm.ItemTypeToFirearmInstance.Clear();
- Items.Firearm.BaseCodesValue.Clear();
- Items.Firearm.AvailableAttachmentsValue.Clear();
+ Firearm.ItemTypeToFirearmInstance.Clear();
+ Firearm.BaseCodesValue.Clear();
+ Firearm.AvailableAttachmentsValue.Clear();
}
}
}
diff --git a/EXILED/Exiled.API/Features/Npc.cs b/EXILED/Exiled.API/Features/Npc.cs
index e79038065..4055dfa6a 100644
--- a/EXILED/Exiled.API/Features/Npc.cs
+++ b/EXILED/Exiled.API/Features/Npc.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -15,10 +15,12 @@ namespace Exiled.API.Features
using CentralAuth;
using CommandSystem;
+ using CommandSystem.Commands.RemoteAdmin.Dummies;
using Exiled.API.Enums;
using Exiled.API.Features.Components;
using Exiled.API.Features.Roles;
using Footprinting;
+ using GameCore;
using MEC;
using Mirror;
using PlayerRoles;
@@ -46,7 +48,7 @@ public Npc(GameObject gameObject)
///
/// Gets a list of Npcs.
///
- public static new List List => Player.List.OfType().ToList();
+ public static new IReadOnlyCollection List => Dictionary.Values.OfType().ToList();
///
/// Gets or sets the player's position.
@@ -62,6 +64,113 @@ public override Vector3 Position
}
}
+ ///
+ /// Gets or sets the player being followed.
+ ///
+ /// The npc must have .
+ public Player? FollowedPlayer
+ {
+ get => !GameObject.TryGetComponent(out PlayerFollower follower) ? null : Player.Get(follower._hubToFollow);
+
+ set
+ {
+ if (!GameObject.TryGetComponent(out PlayerFollower follower))
+ {
+ GameObject.AddComponent()._hubToFollow = value?.ReferenceHub;
+ return;
+ }
+
+ follower._hubToFollow = value?.ReferenceHub;
+ }
+ }
+
+ ///
+ /// Gets or sets the Max Distance of the npc.
+ ///
+ /// The npc must have .
+ public float? MaxDistance
+ {
+ get
+ {
+ if (!GameObject.TryGetComponent(out PlayerFollower follower))
+ return null;
+
+ return follower._maxDistance;
+ }
+
+ set
+ {
+ if(!value.HasValue)
+ return;
+
+ if (!GameObject.TryGetComponent(out PlayerFollower follower))
+ {
+ GameObject.AddComponent()._maxDistance = value.Value;
+ return;
+ }
+
+ follower._maxDistance = value.Value;
+ }
+ }
+
+ ///
+ /// Gets or sets the Min Distance of the npc.
+ ///
+ /// The npc must have .
+ public float? MinDistance
+ {
+ get
+ {
+ if (!GameObject.TryGetComponent(out PlayerFollower follower))
+ return null;
+
+ return follower._minDistance;
+ }
+
+ set
+ {
+ if(!value.HasValue)
+ return;
+
+ if (!GameObject.TryGetComponent(out PlayerFollower follower))
+ {
+ GameObject.AddComponent()._minDistance = value.Value;
+ return;
+ }
+
+ follower._minDistance = value.Value;
+ }
+ }
+
+ ///
+ /// Gets or sets the Speed of the npc.
+ ///
+ /// The npc must have .
+ public float? Speed
+ {
+ get
+ {
+ if (!GameObject.TryGetComponent(out PlayerFollower follower))
+ return null;
+
+ return follower._speed;
+ }
+
+ set
+ {
+ if(!value.HasValue)
+ return;
+
+ if (!GameObject.TryGetComponent(out PlayerFollower follower))
+ {
+ GameObject.AddComponent()._speed = value.Value;
+ return;
+ }
+
+ follower._speed = value.Value;
+ }
+ }
+
///
/// Retrieves the NPC associated with the specified ReferenceHub.
///
@@ -137,74 +246,19 @@ public override Vector3 Position
///
/// The name of the NPC.
/// The RoleTypeId of the NPC.
- /// The player ID of the NPC.
- /// The userID of the NPC.
- /// The position to spawn the NPC.
- /// The spawned.
- [Obsolete("This metod is marked as obsolet due to a bug that make player have the same id. Use Npc.Spawn(string) instead")]
- public static Npc Spawn(string name, RoleTypeId role, int id = 0, string userId = PlayerAuthenticationManager.DedicatedId, Vector3? position = null)
+ /// The position where the NPC should spawn.
+ /// Docs4.
+ public static Npc Spawn(string name, RoleTypeId role, Vector3 position)
{
- GameObject newObject = UnityEngine.Object.Instantiate(Mirror.NetworkManager.singleton.playerPrefab);
-
- Npc npc = new(newObject)
- {
- IsNPC = true,
- };
-
- if (!RecyclablePlayerId.FreeIds.Contains(id) && RecyclablePlayerId._autoIncrement >= id)
- {
- Log.Warn($"{Assembly.GetCallingAssembly().GetName().Name} tried to spawn an NPC with a duplicate PlayerID. Using auto-incremented ID instead to avoid an ID clash.");
- id = new RecyclablePlayerId(true).Value;
- }
-
- try
- {
- if (userId == PlayerAuthenticationManager.DedicatedId)
- {
- npc.ReferenceHub.authManager.SyncedUserId = userId;
- try
- {
- npc.ReferenceHub.authManager.InstanceMode = ClientInstanceMode.DedicatedServer;
- }
- catch (Exception e)
- {
- Log.Debug($"Ignore: {e.Message}");
- }
- }
- else
- {
- npc.ReferenceHub.authManager.InstanceMode = ClientInstanceMode.Unverified;
- npc.ReferenceHub.authManager._privUserId = userId == string.Empty ? $"Dummy@localhost" : userId;
- }
- }
- catch (Exception e)
- {
- Log.Debug($"Ignore: {e.Message}");
- }
-
- try
- {
- npc.ReferenceHub.roleManager.InitializeNewRole(RoleTypeId.None, RoleChangeReason.None);
- }
- catch (Exception e)
- {
- Log.Debug($"Ignore: {e.Message}");
- }
-
- FakeConnection fakeConnection = new(id);
- NetworkServer.AddPlayerForConnection(fakeConnection, newObject);
-
- npc.ReferenceHub.nicknameSync.Network_myNickSync = name;
- Dictionary.Add(newObject, npc);
+ Npc npc = new(DummyUtils.SpawnDummy(name));
Timing.CallDelayed(0.5f, () =>
{
- npc.Role.Set(role, SpawnReason.RoundStart, position is null ? RoleSpawnFlags.All : RoleSpawnFlags.AssignInventory);
-
- if (position is not null)
- npc.Position = position.Value;
+ npc.Role.Set(role);
+ npc.Position = position;
});
+ Dictionary.Add(npc.GameObject, npc);
return npc;
}
@@ -214,58 +268,11 @@ public static Npc Spawn(string name, RoleTypeId role, int id = 0, string userId
/// The name of the NPC.
/// The RoleTypeId of the NPC, defaulting to None.
/// Whether the NPC should be ignored by round ending checks.
- /// The userID of the NPC for authentication. Defaults to the Dedicated ID.
/// The position where the NPC should spawn. If null, the default spawn location is used.
/// The spawned.
- public static Npc Spawn(string name, RoleTypeId role = RoleTypeId.None, bool ignored = false, string userId = PlayerAuthenticationManager.DedicatedId, Vector3? position = null)
+ public static Npc Spawn(string name, RoleTypeId role = RoleTypeId.None, bool ignored = false, Vector3? position = null)
{
- GameObject newObject = UnityEngine.Object.Instantiate(Mirror.NetworkManager.singleton.playerPrefab);
-
- Npc npc = new(newObject)
- {
- IsNPC = true,
- };
-
- FakeConnection fakeConnection = new(npc.Id);
-
- try
- {
- if (userId == PlayerAuthenticationManager.DedicatedId)
- {
- npc.ReferenceHub.authManager.SyncedUserId = userId;
- try
- {
- npc.ReferenceHub.authManager.InstanceMode = ClientInstanceMode.DedicatedServer;
- }
- catch (Exception e)
- {
- Log.Debug($"Ignore: {e.Message}");
- }
- }
- else
- {
- npc.ReferenceHub.authManager.InstanceMode = ClientInstanceMode.Unverified;
- npc.ReferenceHub.authManager._privUserId = userId == string.Empty ? $"Dummy-{npc.Id}@localhost" : userId;
- }
- }
- catch (Exception e)
- {
- Log.Debug($"Ignore: {e.Message}");
- }
-
- try
- {
- npc.ReferenceHub.roleManager.InitializeNewRole(RoleTypeId.None, RoleChangeReason.None);
- }
- catch (Exception e)
- {
- Log.Debug($"Ignore: {e.Message}");
- }
-
- NetworkServer.AddPlayerForConnection(fakeConnection, newObject);
-
- npc.ReferenceHub.nicknameSync.Network_myNickSync = name;
- Dictionary.Add(newObject, npc);
+ Npc npc = new(DummyUtils.SpawnDummy(name));
Timing.CallDelayed(0.5f, () =>
{
@@ -278,16 +285,38 @@ public static Npc Spawn(string name, RoleTypeId role = RoleTypeId.None, bool ign
if (ignored)
Round.IgnoredPlayers.Add(npc.ReferenceHub);
+ Dictionary.Add(npc.GameObject, npc);
return npc;
}
///
/// Destroys all NPCs currently spawned.
///
- public static void DestroyAll()
+ public static void DestroyAll() => DummyUtils.DestroyAllDummies();
+
+ ///
+ /// Follow a specific player.
+ ///
+ /// the Player to follow.
+ public void Follow(Player player)
{
- foreach (Npc npc in List)
- npc.Destroy();
+ PlayerFollower follow = !GameObject.TryGetComponent(out PlayerFollower follower) ? GameObject.AddComponent() : follower;
+
+ follow.Init(player.ReferenceHub);
+ }
+
+ ///
+ /// Follow a specific player.
+ ///
+ /// the Player to follow.
+ /// the max distance the npc will go.
+ /// the min distance the npc will go.
+ /// the speed the npc will go.
+ public void Follow(Player player, float maxDistance, float minDistance, float speed = 30f)
+ {
+ PlayerFollower follow = !GameObject.TryGetComponent(out PlayerFollower follower) ? GameObject.AddComponent() : follower;
+
+ follow.Init(player.ReferenceHub, maxDistance, minDistance, speed);
}
///
@@ -298,11 +327,8 @@ public void Destroy()
try
{
Round.IgnoredPlayers.Remove(ReferenceHub);
- NetworkConnectionToClient conn = ReferenceHub.connectionToClient;
- ReferenceHub.OnDestroy();
- CustomNetworkManager.TypedSingleton.OnServerDisconnect(conn);
- Dictionary.Remove(GameObject);
- Object.Destroy(GameObject);
+ Dictionary.Remove(ReferenceHub.gameObject);
+ NetworkServer.Destroy(ReferenceHub.gameObject);
}
catch (Exception e)
{
diff --git a/EXILED/Exiled.API/Features/Paths.cs b/EXILED/Exiled.API/Features/Paths.cs
index e27f45213..153d8e0bf 100644
--- a/EXILED/Exiled.API/Features/Paths.cs
+++ b/EXILED/Exiled.API/Features/Paths.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pickups/AmmoPickup.cs b/EXILED/Exiled.API/Features/Pickups/AmmoPickup.cs
index fa77f1cb3..ce6892103 100644
--- a/EXILED/Exiled.API/Features/Pickups/AmmoPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/AmmoPickup.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pickups/BodyArmorPickup.cs b/EXILED/Exiled.API/Features/Pickups/BodyArmorPickup.cs
index e387cf182..47cfb108c 100644
--- a/EXILED/Exiled.API/Features/Pickups/BodyArmorPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/BodyArmorPickup.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -66,12 +66,12 @@ internal BodyArmorPickup(ItemType type)
public bool Holsterable { get; } = false;
///
- /// Gets a value indicating whether or not this is a worn item.
+ /// Gets a value indicating whether this is a worn item.
///
public bool IsWorn { get; } = true;
///
- /// Gets or sets a value indicating whether or not excess ammo should be removed when the armor is dropped.
+ /// Gets or sets a value indicating whether excess ammo should be removed when the armor is dropped.
///
public bool RemoveExcessOnDrop { get; set; }
diff --git a/EXILED/Exiled.API/Features/Pickups/ExplosiveGrenadePickup.cs b/EXILED/Exiled.API/Features/Pickups/ExplosiveGrenadePickup.cs
index dcfdee8ec..061135573 100644
--- a/EXILED/Exiled.API/Features/Pickups/ExplosiveGrenadePickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/ExplosiveGrenadePickup.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs b/EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs
index 112ae6a8b..936ac1d2c 100644
--- a/EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -38,8 +38,10 @@ internal FirearmPickup(ItemType type)
Base = (BaseFirearm)((Pickup)this).Base;
IsDistributed = true;
+ // TODO not finish
+ /*
if (type is ItemType.ParticleDisruptor && Status.Ammo == 0)
- Status = new FirearmStatus(5, FirearmStatusFlags.MagazineInserted, 0);
+ Status = new FirearmStatus(5, FirearmStatusFlags.MagazineInserted, 0);*/
}
///
@@ -50,12 +52,17 @@ internal FirearmPickup(ItemType type)
///
/// Gets or sets a value indicating whether the pickup is already distributed.
///
- public bool IsDistributed
- {
+ public bool IsDistributed { get; set; }
+
+ // TODO NOT FINISH
+ /*{
get => Base.Distributed;
set => Base.Distributed = value;
- }
+ }*/
+ // TODO not finish
+
+ /*
///
/// Gets or sets the .
///
@@ -64,16 +71,15 @@ public FirearmStatus Status
get => Base.NetworkStatus;
set => Base.NetworkStatus = value;
}
+ */
///
/// Gets or sets a value indicating how many ammo have this .
///
- public byte Ammo
- {
- get => Base.NetworkStatus.Ammo;
- set => Base.NetworkStatus = new(value, Base.NetworkStatus.Flags, Base.NetworkStatus.Attachments);
- }
+ /// This will be updated only when item will be picked up.
+ public int Ammo { get; set; }
+ /*
///
/// Gets or sets the .
///
@@ -82,20 +88,21 @@ public FirearmStatusFlags Flags
get => Base.NetworkStatus.Flags;
set => Base.NetworkStatus = new(Base.NetworkStatus.Ammo, value, Base.NetworkStatus.Attachments);
}
+ */
///
/// Gets or sets a value indicating whether the attachment code have this .
///
public uint Attachments
{
- get => Base.NetworkStatus.Attachments;
- set => Base.NetworkStatus = new(Base.NetworkStatus.Ammo, Base.NetworkStatus.Flags, value);
+ get => Base.Worldmodel.AttachmentCode;
+ set => Base.Worldmodel.AttachmentCode = value;
}
///
/// Returns the FirearmPickup in a human readable format.
///
/// A string containing FirearmPickup related data.
- public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* |{IsDistributed}| -{Ammo}-";
+ public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* |{IsDistributed}| -{/*Ammo*/0}-";
}
}
diff --git a/EXILED/Exiled.API/Features/Pickups/FlashGrenadePickup.cs b/EXILED/Exiled.API/Features/Pickups/FlashGrenadePickup.cs
index 49e21988f..3e4c979b5 100644
--- a/EXILED/Exiled.API/Features/Pickups/FlashGrenadePickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/FlashGrenadePickup.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pickups/GrenadePickup.cs b/EXILED/Exiled.API/Features/Pickups/GrenadePickup.cs
index 683a71d80..3d62c428f 100644
--- a/EXILED/Exiled.API/Features/Pickups/GrenadePickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/GrenadePickup.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pickups/JailbirdPickup.cs b/EXILED/Exiled.API/Features/Pickups/JailbirdPickup.cs
index 5bcf26b7c..0494d2e96 100644
--- a/EXILED/Exiled.API/Features/Pickups/JailbirdPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/JailbirdPickup.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pickups/KeycardPickup.cs b/EXILED/Exiled.API/Features/Pickups/KeycardPickup.cs
index 9267e0591..49115119b 100644
--- a/EXILED/Exiled.API/Features/Pickups/KeycardPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/KeycardPickup.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pickups/MicroHIDPickup.cs b/EXILED/Exiled.API/Features/Pickups/MicroHIDPickup.cs
index 469502e49..255c32b6a 100644
--- a/EXILED/Exiled.API/Features/Pickups/MicroHIDPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/MicroHIDPickup.cs
@@ -1,13 +1,15 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.API.Features.Pickups
{
+ using Exiled.API.Features.Items;
using Exiled.API.Interfaces;
+ using InventorySystem.Items.MicroHID.Modules;
using BaseMicroHID = InventorySystem.Items.MicroHID.MicroHIDPickup;
@@ -40,15 +42,107 @@ internal MicroHIDPickup()
///
public new BaseMicroHID Base { get; }
+ ///
+ /// Gets the of this .
+ ///
+ public CycleController CycleController => Base._cycleController;
+
///
/// Gets or sets the MicroHID Energy Level.
///
public float Energy
{
- get => Base.NetworkEnergy;
- set => Base.NetworkEnergy = value;
+ get => EnergyManagerModule.GetEnergy(Serial);
+ set => EnergyManagerModule.SyncEnergy[Serial] = value;
+ }
+
+ ///
+ /// Gets or sets the .
+ ///
+ public MicroHidPhase State
+ {
+ get => CycleController.Phase;
+ set => CycleController.Phase = value;
}
+ ///
+ /// Gets or sets progress of winging up.
+ ///
+ /// A value between 0 and 1.
+ public float WindUpProgress
+ {
+ get => CycleController.ServerWindUpProgress;
+ set => CycleController.ServerWindUpProgress = value;
+ }
+
+ ///
+ /// Gets or sets the last received .
+ ///
+ public MicroHidFiringMode LastFiringMode
+ {
+ get => CycleController.LastFiringMode;
+ set => CycleController.LastFiringMode = value;
+ }
+
+ ///
+ /// Starts firing the MicroHID.
+ ///
+ /// Fire mode.
+ public void Fire(MicroHidFiringMode firingMode = MicroHidFiringMode.PrimaryFire)
+ {
+ switch (firingMode)
+ {
+ case MicroHidFiringMode.PrimaryFire:
+ if (TryGetFireController(MicroHidFiringMode.PrimaryFire, out PrimaryFireModeModule primaryFireModeModule))
+ primaryFireModeModule.ServerFire();
+ break;
+ case MicroHidFiringMode.ChargeFire:
+ if (TryGetFireController(MicroHidFiringMode.ChargeFire, out ChargeFireModeModule chargeFireModeModule))
+ chargeFireModeModule.ServerFire();
+ break;
+ default:
+ if (TryGetFireController(MicroHidFiringMode.BrokenFire, out BrokenFireModeModule brokenFireModeModule))
+ brokenFireModeModule.ServerFire();
+ break;
+ }
+ }
+
+ ///
+ /// Explodes the MicroHID.
+ ///
+ public void Explode()
+ {
+ if (TryGetFireController(MicroHidFiringMode.ChargeFire, out ChargeFireModeModule module))
+ module.ServerExplode();
+ }
+
+ ///
+ /// Tries to get a assosiated with the specified .
+ ///
+ /// Target firing mode.
+ /// Found module or null.
+ /// Type of module.
+ /// true if module was found, false otherwise.
+ public bool TryGetFireController(MicroHidFiringMode firingMode, out T module)
+ where T : FiringModeControllerModule
+ {
+ if (CycleController._firingModeControllers.Count == 0)
+ {
+ module = null;
+ return false;
+ }
+
+ module = (T)CycleController._firingModeControllers.Find(x => x.AssignedMode == firingMode);
+ return module != null;
+ }
+
+ ///
+ /// Tries to get a assosiated with the last .
+ ///
+ /// Found module or null.
+ /// true if module was found, false otherwise.
+ public bool TryGetLastFireController(out FiringModeControllerModule module) => TryGetFireController(LastFiringMode, out module);
+
///
/// Returns the MicroHIDPickup in a human readable format.
///
diff --git a/EXILED/Exiled.API/Features/Pickups/Pickup.cs b/EXILED/Exiled.API/Features/Pickups/Pickup.cs
index 010b1e52c..047958be7 100644
--- a/EXILED/Exiled.API/Features/Pickups/Pickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Pickup.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -128,18 +128,9 @@ internal Pickup(ItemType type)
public Room Room => Room.FindParentRoom(GameObject);
///
- /// Gets or sets the pickup's PhysicsModule.
+ /// Gets the pickup's PhysicsModule.
///
- public PickupStandardPhysics PhysicsModule
- {
- get => Base.PhysicsModule as PickupStandardPhysics;
- [Obsolete("Unsafe.")]
- set
- {
- Base.PhysicsModule.DestroyModule();
- Base.PhysicsModule = value;
- }
- }
+ public PickupStandardPhysics PhysicsModule => Base.PhysicsModule as PickupStandardPhysics;
///
/// Gets or sets the unique serial number for the item.
@@ -246,7 +237,7 @@ public PickupSyncInfo Info
///
/// Gets or sets the previous owner of this item.
///
- ///
+ ///
public Player PreviousOwner
{
get => Player.Get(Base.PreviousOwner.Hub);
@@ -269,7 +260,7 @@ public bool InUse
///
/// Gets or sets the pickup position.
///
- ///
+ ///
public Vector3 Position
{
get => Base.Position;
@@ -288,7 +279,7 @@ public RelativePosition RelativePosition
///
/// Gets or sets the pickup rotation.
///
- ///
+ ///
public Quaternion Rotation
{
get => Base.Rotation;
@@ -541,8 +532,8 @@ public static Pickup Create(ItemType type)
/// The rotation to spawn the .
/// An optional previous owner of the item.
/// The . See documentation of for more information on casting.
- ///
- public static Pickup CreateAndSpawn(ItemType type, Vector3 position, Quaternion rotation, Player previousOwner = null) => Create(type).Spawn(position, rotation, previousOwner);
+ ///
+ public static Pickup CreateAndSpawn(ItemType type, Vector3 position, Quaternion? rotation = null, Player previousOwner = null) => Create(type).Spawn(position, rotation, previousOwner);
///
/// Creates and spawns a .
@@ -553,23 +544,10 @@ public static Pickup Create(ItemType type)
/// An optional previous owner of the item.
/// The specified type.
/// The . See documentation of for more information on casting.
- ///
- public static Pickup CreateAndSpawn(ItemType type, Vector3 position, Quaternion rotation, Player previousOwner = null)
+ ///
+ public static Pickup CreateAndSpawn(ItemType type, Vector3 position, Quaternion? rotation = null, Player previousOwner = null)
where T : Pickup => CreateAndSpawn(type, position, rotation, previousOwner) as T;
- ///
- /// Spawns a .
- ///
- /// The too spawn.
- /// The position to spawn the at.
- /// The rotation to spawn the .
- /// An optional previous owner of the item.
- /// The Spawn.
- ///
- [Obsolete("Use pickup.Spawn(Vector3, Quaternion, Player) instead of this", true)]
- public static Pickup Spawn(Pickup pickup, Vector3 position, Quaternion rotation, Player previousOwner = null)
- => pickup.Spawn(position, rotation, previousOwner);
-
///
/// Returns the amount of time it will take for the provided to pick up this item, based on and active status effects.
///
@@ -610,11 +588,11 @@ public void Spawn()
/// The rotation to spawn the .
/// An optional previous owner of the item.
/// The spawned .
- ///
- public Pickup Spawn(Vector3 position, Quaternion rotation, Player previousOwner = null)
+ ///
+ public Pickup Spawn(Vector3 position, Quaternion? rotation = null, Player previousOwner = null)
{
Position = position;
- Rotation = rotation;
+ Rotation = rotation ?? Quaternion.identity;
PreviousOwner = previousOwner;
Spawn();
diff --git a/EXILED/Exiled.API/Features/Pickups/Projectiles/EffectGrenadeProjectile.cs b/EXILED/Exiled.API/Features/Pickups/Projectiles/EffectGrenadeProjectile.cs
index cea47c3ea..a4cd84ef9 100644
--- a/EXILED/Exiled.API/Features/Pickups/Projectiles/EffectGrenadeProjectile.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Projectiles/EffectGrenadeProjectile.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pickups/Projectiles/ExplosionGrenadeProjectile.cs b/EXILED/Exiled.API/Features/Pickups/Projectiles/ExplosionGrenadeProjectile.cs
index 2afb3e918..70a40ce88 100644
--- a/EXILED/Exiled.API/Features/Pickups/Projectiles/ExplosionGrenadeProjectile.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Projectiles/ExplosionGrenadeProjectile.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pickups/Projectiles/FlashbangProjectile.cs b/EXILED/Exiled.API/Features/Pickups/Projectiles/FlashbangProjectile.cs
index 8fe0445ce..8c289c284 100644
--- a/EXILED/Exiled.API/Features/Pickups/Projectiles/FlashbangProjectile.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Projectiles/FlashbangProjectile.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pickups/Projectiles/Projectile.cs b/EXILED/Exiled.API/Features/Pickups/Projectiles/Projectile.cs
index 5406d6414..17a0691b9 100644
--- a/EXILED/Exiled.API/Features/Pickups/Projectiles/Projectile.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Projectiles/Projectile.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -114,19 +114,6 @@ internal Projectile(ItemType type)
public static Projectile Create(ProjectileType projectiletype)
where T : Projectile => Create(projectiletype) as T;
- ///
- /// Spawns a .
- ///
- /// The too spawn.
- /// The position to spawn the at.
- /// The rotation to spawn the .
- /// Whether the should be in active state after spawn.
- /// An optional previous owner of the item.
- /// The Spawn.
- [Obsolete("Use pickup.Spawn(Vector3, Quaternion, Player) instead of this", true)]
- public static Projectile Spawn(Projectile pickup, Vector3 position, Quaternion rotation, bool shouldBeActive = true, Player previousOwner = null)
- => pickup.Spawn(position, rotation, shouldBeActive, previousOwner);
-
///
/// Creates and spawns a .
///
@@ -135,8 +122,8 @@ public static Projectile Spawn(Projectile pickup, Vector3 position, Quaternion r
/// The rotation to spawn the .
/// Whether the should be in active state after spawn.
/// An optional previous owner of the item.
- /// The . See documentation of for more information on casting.
- public static Projectile CreateAndSpawn(ProjectileType type, Vector3 position, Quaternion rotation, bool shouldBeActive = true, Player previousOwner = null) => Create(type).Spawn(position, rotation, shouldBeActive, previousOwner);
+ /// The . See documentation of for more information on casting.
+ public static Projectile CreateAndSpawn(ProjectileType type, Vector3 position, Quaternion? rotation = null, bool shouldBeActive = true, Player previousOwner = null) => Create(type).Spawn(position, rotation, shouldBeActive, previousOwner);
///
/// Creates and spawns a .
@@ -147,8 +134,8 @@ public static Projectile Spawn(Projectile pickup, Vector3 position, Quaternion r
/// Whether the should be in active state after spawn.
/// An optional previous owner of the item.
/// The specified type.
- /// The . See documentation of for more information on casting.
- public static Projectile CreateAndSpawn(ProjectileType type, Vector3 position, Quaternion rotation, bool shouldBeActive = true, Player previousOwner = null)
+ /// The . See documentation of for more information on casting.
+ public static Projectile CreateAndSpawn(ProjectileType type, Vector3 position, Quaternion? rotation = null, bool shouldBeActive = true, Player previousOwner = null)
where T : Projectile => CreateAndSpawn(type, position, rotation, shouldBeActive, previousOwner) as T;
///
@@ -164,10 +151,10 @@ public static Projectile CreateAndSpawn(ProjectileType type, Vector3 position
/// Whether the should be in active state after spawn.
/// An optional previous owner of the item.
/// The spawned .
- public Projectile Spawn(Vector3 position, Quaternion rotation, bool shouldBeActive = true, Player previousOwner = null)
+ public Projectile Spawn(Vector3 position, Quaternion? rotation = null, bool shouldBeActive = true, Player previousOwner = null)
{
Position = position;
- Rotation = rotation;
+ Rotation = rotation ?? Quaternion.identity;
PreviousOwner = previousOwner;
Spawn();
diff --git a/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp018Projectile.cs b/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp018Projectile.cs
index 798cd04fc..f33d935a9 100644
--- a/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp018Projectile.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp018Projectile.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -50,18 +50,9 @@ internal Scp018Projectile()
public new BaseScp018Projectile Base { get; }
///
- /// Gets or sets the pickup's PhysicsModule.
+ /// Gets the pickup's PhysicsModule.
///
- public new Scp018Physics PhysicsModule
- {
- get => Base.PhysicsModule as Scp018Physics;
- [Obsolete("Unsafe.", true)]
- set
- {
- Base.PhysicsModule.DestroyModule();
- Base.PhysicsModule = value;
- }
- }
+ public new Scp018Physics PhysicsModule => Base.PhysicsModule as Scp018Physics;
///
/// Gets or sets the pickup's max velocity.
@@ -90,7 +81,7 @@ public float VelocityPerBounce
}
///
- /// Gets a value indicating whether or not SCP-018 can injure teammates.
+ /// Gets a value indicating whether SCP-018 can injure teammates.
///
public bool IgnoreFriendlyFire => Base.IgnoreFriendlyFire;
diff --git a/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp2176Projectile.cs b/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp2176Projectile.cs
index 7032f3bcc..0c5715a9b 100644
--- a/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp2176Projectile.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp2176Projectile.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -43,7 +43,7 @@ internal Scp2176Projectile()
public new BaseScp2176Projectile Base { get; }
///
- /// Gets a value indicating whether or not SCP-2176 has shattered.
+ /// Gets a value indicating whether SCP-2176 has shattered.
///
public bool IsAlreadyTriggered => Base._hasTriggered;
diff --git a/EXILED/Exiled.API/Features/Pickups/Projectiles/TimeGrenadeProjectile.cs b/EXILED/Exiled.API/Features/Pickups/Projectiles/TimeGrenadeProjectile.cs
index d184e44ff..cafd9be8c 100644
--- a/EXILED/Exiled.API/Features/Pickups/Projectiles/TimeGrenadeProjectile.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Projectiles/TimeGrenadeProjectile.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pickups/RadioPickup.cs b/EXILED/Exiled.API/Features/Pickups/RadioPickup.cs
index d68434f09..b2eef7340 100644
--- a/EXILED/Exiled.API/Features/Pickups/RadioPickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/RadioPickup.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pickups/Scp1576Pickup.cs b/EXILED/Exiled.API/Features/Pickups/Scp1576Pickup.cs
index 47bf2eb95..64ab902dc 100644
--- a/EXILED/Exiled.API/Features/Pickups/Scp1576Pickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Scp1576Pickup.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pickups/Scp244Pickup.cs b/EXILED/Exiled.API/Features/Pickups/Scp244Pickup.cs
index f852fcc3a..b7ac0126c 100644
--- a/EXILED/Exiled.API/Features/Pickups/Scp244Pickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Scp244Pickup.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -96,12 +96,12 @@ public float Health
}
///
- /// Gets a value indicating whether or not this Scp244 is breakable.
+ /// Gets a value indicating whether this Scp244 is breakable.
///
public bool IsBreakable => Base.State is Scp244State.Idle or Scp244State.Active;
///
- /// Gets a value indicating whether or not this Scp244 is broken.
+ /// Gets a value indicating whether this Scp244 is broken.
///
public bool IsBroken => Base.State is Scp244State.Destroyed;
diff --git a/EXILED/Exiled.API/Features/Pickups/Scp330Pickup.cs b/EXILED/Exiled.API/Features/Pickups/Scp330Pickup.cs
index 4410e4300..a4a971afb 100644
--- a/EXILED/Exiled.API/Features/Pickups/Scp330Pickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/Scp330Pickup.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pickups/UsablePickup.cs b/EXILED/Exiled.API/Features/Pickups/UsablePickup.cs
index e05a20eea..023469e4f 100644
--- a/EXILED/Exiled.API/Features/Pickups/UsablePickup.cs
+++ b/EXILED/Exiled.API/Features/Pickups/UsablePickup.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs
index d5e3d3eae..b76a88753 100644
--- a/EXILED/Exiled.API/Features/Player.cs
+++ b/EXILED/Exiled.API/Features/Player.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -36,18 +36,18 @@ namespace Exiled.API.Features
using InventorySystem.Disarming;
using InventorySystem.Items;
using InventorySystem.Items.Armor;
- using InventorySystem.Items.Firearms;
using InventorySystem.Items.Firearms.Attachments;
- using InventorySystem.Items.Firearms.BasicMessages;
+ using InventorySystem.Items.Firearms.Modules;
+ using InventorySystem.Items.Firearms.ShotEvents;
using InventorySystem.Items.Usables;
using InventorySystem.Items.Usables.Scp330;
using MapGeneration.Distributors;
using MEC;
using Mirror;
using Mirror.LiteNetLib4Mirror;
- using NorthwoodLib;
using PlayerRoles;
using PlayerRoles.FirstPersonControl;
+ using PlayerRoles.FirstPersonControl.Thirdperson.Subcontrollers;
using PlayerRoles.RoleAssign;
using PlayerRoles.Spectating;
using PlayerRoles.Voice;
@@ -136,7 +136,7 @@ public Player(GameObject gameObject)
///
/// Gets a list of all 's on the server.
///
- public static IReadOnlyCollection List => Dictionary.Values;
+ public static IReadOnlyCollection List => Dictionary.Values.Where(x => !x.IsNPC).ToList();
///
/// Gets a containing cached and their user ids.
@@ -158,7 +158,7 @@ public Player(GameObject gameObject)
public Dictionary> CustomRoleFriendlyFireMultiplier { get; set; } = DictionaryPool>.Pool.Get();
///
- /// Gets or sets a unique custom role that does not adbide to base game for this player. Used in conjunction with .
+ /// Gets or sets a unique custom role that does not abide to base game for this player. Used in conjunction with .
///
public string UniqueRole { get; set; } = string.Empty;
@@ -207,16 +207,10 @@ private set
public Hint CurrentHint { get; internal set; }
///
- /// Gets a value indicating whether or not the player is viewing a hint.
+ /// Gets a value indicating whether the player is viewing a hint.
///
public bool HasHint => CurrentHint != null;
- ///
- /// Gets the 's , can be null.
- ///
- [Obsolete("Use IVoiceRole::VoiceModule instead.")]
- public VoiceModuleBase VoiceModule => Role is Roles.IVoiceRole voiceRole ? voiceRole.VoiceModule : null;
-
///
/// Gets the 's , can be null.
///
@@ -260,12 +254,6 @@ public int Id
///
public string UserId => referenceHub.authManager.UserId;
- ///
- /// Gets or sets the player's custom user id.
- ///
- [Obsolete("Remove by NW", true)]
- public string CustomUserId { get; set; }
-
///
/// Gets the player's user id without the authentication.
///
@@ -300,7 +288,7 @@ public AuthenticationType AuthenticationType
}
///
- /// Gets a value indicating whether or not the player is verified.
+ /// Gets a value indicating whether the player is verified.
///
///
/// This is always if online_mode is set to .
@@ -308,12 +296,12 @@ public AuthenticationType AuthenticationType
public bool IsVerified { get; internal set; }
///
- /// Gets or sets a value indicating whether or not the player is a NPC.
+ /// Gets a value indicating whether the player is a NPC.
///
- public bool IsNPC { get; set; }
+ public bool IsNPC => ReferenceHub.IsDummy;
///
- /// Gets a value indicating whether or not the player has an active CustomName.
+ /// Gets a value indicating whether the player has an active CustomName.
///
public bool HasCustomName => ReferenceHub.nicknameSync.HasCustomName;
@@ -359,7 +347,7 @@ public string CustomInfo
set
{
// NW Client check.
- if (value.Contains('<'))
+ if (value.Contains('<'))
{
foreach (string token in value.Split('<'))
{
@@ -417,7 +405,7 @@ public float InfoViewRange
public Dictionary SessionVariables { get; } = DictionaryPool.Pool.Get();
///
- /// Gets a value indicating whether or not the player has Do Not Track (DNT) enabled. If this value is , data about the player unrelated to server security shouldn't be stored.
+ /// Gets a value indicating whether the player has Do Not Track (DNT) enabled. If this value is , data about the player unrelated to server security shouldn't be stored.
///
public bool DoNotTrack => ReferenceHub.authManager.DoNotTrack;
@@ -427,14 +415,14 @@ public float InfoViewRange
public bool IsConnected => GameObject != null;
///
- /// Gets a value indicating whether or not the player has a reserved slot.
+ /// Gets a value indicating whether the player has a reserved slot.
///
///
///
public bool HasReservedSlot => ReservedSlot.HasReservedSlot(UserId, out _);
///
- /// Gets a value indicating whether or not the player is in whitelist.
+ /// Gets a value indicating whether the player is in whitelist.
///
/// It will always return if a whitelist is disabled on the server.
///
@@ -442,12 +430,12 @@ public float InfoViewRange
public bool IsWhitelisted => WhiteList.IsWhitelisted(UserId);
///
- /// Gets a value indicating whether or not the player has Remote Admin access.
+ /// Gets a value indicating whether the player has Remote Admin access.
///
public bool RemoteAdminAccess => ReferenceHub.serverRoles.RemoteAdmin;
///
- /// Gets a value indicating whether or not the player has Admin Chat access.
+ /// Gets a value indicating whether the player has Admin Chat access.
///
public bool AdminChatAccess => ReferenceHub.serverRoles.AdminChatPerms;
@@ -457,7 +445,7 @@ public float InfoViewRange
public byte KickPower => ReferenceHub.serverRoles.KickPower;
///
- /// Gets or sets a value indicating whether or not the player's overwatch is enabled.
+ /// Gets or sets a value indicating whether the player's overwatch is enabled.
///
public bool IsOverwatchEnabled
{
@@ -466,7 +454,7 @@ public bool IsOverwatchEnabled
}
///
- /// Gets or sets a value indicating whether or not the player is allowed to enter noclip mode.
+ /// Gets or sets a value indicating whether the player is allowed to enter noclip mode.
///
/// For forcing the player into noclip mode, see .
///
@@ -589,9 +577,18 @@ public PlayerPermissions RemoteAdminPermissions
public Role Role
{
get => role ??= Role.Create(RoleManager.CurrentRole);
- internal set => role = value;
+ internal set
+ {
+ PreviousRole = role?.Type ?? RoleTypeId.None;
+ role = value;
+ }
}
+ ///
+ /// Gets the role that player had before changing role.
+ ///
+ public RoleTypeId PreviousRole { get; private set; }
+
///
/// Gets or sets the player's SCP preferences.
///
@@ -608,28 +605,31 @@ public ScpSpawnPreferences.SpawnPreferences ScpPreferences
}
///
- /// Gets a value indicating whether or not the player is cuffed.
+ /// Gets a value indicating whether the player is cuffed.
///
/// Players can be cuffed without another player being the cuffer.
public bool IsCuffed => Inventory.IsDisarmed();
+ // TODO NOT FINISH
+ /*
///
- /// Gets a value indicating whether or not the player is reloading a weapon.
+ /// Gets a value indicating whether the player is reloading a weapon.
///
public bool IsReloading => CurrentItem is Firearm firearm && !firearm.Base.AmmoManagerModule.Standby;
///
- /// Gets a value indicating whether or not the player is aiming with a weapon.
+ /// Gets a value indicating whether the player is aiming with a weapon.
///
public bool IsAimingDownWeapon => CurrentItem is Firearm firearm && firearm.Aiming;
+ */
///
- /// Gets a value indicating whether or not the player has enabled weapon's flashlight module.
+ /// Gets a value indicating whether the player has enabled weapon's flashlight module.
///
public bool HasFlashlightModuleEnabled => CurrentItem is Firearm firearm && firearm.FlashlightEnabled;
///
- /// Gets a value indicating whether or not the player is jumping.
+ /// Gets a value indicating whether the player is jumping.
///
public bool IsJumping => Role is FpcRole fpc && fpc.FirstPersonController.FpcModule.Motor.IsJumping;
@@ -659,51 +659,56 @@ public ScpSpawnPreferences.SpawnPreferences ScpPreferences
public uint NetId => ReferenceHub.netId;
///
- /// Gets a value indicating whether or not the player is the host.
+ /// Gets a value indicating whether the player is the host.
///
public bool IsHost => ReferenceHub.isLocalPlayer;
///
- /// Gets a value indicating whether or not the player is alive.
+ /// Gets a value indicating whether the player is alive.
///
public bool IsAlive => !IsDead;
///
- /// Gets a value indicating whether or not the player is dead.
+ /// Gets a value indicating whether the player is dead.
///
public bool IsDead => Role?.IsDead ?? false;
///
- /// Gets a value indicating whether or not the player's is any NTF rank.
+ /// Gets a value indicating whether the player's is any Foundation Forces.
/// Equivalent to checking the player's .
///
- // TODO: Change logic for FacilityGuard in next major update
- public bool IsNTF => Role?.Team is Team.FoundationForces;
+ public bool IsFoundationForces => Role?.Team is Team.FoundationForces;
///
- /// Gets a value indicating whether or not the player's is any Chaos rank.
+ /// Gets a value indicating whether the player's is any NTF rank and not a Facility Guard.
+ /// Equivalent to checking the player's .
+ ///
+ public bool IsNTF => Role?.Team is Team.FoundationForces && Role?.Type is not RoleTypeId.FacilityGuard;
+
+ ///
+ /// Gets a value indicating whether the player's is any Chaos rank.
/// Equivalent to checking the player's .
///
public bool IsCHI => Role?.Team is Team.ChaosInsurgency;
///
- /// Gets a value indicating whether or not the player's is any SCP.
+ /// Gets a value indicating whether the player's is any SCP.
/// Equivalent to checking the player's .
///
- public bool IsScp => Role?.Team is Team.SCPs;
+ public bool IsScp => Role?.Type.IsScp() ?? false;
///
- /// Gets a value indicating whether or not the player's is any human rank.
+ /// Gets a value indicating whether the player's is any human rank.
///
public bool IsHuman => Role is not null && Role.Is(out HumanRole _);
///
- /// Gets a value indicating whether or not the player's is equal to .
+ /// Gets a value indicating whether the player's is equal to .
///
public bool IsTutorial => Role?.Type is RoleTypeId.Tutorial;
///
- /// Gets a value indicating whether or not the player's friendly fire is enabled.
+ /// Gets a value indicating whether the player's friendly fire is enabled.
/// This property only determines if this player can deal damage to players on the same team;
/// This player can be damaged by other players on their own team even if this property is .
///
@@ -719,7 +724,7 @@ public Vector3 Scale
}
///
- /// Gets or sets a value indicating whether or not the player's bypass mode is enabled.
+ /// Gets or sets a value indicating whether the player's bypass mode is enabled.
///
public bool IsBypassModeEnabled
{
@@ -728,7 +733,16 @@ public bool IsBypassModeEnabled
}
///
- /// Gets or sets a value indicating whether or not the player is muted.
+ /// Gets or sets the player's emotion.
+ ///
+ public EmotionPresetType Emotion
+ {
+ get => EmotionSync.GetEmotionPreset(ReferenceHub);
+ set => EmotionSync.ServerSetEmotionPreset(ReferenceHub, value);
+ }
+
+ ///
+ /// Gets or sets a value indicating whether the player is muted.
///
/// This property will NOT persistently mute and unmute the player. For persistent mutes, see and .
public bool IsMuted
@@ -744,7 +758,7 @@ public bool IsMuted
}
///
- /// Gets or sets a value indicating whether or not the player is global muted.
+ /// Gets or sets a value indicating whether the player is global muted.
///
/// This property will NOT persistently mute and unmute the player. For persistent mutes, see and .
public bool IsGlobalMuted
@@ -760,7 +774,7 @@ public bool IsGlobalMuted
}
///
- /// Gets or sets a value indicating whether or not the player is intercom muted.
+ /// Gets or sets a value indicating whether the player is intercom muted.
///
/// This property will NOT persistently mute and unmute the player. For persistent mutes, see and .
public bool IsIntercomMuted
@@ -776,7 +790,7 @@ public bool IsIntercomMuted
}
///
- /// Gets a value indicating whether or not the player is speaking.
+ /// Gets a value indicating whether the player is speaking.
///
public bool IsSpeaking => Role is Roles.IVoiceRole voiceRole && voiceRole.VoiceModule.IsSpeaking;
@@ -801,12 +815,12 @@ public VoiceChatChannel VoiceChannel
}
///
- /// Gets a value indicating whether or not the player is transmitting on a Radio.
+ /// Gets a value indicating whether the player is transmitting on a Radio.
///
public bool IsTransmitting => PersonalRadioPlayback.IsTransmitting(ReferenceHub);
///
- /// Gets or sets a value indicating whether or not the player has godmode enabled.
+ /// Gets or sets a value indicating whether the player has godmode enabled.
///
public bool IsGodModeEnabled
{
@@ -817,7 +831,7 @@ public bool IsGodModeEnabled
///
/// Gets the player's unit name.
///
- public string UnitName => Role.Base is PlayerRoles.HumanRole humanRole ? UnitNameMessageHandler.GetReceived(humanRole.AssignedSpawnableTeam, humanRole.UnitNameId) : string.Empty;
+ public string UnitName => Role is HumanRole humanRole ? humanRole.UnitName : string.Empty;
///
/// Gets or sets the player's unit id.
@@ -972,7 +986,7 @@ public float Stamina
}
///
- /// Gets a value indicating whether or not the staff bypass is enabled.
+ /// Gets a value indicating whether the staff bypass is enabled.
///
public bool IsStaffBypassEnabled => ReferenceHub.authManager.BypassBansFlagSet;
@@ -1054,7 +1068,7 @@ public Badge? GlobalBadge
}
///
- /// Gets or sets a value indicating whether or not the player's badge is hidden.
+ /// Gets or sets a value indicating whether the player's badge is hidden.
///
public bool BadgeHidden
{
@@ -1069,22 +1083,22 @@ public bool BadgeHidden
}
///
- /// Gets a value indicating whether or not the player is Northwood staff.
+ /// Gets a value indicating whether the player is Northwood staff.
///
public bool IsNorthwoodStaff => ReferenceHub.authManager.NorthwoodStaff;
///
- /// Gets a value indicating whether or not the player is a global moderator.
+ /// Gets a value indicating whether the player is a global moderator.
///
public bool IsGlobalModerator => ReferenceHub.authManager.RemoteAdminGlobalAccess;
///
- /// Gets a value indicating whether or not the player is in the pocket dimension.
+ /// Gets a value indicating whether the player is in the pocket dimension.
///
public bool IsInPocketDimension => CurrentRoom?.Type is RoomType.Pocket;
///
- /// Gets or sets a value indicating whether or not the player should use stamina system.
+ /// Gets or sets a value indicating whether the player should use stamina system.
///
public bool IsUsingStamina { get; set; } = true;
@@ -1099,17 +1113,17 @@ public bool BadgeHidden
public IReadOnlyCollection Items { get; }
///
- /// Gets a value indicating whether or not the player's inventory is empty.
+ /// Gets a value indicating whether the player's inventory is empty.
///
public bool IsInventoryEmpty => Items.Count is 0;
///
- /// Gets a value indicating whether or not the player's inventory is full.
+ /// Gets a value indicating whether the player's inventory is full.
///
public bool IsInventoryFull => Items.Count >= Inventory.MaxSlots;
///
- /// Gets a value indicating whether or not the player has agreed to microphone recording.
+ /// Gets a value indicating whether the player has agreed to microphone recording.
///
public bool AgreedToRecording => VoiceChatPrivacySettings.CheckUserFlags(ReferenceHub, VcPrivacyFlags.SettingsSelected | VcPrivacyFlags.AllowRecording | VcPrivacyFlags.AllowMicCapture);
@@ -1129,7 +1143,7 @@ public bool BadgeHidden
public Footprint Footprint => new(ReferenceHub);
///
- /// Gets or sets a value indicating whether or not the player is spawn protected.
+ /// Gets or sets a value indicating whether the player is spawn protected.
///
public bool IsSpawnProtected
{
@@ -1317,7 +1331,7 @@ public static Player Get(string args)
if (!player.IsVerified || player.Nickname is null)
continue;
- if (!player.Nickname.Contains(args, StringComparison.OrdinalIgnoreCase))
+ if (!player.Nickname.ToLower().Contains(args.ToLower()))
continue;
string secondString = player.Nickname;
@@ -1355,7 +1369,7 @@ public static Player Get(string args)
///
/// The .
/// The player that matches the given , or if no player is found.
- /// A boolean indicating whether or not a player was found.
+ /// A boolean indicating whether a player was found.
public static bool TryGet(CommandSystem.ICommandSender sender, out Player player) => (player = Get(sender)) is not null;
///
@@ -1363,7 +1377,7 @@ public static Player Get(string args)
///
/// The .
/// The player that matches the given , or if no player is found.
- /// A boolean indicating whether or not a player was found.
+ /// A boolean indicating whether a player was found.
public static bool TryGet(Footprint footprint, out Player player) => (player = Get(footprint)) is not null;
///
@@ -1371,7 +1385,7 @@ public static Player Get(string args)
///
/// The .
/// The player that matches the given , or if no player is found.
- /// A boolean indicating whether or not a player was found.
+ /// A boolean indicating whether a player was found.
public static bool TryGet(CommandSender sender, out Player player) => (player = Get(sender)) is not null;
///
@@ -1379,7 +1393,7 @@ public static Player Get(string args)
///
/// The .
/// The player that matches the given , or if no player is found.
- /// A boolean indicating whether or not a player was found.
+ /// A boolean indicating whether a player was found.
public static bool TryGet(ReferenceHub referenceHub, out Player player) => (player = Get(referenceHub)) is not null;
///
@@ -1387,7 +1401,7 @@ public static Player Get(string args)
///
/// The network ID.
/// The player that matches the given net ID, or if no player is found.
- /// A boolean indicating whether or not a player was found.
+ /// A boolean indicating whether a player was found.
public static bool TryGet(uint netId, out Player player) => (player = Get(netId)) is not null;
///
@@ -1395,7 +1409,7 @@ public static Player Get(string args)
///
/// The .
/// The player that matches the given , or if no player is found.
- /// A boolean indicating whether or not a player was found.
+ /// A boolean indicating whether a player was found.
public static bool TryGet(NetworkIdentity netIdentity, out Player player) => (player = Get(netIdentity)) is not null;
///
@@ -1403,7 +1417,7 @@ public static Player Get(string args)
///
/// The .
/// The player that matches the given , or if no player is found.
- /// A boolean indicating whether or not a player was found.
+ /// A boolean indicating whether a player was found.
public static bool TryGet(NetworkConnection conn, out Player player) => (player = Get(conn)) is not null;
///
@@ -1411,7 +1425,7 @@ public static Player Get(string args)
///
/// The .
/// The player that matches the given , or if no player is found.
- /// A boolean indicating whether or not a player was found.
+ /// A boolean indicating whether a player was found.
public static bool TryGet(GameObject gameObject, out Player player) => (player = Get(gameObject)) is not null;
///
@@ -1419,7 +1433,7 @@ public static Player Get(string args)
///
/// The user ID.
/// The player that matches the given ID, or if no player is found.
- /// A boolean indicating whether or not a player was found.
+ /// A boolean indicating whether a player was found.
public static bool TryGet(int id, out Player player) => (player = Get(id)) is not null;
///
@@ -1427,7 +1441,7 @@ public static Player Get(string args)
///
/// The player's nickname, ID, steamID64 or Discord ID.
/// The player found or if not found.
- /// A boolean indicating whether or not a player was found.
+ /// A boolean indicating whether a player was found.
public static bool TryGet(string args, out Player player) => (player = Get(args)) is not null;
///
@@ -1435,7 +1449,7 @@ public static Player Get(string args)
///
/// The class.
/// The player found or if not found.
- /// A boolean indicating whether or not a player was found.
+ /// A boolean indicating whether a player was found.
public static bool TryGet(PluginAPI.Core.Player apiPlayer, out Player player) => (player = Get(apiPlayer)) is not null;
///
@@ -1443,7 +1457,7 @@ public static Player Get(string args)
///
/// The .
/// The player found or if not found.
- /// A boolean indicating whether or not a player was found.
+ /// A boolean indicating whether a player was found.
public static bool TryGet(Collider collider, out Player player) => (player = Get(collider)) is not null;
///
@@ -1464,21 +1478,11 @@ public static Player Get(string args)
/// An representing the processed players.
public static IEnumerable GetProcessedData(ArraySegment args, int startIndex = 0) => GetProcessedData(args, startIndex, out string[] _);
- ///
- /// Adds a player's UserId to the list of reserved slots.
- ///
- /// This method does not permanently give a user a reserved slot. The slot will be removed if the reserved slots are reloaded.
- /// The UserId of the player to add.
- /// if the slot was successfully added, or if the provided UserId already has a reserved slot.
- ///
- // TODO: Remove this method
- public static bool AddReservedSlot(string userId) => ReservedSlot.Users.Add(userId);
-
///
/// Adds a player's UserId to the list of reserved slots.
///
/// The UserId of the player to add.
- /// Whether or not to add a permanently. It will write a to UserIDReservedSlots.txt file.
+ /// Whether to add a permanently. It will write a to UserIDReservedSlots.txt file.
/// if the slot was successfully added, or if the provided UserId already has a reserved slot.
///
public static bool AddReservedSlot(string userId, bool isPermanent)
@@ -1499,7 +1503,7 @@ public static bool AddReservedSlot(string userId, bool isPermanent)
/// Adds a player's UserId to the whitelist.
///
/// The UserId of the player to add.
- /// Whether or not to add a permanently. It will write a to UserIDWhitelist.txt file.
+ /// Whether to add a permanently. It will write a to UserIDWhitelist.txt file.
/// if the record was successfully added, or if the provided UserId already is in whitelist.
///
public static bool AddToWhitelist(string userId, bool isPermanent)
@@ -1526,19 +1530,10 @@ public static bool AddToWhitelist(string userId, bool isPermanent)
///
public static void ReloadWhitelist() => WhiteList.Reload();
- ///
- /// Adds the player's UserId to the list of reserved slots.
- ///
- /// This method does not permanently give a user a reserved slot. The slot will be removed if the reserved slots are reloaded.
- /// if the slot was successfully added, or if the player already has a reserved slot.
- ///
- // TODO: Remove this method
- public bool GiveReservedSlot() => AddReservedSlot(UserId);
-
///
/// Adds a player's UserId to the list of reserved slots.
///
- /// Whether or not to add a player's UserId permanently. It will write a player's UserId to UserIDReservedSlots.txt file.
+ /// Whether to add a player's UserId permanently. It will write a player's UserId to UserIDReservedSlots.txt file.
/// if the slot was successfully added, or if the provided UserId already has a reserved slot.
///
public bool GiveReservedSlot(bool isPermanent) => AddReservedSlot(UserId, isPermanent);
@@ -1546,7 +1541,7 @@ public static bool AddToWhitelist(string userId, bool isPermanent)
///
/// Adds a player's UserId to the whitelist.
///
- /// Whether or not to add a player's UserId permanently. It will write a player's UserId to UserIDWhitelist.txt file.
+ /// Whether to add a player's UserId permanently. It will write a player's UserId to UserIDWhitelist.txt file.
/// if the record was successfully added, or if the provided UserId already is in whitelist.
///
public bool GrantWhitelist(bool isPermanent) => AddToWhitelist(UserId, isPermanent);
@@ -1575,7 +1570,7 @@ public void SetFriendlyFire(RoleTypeId roleToAdd, float ffMult)
///
/// Role to add.
/// Friendly fire multiplier.
- /// Whether or not the item was able to be added.
+ /// Whether the item was able to be added.
public bool TryAddFriendlyFire(RoleTypeId roleToAdd, float ffMult)
{
if (FriendlyFireMultiplier.ContainsKey(roleToAdd))
@@ -1589,15 +1584,15 @@ public bool TryAddFriendlyFire(RoleTypeId roleToAdd, float ffMult)
/// Tries to add to FriendlyFire rules.
///
/// Role FF multiplier to add.
- /// Whether or not the item was able to be added.
+ /// Whether the item was able to be added.
public bool TryAddFriendlyFire(KeyValuePair pairedRoleFF) => TryAddFriendlyFire(pairedRoleFF.Key, pairedRoleFF.Value);
///
/// Tries to add to FriendlyFire rules.
///
/// Roles to add with friendly fire values.
- /// Whether or not to overwrite current values if they exist.
- /// Whether or not the item was able to be added.
+ /// Whether to overwrite current values if they exist.
+ /// Whether the item was able to be added.
public bool TryAddFriendlyFire(Dictionary ffRules, bool overwrite = false)
{
Dictionary temporaryFriendlyFireRules = DictionaryPool.Pool.Get();
@@ -1661,7 +1656,7 @@ public void SetCustomRoleFriendlyFire(string roleTypeId, RoleTypeId roleToAdd, f
///
/// Role associated for CustomFF.
/// Role to add and FF multiplier.
- /// Whether or not the item was able to be added.
+ /// Whether the item was able to be added.
public bool TryAddCustomRoleFriendlyFire(string roleTypeId, KeyValuePair roleFf) => TryAddCustomRoleFriendlyFire(roleTypeId, roleFf.Key, roleFf.Value);
///
@@ -1670,7 +1665,7 @@ public void SetCustomRoleFriendlyFire(string roleTypeId, RoleTypeId roleToAdd, f
/// Role associated for CustomFF.
/// Role to add.
/// Friendly fire multiplier.
- /// Whether or not the item was able to be added.
+ /// Whether the item was able to be added.
public bool TryAddCustomRoleFriendlyFire(string roleTypeId, RoleTypeId roleToAdd, float ffMult)
{
if (CustomRoleFriendlyFireMultiplier.TryGetValue(roleTypeId, out Dictionary currentPairedData))
@@ -1694,7 +1689,7 @@ public bool TryAddCustomRoleFriendlyFire(string roleTypeId, RoleTypeId roleToAdd
/// Role associated for CustomFF.
/// Roles to add with friendly fire values.
/// Whether to overwrite current values if they exist - does NOT delete previous entries if they are not in provided rules.
- /// Whether or not the item was able to be added.
+ /// Whether the item was able to be added.
public bool TryAddCustomRoleFriendlyFire(string customRoleName, Dictionary ffRules, bool overwrite = false)
{
Dictionary temporaryFriendlyFireRules = DictionaryPool.Pool.Get();
@@ -1761,14 +1756,14 @@ public void TrySetCustomRoleFriendlyFire(string roleTypeId, Dictionary from FriendlyFire rules.
///
/// Role to add.
- /// Whether or not the item was able to be added.
+ /// Whether the item was able to be added.
public bool TryRemoveFriendlyFire(RoleTypeId role) => FriendlyFireMultiplier.Remove(role);
///
/// Tries to remove from FriendlyFire rules.
///
/// Role to add.
- /// Whether or not the item was able to be added.
+ /// Whether the item was able to be added.
public bool TryRemoveCustomeRoleFriendlyFire(string role) => CustomRoleFriendlyFireMultiplier.Remove(role);
///
@@ -1779,9 +1774,12 @@ public bool ReloadWeapon()
{
if (CurrentItem is Firearm firearm)
{
- bool result = firearm.Base.AmmoManagerModule.ServerTryReload();
+ // TODO not finish
+ /*
+ bool result = firearm.Base.Ammo.ServerTryReload();
Connection.Send(new RequestMessage(firearm.Serial, RequestType.Reload));
return result;
+ */
}
return false;
@@ -1909,14 +1907,14 @@ public Pickup DropHeldItem()
}
///
- /// Indicates whether or not the player has an item.
+ /// Indicates whether the player has an item.
///
/// The item to search for.
/// , if the player has it; otherwise, .
public bool HasItem(Item item) => Items.Contains(item);
///
- /// Indicates whether or not the player has an item type.
+ /// Indicates whether the player has an item type.
///
/// The type to search for.
/// , if the player has it; otherwise, .
@@ -1956,8 +1954,8 @@ public Pickup DropHeldItem()
/// Removes an from the player's inventory.
///
/// The to remove.
- /// Whether or not to destroy the item.
- /// A value indicating whether or not the was removed.
+ /// Whether to destroy the item.
+ /// A value indicating whether the was removed.
public bool RemoveItem(Item item, bool destroy = true)
{
if (!ItemsValue.Contains(item))
@@ -1998,8 +1996,8 @@ public bool RemoveItem(Item item, bool destroy = true)
/// Removes an from the player's inventory.
///
/// The serial to remove.
- /// Whether or not to destroy the item.
- /// A value indicating whether or not the was removed.
+ /// Whether to destroy the item.
+ /// A value indicating whether the was removed.
public bool RemoveItem(ushort serial, bool destroy = true)
{
if (Items.SingleOrDefault(item => item.Serial == serial) is not Item item)
@@ -2011,7 +2009,7 @@ public bool RemoveItem(ushort serial, bool destroy = true)
/// Removes all 's that satisfy the condition from the player's inventory.
///
/// The condition to satisfy.
- /// Whether or not to destroy the items.
+ /// Whether to destroy the items.
/// Count of a successfully removed 's.
public int RemoveItem(Func predicate, bool destroy = true)
{
@@ -2031,8 +2029,8 @@ public int RemoveItem(Func predicate, bool destroy = true)
///
/// Removes the held from the player's inventory.
///
- /// Whether or not to destroy the item.
- /// Returns a value indicating whether or not the was removed.
+ /// Whether to destroy the item.
+ /// Returns a value indicating whether the was removed.
public bool RemoveHeldItem(bool destroy = true) => RemoveItem(CurrentItem, destroy);
///
@@ -2152,7 +2150,7 @@ public void Hurt(Player attacker, float amount, DamageType damageType = DamageTy
/// The throw force.
/// The armor penetration amount.
public void Hurt(Player attacker, float damage, Vector3 force = default, int armorPenetration = 0) =>
- Hurt(new ExplosionDamageHandler(attacker.Footprint, force, damage, armorPenetration));
+ Hurt(new ExplosionDamageHandler(attacker.Footprint, force, damage, armorPenetration, ExplosionType.Grenade));
///
/// Hurts the player.
@@ -2176,7 +2174,7 @@ public void Hurt(float damage, string damageReason, string cassieAnnouncement =
/// Heals the player.
///
/// The amount of health to heal.
- /// Whether or not healing should exceed their max health.
+ /// Whether healing should exceed their max health.
public void Heal(float amount, bool overrideMaxHealth = false)
{
if (!overrideMaxHealth)
@@ -2255,7 +2253,7 @@ public void Vaporize(Player attacker = null, string cassieAnnouncement = "")
if ((Role.Side != Side.Scp) && !string.IsNullOrEmpty(cassieAnnouncement))
Cassie.Message(cassieAnnouncement);
- Kill(new DisruptorDamageHandler(attacker?.Footprint ?? Footprint, -1));
+ Kill(new DisruptorDamageHandler(new DisruptorShotEvent(Item.Create(ItemType.ParticleDisruptor, attacker).Base as InventorySystem.Items.Firearms.Firearm, DisruptorActionModule.FiringState.FiringSingle), Vector3.up, -1));
}
///
@@ -2285,13 +2283,13 @@ public void Ban(int duration, string reason, Player issuer = null)
///
/// Persistently mutes the player. For temporary mutes, see and .
///
- /// Whether or not this mute is for the intercom only.
+ /// Whether this mute is for the intercom only.
public void Mute(bool isIntercom = false) => VoiceChatMutes.IssueLocalMute(UserId, isIntercom);
///
/// Revokes a persistent mute. For temporary mutes, see and .
///
- /// Whether or not this un-mute is for the intercom only.
+ /// Whether this un-mute is for the intercom only.
public void UnMute(bool isIntercom = false) => VoiceChatMutes.RevokeLocalMute(UserId, isIntercom);
///
@@ -2313,7 +2311,7 @@ public IEnumerator BlinkTag()
/// Sends a message to the player's Remote Admin console.
///
/// The message to be sent.
- /// Indicates whether or not the message should be highlighted as success.
+ /// Indicates whether the message should be highlighted as success.
/// The plugin name.
public void RemoteAdminMessage(string message, bool success = true, string pluginName = null)
{
@@ -2324,7 +2322,7 @@ public void RemoteAdminMessage(string message, bool success = true, string plugi
/// Sends a message to the player's Remote Admin Chat.
///
/// The message to be sent.
- /// Indicates whether or not the message should be highlighted as success.
+ /// Indicates whether the message should be highlighted as success.
/// if message was send; otherwise, .
public bool SendStaffMessage(string message, EncryptedChannelManager.EncryptedChannel channel = EncryptedChannelManager.EncryptedChannel.AdminChat)
{
@@ -2335,7 +2333,7 @@ public bool SendStaffMessage(string message, EncryptedChannelManager.EncryptedCh
/// Sends a message to the player's Remote Admin Chat.
///
/// The message to be sent.
- /// Indicates whether or not the message should be highlighted as success.
+ /// Indicates whether the message should be highlighted as success.
/// if message was send; otherwise, .
public bool SendStaffPing(string message, EncryptedChannelManager.EncryptedChannel channel = EncryptedChannelManager.EncryptedChannel.AdminChat)
{
@@ -2431,7 +2429,7 @@ public void SetAmmo(Dictionary ammoBag)
///
/// The that will be dropped.
/// The amount of ammo that will be dropped.
- /// Whether or not ammo limits will be taken into consideration.
+ /// Whether ammo limits will be taken into consideration.
/// if ammo was dropped; otherwise, .
public bool DropAmmo(AmmoType ammoType, ushort amount, bool checkMinimals = false) =>
Inventory.ServerDropAmmo(ammoType.GetItemType(), amount, checkMinimals).Any();
@@ -2456,17 +2454,6 @@ public ushort GetAmmoLimit(AmmoType type, bool ignoreArmor = false)
return InventorySystem.Configs.InventoryLimits.GetAmmoLimit(type.GetItemType(), referenceHub);
}
- ///
- /// Gets the maximum amount of ammo the player can hold, given the ammo .
- ///
- /// The of the ammo to check.
- /// The maximum amount of ammo this player can carry.
- [Obsolete("Use Player::GetAmmoLimit(AmmoType, bool) instead.")]
- public int GetAmmoLimit(AmmoType type)
- {
- return (int)InventorySystem.Configs.InventoryLimits.GetAmmoLimit(type.GetItemType(), referenceHub);
- }
-
///
/// Gets the maximum amount of ammo the player can hold, given the ammo .
/// This limit will scale with the armor the player is wearing.
@@ -2523,15 +2510,6 @@ public void ResetAmmoLimit(AmmoType ammoType)
/// If the player has a custom limit for the specific .
public bool HasCustomAmmoLimit(AmmoType ammoType) => CustomAmmoLimits.ContainsKey(ammoType);
- ///
- /// Gets the maximum amount of an the player can hold, based on the armor the player is wearing, as well as server configuration.
- ///
- /// The to check.
- /// The maximum amount of items in the category that the player can hold.
- [Obsolete("Use Player::GetCategoryLimit(ItemCategory, bool) instead.")]
- public int GetCategoryLimit(ItemCategory category) =>
- InventorySystem.Configs.InventoryLimits.GetCategoryLimit(category, referenceHub);
-
///
/// Gets the maximum amount of an the player can hold, based on the armor the player is wearing, as well as server configuration.
///
@@ -2659,16 +2637,6 @@ public Item AddItem(ItemType itemType)
return item;
}
- ///
- /// Adds an item of the specified type with default durability(ammo/charge) and no mods to the player's inventory.
- ///
- /// The item to be added.
- /// The attachments to be added to the item.
- /// The given to the player.
- [Obsolete("Use AddItem(ItemType) or AddItem(FirearmType, IEnumerable)", true)]
- public Item AddItem(ItemType itemType, IEnumerable identifiers = null)
- => itemType.GetFirearmType() is FirearmType.None ? AddItem(itemType) : AddItem(itemType.GetFirearmType(), identifiers);
-
///
/// Adds an firearm of the specified type with default durability(ammo/charge) and no mods to the player's inventory.
///
@@ -2686,12 +2654,15 @@ public Item AddItem(FirearmType firearmType, IEnumerable i
else if (Preferences is not null && Preferences.TryGetValue(firearmType, out AttachmentIdentifier[] attachments))
firearm.Base.ApplyAttachmentsCode(attachments.GetAttachmentsCode(), true);
+ // TODO Not finish
+ /*
FirearmStatusFlags flags = FirearmStatusFlags.MagazineInserted;
if (firearm.Attachments.Any(a => a.Name == AttachmentName.Flashlight))
flags |= FirearmStatusFlags.FlashlightEnabled;
firearm.Base.Status = new FirearmStatus(firearm.MaxAmmo, flags, firearm.Base.GetCurrentAttachmentsCode());
+ */
}
AddItem(item);
@@ -2717,17 +2688,6 @@ public IEnumerable AddItem(ItemType itemType, int amount)
return items;
}
- ///
- /// Adds the amount of items of the specified type with default durability(ammo/charge) and no mods to the player's inventory.
- ///
- /// The item to be added.
- /// The amount of items to be added.
- /// The attachments to be added to the item.
- /// An containing the items given.
- [Obsolete("Use AddItem(ItemType, int) or AddItem(FirearmType, int, IEnumerable)", true)]
- public IEnumerable AddItem(ItemType itemType, int amount, IEnumerable identifiers)
- => itemType.GetFirearmType() is FirearmType.None ? AddItem(itemType, amount) : AddItem(itemType.GetFirearmType(), amount, identifiers);
-
///
/// Adds the amount of firearms of the specified type with default durability(ammo/charge) and no mods to the player's inventory.
///
@@ -2767,22 +2727,6 @@ public IEnumerable AddItem(IEnumerable items)
return returnedItems;
}
- ///
- /// Adds the list of items of the specified type with default durability(ammo/charge) and no mods to the player's inventory.
- ///
- /// The of and of to be added.
- /// An containing the items given.
- [Obsolete("Use AddItem(Dictionary>) instead of this", true)]
- public IEnumerable AddItem(Dictionary> items)
- {
- List returnedItems = new(items.Count);
-
- foreach (KeyValuePair> item in items)
- returnedItems.Add(AddItem(item.Key, item.Value));
-
- return returnedItems;
- }
-
///
/// Adds the list of items of the specified type with default durability(ammo/charge) and no mods to the player's inventory.
///
@@ -2838,8 +2782,9 @@ public void AddItem(Firearm item, IEnumerable identifiers)
/// Adds an item to the player's inventory.
///
/// The of the item to be added.
+ /// The reason the item was added.
/// The that was added.
- public Item AddItem(Pickup pickup) => Item.Get(Inventory.ServerAddItem(pickup.Type, pickup.Serial, pickup.Base));
+ public Item AddItem(Pickup pickup, ItemAddReason addReason = ItemAddReason.Undefined) => Item.Get(Inventory.ServerAddItem(pickup.Type, addReason, pickup.Serial, pickup.Base));
///
/// Adds an item to the player's inventory.
@@ -2849,7 +2794,7 @@ public void AddItem(Firearm item, IEnumerable identifiers)
/// The that was added.
public Item AddItem(FirearmPickup pickup, IEnumerable identifiers)
{
- Firearm firearm = Item.Get(Inventory.ServerAddItem(pickup.Type, pickup.Serial, pickup.Base));
+ Firearm firearm = Item.Get(Inventory.ServerAddItem(pickup.Type, ItemAddReason.Undefined, pickup.Serial, pickup.Base));
if (identifiers is not null)
firearm.AddAttachment(identifiers);
@@ -2862,12 +2807,14 @@ public Item AddItem(FirearmPickup pickup, IEnumerable iden
///
/// The item to be added.
/// The object of the item.
+ /// The reason the item was added.
/// The that was added.
- public Item AddItem(ItemBase itemBase, Item item = null)
+ public Item AddItem(ItemBase itemBase, Item item = null, ItemAddReason addReason = ItemAddReason.AdminCommand)
{
try
{
item ??= Item.Get(itemBase);
+ item.AddReason = addReason;
Inventory.UserInventory.Items[item.Serial] = itemBase;
@@ -2891,23 +2838,6 @@ public Item AddItem(ItemBase itemBase, Item item = null)
return null;
}
- ///
- /// Adds the of items to the player's inventory.
- ///
- /// The item to be added.
- /// The amount of items to be added.
- [Obsolete("Removed this method can't be functional")]
- public void AddItem(Item item, int amount) => _ = item;
-
- ///
- /// Adds the of items to the player's inventory.
- ///
- /// The firearm to be added.
- /// The amount of items to be added.
- /// The attachments to be added to the item.
- [Obsolete("Removed this method can't be functional")]
- public void AddItem(Firearm firearm, int amount, IEnumerable identifiers) => _ = firearm;
-
///
/// Adds the list of items to the player's inventory.
///
@@ -2989,7 +2919,7 @@ public void ResetInventory(IEnumerable newItems)
///
/// Clears the player's inventory, including all ammo and items.
///
- /// Whether or not to fully destroy the old items.
+ /// Whether to fully destroy the old items.
///
///
///
@@ -3002,7 +2932,7 @@ public void ClearInventory(bool destroy = true)
///
/// Clears the player's items.
///
- /// Whether or not to fully destroy the old items.
+ /// Whether to fully destroy the old items.
///
///
///
@@ -3127,10 +3057,10 @@ public T GetModule()
=> ReferenceHub.playerStats.GetModule();
///
- /// Gets a describing whether or not the given status effect is currently enabled.
+ /// Gets a describing whether the given status effect is currently enabled.
///
/// The to check.
- /// A determining whether or not the player effect is active.
+ /// A determining whether the player effect is active.
public bool IsEffectActive()
where T : StatusEffectBase
{
@@ -3200,7 +3130,7 @@ public void DisableEffects(IEnumerable effects)
/// The to enable.
/// The amount of time the effect will be active for.
/// If the effect is already active, setting to will add this duration onto the effect.
- /// A bool indicating whether or not the effect was valid and successfully enabled.
+ /// A bool indicating whether the effect was valid and successfully enabled.
public bool EnableEffect(float duration = 0f, bool addDurationIfActive = false)
where T : StatusEffectBase => EnableEffect(1, duration, addDurationIfActive);
@@ -3211,7 +3141,7 @@ public bool EnableEffect(float duration = 0f, bool addDurationIfActive = fals
/// The intensity of the effect will be active for.
/// The amount of time the effect will be active for.
/// If the effect is already active, setting to will add this duration onto the effect.
- /// A bool indicating whether or not the effect was valid and successfully enabled.
+ /// A bool indicating whether the effect was valid and successfully enabled.
public bool EnableEffect(byte intensity, float duration = 0f, bool addDurationIfActive = false)
where T : StatusEffectBase => ReferenceHub.playerEffectsController.ChangeState(intensity, duration, addDurationIfActive);
@@ -3221,7 +3151,7 @@ public bool EnableEffect(byte intensity, float duration = 0f, bool addDuratio
/// The name of the to enable.
/// The amount of time the effect will be active for.
/// If the effect is already active, setting to will add this duration onto the effect.
- /// A bool indicating whether or not the effect was valid and successfully enabled.
+ /// A bool indicating whether the effect was valid and successfully enabled.
public bool EnableEffect(StatusEffectBase statusEffect, float duration = 0f, bool addDurationIfActive = false)
=> EnableEffect(statusEffect, 1, duration, addDurationIfActive);
@@ -3232,7 +3162,7 @@ public bool EnableEffect(StatusEffectBase statusEffect, float duration = 0f, boo
/// The intensity of the effect will be active for.
/// The amount of time the effect will be active for.
/// If the effect is already active, setting to will add this duration onto the effect.
- /// A bool indicating whether or not the effect was valid and successfully enabled.
+ /// A bool indicating whether the effect was valid and successfully enabled.
public bool EnableEffect(StatusEffectBase statusEffect, byte intensity, float duration = 0f, bool addDurationIfActive = false)
{
if (statusEffect is null)
@@ -3284,13 +3214,6 @@ public void EnableEffect(EffectType type, float duration = 0f, bool addDurationI
public bool EnableEffect(EffectType type, byte intensity, float duration = 0f, bool addDurationIfActive = false)
=> TryGetEffect(type, out StatusEffectBase statusEffect) && EnableEffect(statusEffect, intensity, duration, addDurationIfActive);
- ///
- /// Enables a status effect on the player.
- ///
- /// The to enable.
- [Obsolete("Use SyncEffect(Effect) instead of this")]
- public void EnableEffect(Effect effect) => SyncEffect(effect);
-
///
/// Syncs the status effect on the player.
///
@@ -3350,13 +3273,6 @@ public void EnableEffects(IEnumerable types, float duration = 0f, bo
}
}
- ///
- /// Enables a of on the player.
- ///
- /// The of to enable.
- [Obsolete("Use SyncEffects(IEnumerable) instead of this")]
- public void EnableEffects(IEnumerable effects) => SyncEffects(effects);
-
///
/// Syncs a of on the player.
///
@@ -3393,7 +3309,7 @@ public StatusEffectBase GetEffect(EffectType effectType)
///
/// The .
/// The .
- /// A bool indicating whether or not the was successfully gotten.
+ /// A bool indicating whether the was successfully gotten.
public bool TryGetEffect(EffectType type, out StatusEffectBase statusEffect)
{
statusEffect = GetEffect(type);
@@ -3406,7 +3322,7 @@ public bool TryGetEffect(EffectType type, out StatusEffectBase statusEffect)
///
/// The .
/// The to get.
- /// A bool indicating whether or not the was successfully gotten.
+ /// A bool indicating whether the was successfully gotten.
public bool TryGetEffect(out T statusEffect)
where T : StatusEffectBase
=> ReferenceHub.playerEffectsController.TryGetEffect(out statusEffect);
@@ -3481,7 +3397,7 @@ public void ChangeEffectIntensity(string effectName, byte intensity, float durat
///
/// The .
/// The .
- /// A bool indicating whether or not the was successfully gotten.
+ /// A bool indicating whether the was successfully gotten.
public bool TryGetDanger(DangerType type, out DangerStackBase danger) => (danger = GetDanger(type)) is not null;
///
@@ -3493,7 +3409,7 @@ public void ChangeEffectIntensity(string effectName, byte intensity, float durat
///
/// Places a Tantrum (SCP-173's ability) under the player.
///
- /// Whether or not the tantrum will apply the effect.
+ /// Whether the tantrum will apply the effect.
/// If is , the tantrum is moved slightly up from its original position. Otherwise, the collision will not be detected and the slowness will not work.
/// The instance..
public TantrumHazard PlaceTantrum(bool isActive = true) => TantrumHazard.PlaceTantrum(Position, isActive);
@@ -3506,7 +3422,7 @@ public void ChangeEffectIntensity(string effectName, byte intensity, float durat
/// How much value is lost per second.
/// Percent of incoming damage absorbed by this stat.
/// The number of seconds to delay the start of the decay.
- /// Whether or not the process is removed when the value hits 0.
+ /// Whether the process is removed when the value hits 0.
public void AddAhp(float amount, float limit = 75f, float decay = 1.2f, float efficacy = 0.7f, float sustain = 0f, bool persistant = false)
{
ReferenceHub.playerStats.GetModule()
@@ -3518,7 +3434,7 @@ public void AddAhp(float amount, float limit = 75f, float decay = 1.2f, float ef
///
/// New port.
/// Player reconnection delay.
- /// Whether or not player should be reconnected.
+ /// Whether player should be reconnected.
/// Type of round restart.
public void Reconnect(ushort newPort = 0, float delay = 5, bool reconnect = true, RoundRestartType roundRestartType = RoundRestartType.FullRestart)
{
@@ -3776,7 +3692,7 @@ public void SetCooldownItem(float time, ItemType itemType)
///
/// Explode the player.
///
- public void Explode() => ExplosionUtils.ServerExplode(ReferenceHub);
+ public void Explode() => ExplosionUtils.ServerExplode(ReferenceHub, ExplosionType.Grenade);
///
/// Explode the player.
@@ -3791,6 +3707,37 @@ public void SetCooldownItem(float time, ItemType itemType)
/// The projectile that will create the effect.
public void ExplodeEffect(ProjectileType projectileType) => Map.ExplodeEffect(Position, projectileType);
+ ///
+ public override bool Equals(object obj)
+ {
+ Player player = obj as Player;
+ return (object)player != null && ReferenceHub == player.ReferenceHub;
+ }
+
+ ///
+ public override int GetHashCode()
+ {
+ return ReferenceHub.GetHashCode();
+ }
+
+ ///
+ /// Returns whether the two players are the same.
+ ///
+ /// The first player instance.
+ /// The second player instance.
+ /// if the values are equal.
+#pragma warning disable SA1201
+ public static bool operator ==(Player player1, Player player2) => player1?.Equals(player2) ?? player2 is null;
+
+ ///
+ /// Returns whether the two players are different.
+ ///
+ /// The first player instance.
+ /// The second player instance.
+ /// if the values are not equal.
+ public static bool operator !=(Player player1, Player player2) => !(player1 == player2);
+#pragma warning restore SA1201
+
///
/// Converts the player in a human-readable format.
///
diff --git a/EXILED/Exiled.API/Features/Plugin.cs b/EXILED/Exiled.API/Features/Plugin.cs
index 6153cbeee..8884b2606 100644
--- a/EXILED/Exiled.API/Features/Plugin.cs
+++ b/EXILED/Exiled.API/Features/Plugin.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pools/DictionaryPool.cs b/EXILED/Exiled.API/Features/Pools/DictionaryPool.cs
index 4b5bcbe80..93ebd299d 100644
--- a/EXILED/Exiled.API/Features/Pools/DictionaryPool.cs
+++ b/EXILED/Exiled.API/Features/Pools/DictionaryPool.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pools/HashSetPool.cs b/EXILED/Exiled.API/Features/Pools/HashSetPool.cs
index 605e44ddc..b8749f5fa 100644
--- a/EXILED/Exiled.API/Features/Pools/HashSetPool.cs
+++ b/EXILED/Exiled.API/Features/Pools/HashSetPool.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pools/IPool.cs b/EXILED/Exiled.API/Features/Pools/IPool.cs
index 8449ab5ab..57a2f3da4 100644
--- a/EXILED/Exiled.API/Features/Pools/IPool.cs
+++ b/EXILED/Exiled.API/Features/Pools/IPool.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pools/ListPool.cs b/EXILED/Exiled.API/Features/Pools/ListPool.cs
index ce68e670b..f0508f783 100644
--- a/EXILED/Exiled.API/Features/Pools/ListPool.cs
+++ b/EXILED/Exiled.API/Features/Pools/ListPool.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pools/QueuePool.cs b/EXILED/Exiled.API/Features/Pools/QueuePool.cs
index 6b2afae64..04b5f3df5 100644
--- a/EXILED/Exiled.API/Features/Pools/QueuePool.cs
+++ b/EXILED/Exiled.API/Features/Pools/QueuePool.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Pools/StringBuilderPool.cs b/EXILED/Exiled.API/Features/Pools/StringBuilderPool.cs
index d36a70b34..16d84cc69 100644
--- a/EXILED/Exiled.API/Features/Pools/StringBuilderPool.cs
+++ b/EXILED/Exiled.API/Features/Pools/StringBuilderPool.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/PrefabHelper.cs b/EXILED/Exiled.API/Features/PrefabHelper.cs
index fd18e9fe9..82180ac9a 100644
--- a/EXILED/Exiled.API/Features/PrefabHelper.cs
+++ b/EXILED/Exiled.API/Features/PrefabHelper.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -9,8 +9,6 @@ namespace Exiled.API.Features
{
using System;
using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
using System.Reflection;
using Exiled.API.Enums;
@@ -23,18 +21,21 @@ namespace Exiled.API.Features
///
public static class PrefabHelper
{
- private static readonly Dictionary Stored = new();
+ ///
+ /// A containing all and their corresponding .
+ ///
+ internal static readonly Dictionary Prefabs = new(Enum.GetValues(typeof(PrefabType)).Length);
///
- /// Gets a dictionary of to .
+ /// Gets a of and their corresponding .
///
- public static ReadOnlyDictionary PrefabToGameObject => new(Stored);
+ public static IReadOnlyDictionary PrefabToGameObject => Prefabs;
///
- /// Gets the prefab attribute of a prefab type.
+ /// Gets the from a .
///
- /// The prefab type.
- /// The .
+ /// The .
+ /// The corresponding .
public static PrefabAttribute GetPrefabAttribute(this PrefabType prefabType)
{
Type type = prefabType.GetType();
@@ -42,64 +43,75 @@ public static PrefabAttribute GetPrefabAttribute(this PrefabType prefabType)
}
///
- /// Gets the prefab of the specified .
+ /// Gets the of the specified .
///
- /// The to get prefab of.
- /// The to get.
- /// Returns the prefab component as {T}.
- public static T GetPrefab(PrefabType type)
- where T : Component
+ /// The .
+ /// Returns the .
+ public static GameObject GetPrefab(PrefabType prefabType)
{
- if (!Stored.TryGetValue(type, out GameObject gameObject) || !gameObject.TryGetComponent(out T component))
- return null;
+ if (Prefabs.TryGetValue(prefabType, out GameObject prefab))
+ return prefab;
- return component;
+ return null;
}
///
- /// Spawns a prefab on server.
+ /// Tries to get the of the specified .
///
- /// The prefab type.
- /// The position to spawn the prefab.
- /// The rotation of the prefab.
- /// The instantied.
- public static GameObject Spawn(PrefabType prefabType, Vector3 position = default, Quaternion rotation = default)
+ /// The .
+ /// The of the .
+ /// Returns true if the was found.
+ public static bool TryGetPrefab(PrefabType prefabType, out GameObject gameObject)
{
- if (!Stored.TryGetValue(prefabType, out GameObject gameObject))
- return null;
- GameObject newGameObject = UnityEngine.Object.Instantiate(gameObject, position, rotation);
- NetworkServer.Spawn(newGameObject);
- return newGameObject;
+ gameObject = GetPrefab(prefabType);
+ return gameObject is not null;
}
///
- /// Spawns a prefab on server.
+ /// Gets a from the of the specified .
///
- /// The prefab type.
- /// The position to spawn the prefab.
- /// The rotation of the prefab.
+ /// The .
/// The type.
- /// The instantied.
- public static T Spawn(PrefabType prefabType, Vector3 position = default, Quaternion rotation = default)
+ /// Returns the .
+ public static T GetPrefab(PrefabType prefabType)
where T : Component
{
- T obj = UnityEngine.Object.Instantiate(GetPrefab(prefabType), position, rotation);
- NetworkServer.Spawn(obj.gameObject);
- return obj;
+ if (Prefabs.TryGetValue(prefabType, out GameObject prefab) && prefab.TryGetComponent(out T component))
+ return component;
+
+ return null;
}
///
- /// Loads all prefabs.
+ /// Spawns the of the specified .
///
- internal static void LoadPrefabs()
+ /// The .
+ /// The position where the will spawn.
+ /// The rotation of the .
+ /// Returns the instantied.
+ public static GameObject Spawn(PrefabType prefabType, Vector3 position = default, Quaternion? rotation = null)
{
- Stored.Clear();
+ if (!TryGetPrefab(prefabType, out GameObject gameObject))
+ return null;
- foreach (PrefabType prefabType in EnumUtils.Values)
- {
- PrefabAttribute attribute = prefabType.GetPrefabAttribute();
- Stored.Add(prefabType, NetworkClient.prefabs.FirstOrDefault(prefab => prefab.Key == attribute.AssetId || prefab.Value.name.Contains(attribute.Name)).Value);
- }
+ GameObject newGameObject = UnityEngine.Object.Instantiate(gameObject, position, rotation ?? Quaternion.identity);
+ NetworkServer.Spawn(newGameObject);
+ return newGameObject;
+ }
+
+ ///
+ /// Spawns the of the specified .
+ ///
+ /// The .
+ /// The position where the will spawn.
+ /// The rotation of the .
+ /// The type.
+ /// Returns the of the .
+ public static T Spawn(PrefabType prefabType, Vector3 position = default, Quaternion? rotation = null)
+ where T : Component
+ {
+ GameObject gameObject = Spawn(prefabType, position, rotation);
+ return gameObject?.GetComponent();
}
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Ragdoll.cs b/EXILED/Exiled.API/Features/Ragdoll.cs
index e1aefa56a..8cde5d8cb 100644
--- a/EXILED/Exiled.API/Features/Ragdoll.cs
+++ b/EXILED/Exiled.API/Features/Ragdoll.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -67,7 +67,7 @@ public static int FreezeTime
}
///
- /// Gets a value indicating whether or not the clean up event can be executed.
+ /// Gets a value indicating whether the clean-up event can be executed.
///
public bool AllowCleanUp => NetworkInfo.ExistenceTime < FreezeTime;
@@ -115,12 +115,12 @@ public DamageHandlerBase DamageHandler
public DeathAnimation[] DeathAnimations => Base.AllDeathAnimations;
///
- /// Gets a value indicating whether or not the ragdoll has been already cleaned up.
+ /// Gets a value indicating whether the ragdoll has been already cleaned up.
///
- public bool IsFrozen => Base._frozen;
+ public bool IsFrozen => Base.Frozen;
///
- /// Gets or sets a value indicating whether or not the ragdoll can be cleaned up.
+ /// Gets or sets a value indicating whether the ragdoll can be cleaned up.
///
public bool CanBeCleanedUp
{
@@ -185,13 +185,13 @@ public RoleTypeId Role
}
///
- /// Gets a value indicating whether or not the ragdoll has expired and SCP-049 is unable to revive it if was not being targets.
+ /// Gets a value indicating whether the ragdoll has expired and SCP-049 is unable to revive it if was not being targets.
///
///
public bool IsExpired => NetworkInfo.ExistenceTime > PlayerRoles.PlayableScps.Scp049.Scp049ResurrectAbility.HumanCorpseDuration;
///
- /// Gets or sets a value indicating whether or not this ragdoll has been consumed by an SCP-049-2.
+ /// Gets or sets a value indicating whether this ragdoll has been consumed by an SCP-049-2.
///
public bool IsConsumed
{
@@ -358,8 +358,8 @@ public static Ragdoll CreateAndSpawn(RagdollData networkInfo)
/// The rotation of the ragdoll.
/// The optional owner of the ragdoll.
/// The ragdoll.
- public static Ragdoll CreateAndSpawn(RoleTypeId roleType, string name, DamageHandlerBase damageHandler, Vector3 position, Quaternion rotation, Player owner = null)
- => CreateAndSpawn(new(owner?.ReferenceHub ?? Server.Host.ReferenceHub, damageHandler, roleType, position, rotation, name, NetworkTime.time));
+ public static Ragdoll CreateAndSpawn(RoleTypeId roleType, string name, DamageHandlerBase damageHandler, Vector3 position, Quaternion? rotation = null, Player owner = null)
+ => CreateAndSpawn(new(owner?.ReferenceHub ?? Server.Host.ReferenceHub, damageHandler, roleType, position, rotation ?? Quaternion.identity, name, NetworkTime.time));
///
/// Creates and spawns a new ragdoll.
@@ -371,7 +371,7 @@ public static Ragdoll CreateAndSpawn(RoleTypeId roleType, string name, DamageHan
/// The rotation of the ragdoll.
/// The optional owner of the ragdoll.
/// The ragdoll.
- public static Ragdoll CreateAndSpawn(RoleTypeId roleType, string name, string deathReason, Vector3 position, Quaternion rotation, Player owner = null)
+ public static Ragdoll CreateAndSpawn(RoleTypeId roleType, string name, string deathReason, Vector3 position, Quaternion? rotation = null, Player owner = null)
=> CreateAndSpawn(roleType, name, new CustomReasonDamageHandler(deathReason), position, rotation, owner);
///
diff --git a/EXILED/Exiled.API/Features/Recontainer.cs b/EXILED/Exiled.API/Features/Recontainer.cs
index a63f8ada5..17f59c97d 100644
--- a/EXILED/Exiled.API/Features/Recontainer.cs
+++ b/EXILED/Exiled.API/Features/Recontainer.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -193,7 +193,16 @@ public static bool IsContainmentSequenceSuccessful
///
/// Begins the overcharge procedure.
///
- public static void BeginOvercharge() => Base.BeginOvercharge();
+ /// Make than is call after the .
+ public static void BeginOvercharge(bool endOvercharge = true)
+ {
+ Base.BeginOvercharge();
+ if (endOvercharge)
+ {
+ Base._delayStopwatch.Stop();
+ Base._unlockStopwatch.Start();
+ }
+ }
///
/// Ends the overcharge procedure.
diff --git a/EXILED/Exiled.API/Features/Respawn.cs b/EXILED/Exiled.API/Features/Respawn.cs
index 3367de9c3..82282435c 100644
--- a/EXILED/Exiled.API/Features/Respawn.cs
+++ b/EXILED/Exiled.API/Features/Respawn.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -13,8 +13,11 @@ namespace Exiled.API.Features
using CustomPlayerEffects;
using Enums;
+ using Extensions;
using PlayerRoles;
using Respawning;
+ using Respawning.Waves;
+ using Respawning.Waves.Generic;
using UnityEngine;
///
@@ -25,6 +28,16 @@ public static class Respawn
private static GameObject ntfHelicopterGameObject;
private static GameObject chaosCarGameObject;
+ ///
+ /// Gets the of paused 's.
+ ///
+ public static List PausedWaves { get; } = new();
+
+ ///
+ /// Gets the containing faction influence.
+ ///
+ public static Dictionary FactionInfluence => FactionInfluenceManager.Influence;
+
///
/// Gets the NTF Helicopter's .
///
@@ -54,174 +67,340 @@ public static GameObject ChaosVan
}
///
- /// Gets or sets the next known that will spawn.
+ /// Gets the next known that will spawn.
+ ///
+ /// This returns SpawnableFaction.None unless a respawn has already started.
+ public static SpawnableFaction NextKnownSpawnableFaction => WaveManager._nextWave is not null ? WaveManager._nextWave.GetSpawnableFaction() : SpawnableFaction.None;
+
+ ///
+ /// Gets the current state of the .
+ ///
+ public static WaveQueueState CurrentState => WaveManager.State;
+
+ ///
+ /// Gets a value indicating whether the respawn process for a is currently in progress..
+ ///
+ public static bool IsSpawning => WaveManager.State == WaveQueueState.WaveSpawning;
+
+ ///
+ /// Gets or sets a value indicating whether spawn protection is enabled.
///
- public static SpawnableTeamType NextKnownTeam
+ public static bool ProtectionEnabled
{
- get => RespawnManager.Singleton.NextKnownTeam;
- set => RespawnManager.Singleton.NextKnownTeam = value;
+ get => SpawnProtected.IsProtectionEnabled;
+ set => SpawnProtected.IsProtectionEnabled = value;
}
///
- /// Gets or sets the amount of seconds before the next respawn phase will occur.
+ /// Gets or sets the spawn protection time, in seconds.
///
- public static float TimeUntilNextPhase
+ public static float ProtectionTime
{
- get => RespawnManager.Singleton._timeForNextSequence - (float)RespawnManager.Singleton._stopwatch.Elapsed.TotalSeconds;
- set => RespawnManager.Singleton._timeForNextSequence = (float)RespawnManager.Singleton._stopwatch.Elapsed.TotalSeconds + value;
+ get => SpawnProtected.SpawnDuration;
+ set => SpawnProtected.SpawnDuration = value;
}
///
- /// Gets a indicating the amount of time before the next respawn wave will occur.
+ /// Gets or sets a value indicating whether spawn protected players can shoot.
///
- public static TimeSpan TimeUntilSpawnWave => TimeSpan.FromSeconds(TimeUntilNextPhase);
+ public static bool ProtectedCanShoot
+ {
+ get => SpawnProtected.CanShoot;
+ set => SpawnProtected.CanShoot = value;
+ }
///
- /// Gets a indicating the moment in UTC time the next respawn wave will occur.
+ /// Gets a of s that have spawn protection.
///
- public static DateTime NextTeamTime => DateTime.UtcNow.AddSeconds(TimeUntilSpawnWave.TotalSeconds);
+ public static List ProtectedTeams => SpawnProtected.ProtectedTeams;
///
- /// Gets a value indicating whether or not a team is currently being spawned or the animations are playing for a team.
+ /// Tries to get a .
///
- public static bool IsSpawning => RespawnManager.Singleton._curSequence is RespawnManager.RespawnSequencePhase.PlayingEntryAnimations or RespawnManager.RespawnSequencePhase.SpawningSelectedTeam;
+ /// The found .
+ /// Type of .
+ /// true if was successfully found. Otherwise, false.
+ ///
+ public static bool TryGetWaveBase(out T spawnableWaveBase)
+ where T : SpawnableWaveBase => WaveManager.TryGet(out spawnableWaveBase);
///
- /// Gets or sets the amount of spawn tickets belonging to the Chaos Insurgency.
+ /// Tries to get a .
///
- ///
- public static float ChaosTickets
+ /// A determining which wave to search for.
+ /// The found .
+ /// true if was successfully found. Otherwise, false.
+ ///
+ public static bool TryGetWaveBase(SpawnableFaction spawnableFaction, out SpawnableWaveBase spawnableWaveBase)
{
- get => RespawnTokensManager.Counters[0].Amount;
- set => RespawnTokensManager.ModifyTokens(SpawnableTeamType.ChaosInsurgency, value);
+ spawnableWaveBase = WaveManager.Waves.Find(x => x.GetSpawnableFaction() == spawnableFaction);
+ return spawnableWaveBase is not null;
}
///
- /// Gets or sets the amount of spawn tickets belonging to the NTF.
+ /// Tries to get an of .
///
- ///
- public static float NtfTickets
+ /// A determining which waves to search for.
+ /// The containing found 's if there are any, otherwise null.
+ /// true if was successfully found. Otherwise, false.
+ ///
+ public static bool TryGetWaveBases(Faction faction, out IEnumerable spawnableWaveBases)
{
- get => RespawnTokensManager.Counters[1].Amount;
- set => RespawnTokensManager.ModifyTokens(SpawnableTeamType.NineTailedFox, value);
+ List spawnableWaves = new();
+ spawnableWaves.AddRange(WaveManager.Waves.Where(x => x.TargetFaction == faction));
+
+ if (spawnableWaves.IsEmpty())
+ {
+ spawnableWaveBases = null;
+ return false;
+ }
+
+ spawnableWaveBases = spawnableWaves;
+ return true;
}
///
- /// Gets or sets a value indicating whether or not spawn protection is enabled.
+ /// Advances the respawn timer for s.
///
- public static bool ProtectionEnabled
+ /// The whose 's timers are to be advanced.
+ /// Number of seconds to advance the timers by.
+ /// This advances the timer for both the normal and mini wave.
+ public static void AdvanceTimer(Faction faction, float seconds) => WaveManager.AdvanceTimer(faction, seconds);
+
+ ///
+ /// Advances the respawn timer for s.
+ ///
+ /// The whose 's timers are to be advanced.
+ /// A representing the amount of time to advance the timers by.
+ /// This advances the timer for both the normal and mini wave.
+ public static void AdvanceTimer(Faction faction, TimeSpan time) => AdvanceTimer(faction, (float)time.TotalSeconds);
+
+ ///
+ /// Advances the respawn timer for s.
+ ///
+ /// The whose 's timer is to be advanced.
+ /// Number of seconds to advance the timers by.
+ public static void AdvanceTimer(SpawnableFaction spawnableFaction, float seconds)
{
- get => SpawnProtected.IsProtectionEnabled;
- set => SpawnProtected.IsProtectionEnabled = value;
+ foreach (SpawnableWaveBase spawnableWaveBase in WaveManager.Waves)
+ {
+ TimeBasedWave timeBasedWave = (TimeBasedWave)spawnableWaveBase;
+ if (timeBasedWave.GetSpawnableFaction() == spawnableFaction)
+ {
+ timeBasedWave.Timer.AddTime(Mathf.Abs(seconds));
+ }
+ }
}
///
- /// Gets or sets the spawn protection time, in seconds.
+ /// Advances the respawn timer for s.
///
- public static float ProtectionTime
+ /// The whose 's timer is to be advanced.
+ /// A representing the amount of time to advance the timers by.
+ public static void AdvanceTimer(SpawnableFaction spawnableFaction, TimeSpan time) => AdvanceTimer(spawnableFaction, (float)time.TotalSeconds);
+
+ ///
+ /// Play the spawn effect of a .
+ ///
+ /// The whose effect should be played.
+ public static void PlayEffect(SpawnableWaveBase wave)
{
- get => SpawnProtected.SpawnDuration;
- set => SpawnProtected.SpawnDuration = value;
+ WaveUpdateMessage.ServerSendUpdate(wave, UpdateMessageFlags.Trigger);
}
///
- /// Gets or sets a value indicating whether or not spawn protected players can shoot.
+ /// Summons the NTF chopper.
///
- public static bool ProtectedCanShoot
+ public static void SummonNtfChopper()
{
- get => SpawnProtected.CanShoot;
- set => SpawnProtected.CanShoot = value;
+ if (TryGetWaveBase(SpawnableFaction.NtfWave, out SpawnableWaveBase wave))
+ PlayEffect(wave);
}
///
- /// Gets a of that have spawn protection.
+ /// Summons the Chaos Insurgency van.
///
- public static List ProtectedTeams => SpawnProtected.ProtectedTeams;
+ /// This will also trigger Music effect.
+ ///
+ public static void SummonChaosInsurgencyVan()
+ {
+ if (TryGetWaveBase(SpawnableFaction.ChaosWave, out SpawnableWaveBase wave))
+ PlayEffect(wave);
+ }
///
- /// Play an effect when a certain class spawns.
+ /// Grants tokens to a given 's s.
///
- /// The effect to be played.
- public static void PlayEffect(byte effect) => PlayEffects(new[] { effect });
+ /// The to whose s to grant tokens.
+ /// The amount of tokens to grant.
+ /// true if tokens were successfully granted to an , otherwise false.
+ public static bool GrantTokens(Faction faction, int amount)
+ {
+ if (TryGetWaveBases(faction, out IEnumerable waveBases))
+ {
+ foreach (ILimitedWave limitedWave in waveBases.OfType())
+ {
+ limitedWave.RespawnTokens += amount;
+ }
+
+ return true;
+ }
+
+ return false;
+ }
///
- /// Play an effect when a certain class spawns.
+ /// Removes tokens from a given 's s.
///
- /// The effect to be played.
- public static void PlayEffect(RespawnEffectType effect) => PlayEffects(new[] { effect });
+ /// The from whose s to remove tokens.
+ /// The amount of tokens to remove.
+ /// true if tokens were successfully removed from an , otherwise false.
+ public static bool RemoveTokens(Faction faction, int amount)
+ {
+ if (TryGetWaveBases(faction, out IEnumerable waveBases))
+ {
+ foreach (ILimitedWave limitedWave in waveBases.OfType())
+ {
+ limitedWave.RespawnTokens = Math.Max(0, limitedWave.RespawnTokens - amount);
+ }
+
+ return true;
+ }
+
+ return false;
+ }
///
- /// Play effects when a certain class spawns.
+ /// Modifies tokens of a given 's s by a given amount.
///
- /// The effects to be played.
- public static void PlayEffects(byte[] effects)
+ /// The whose s' tokens are to be modified.
+ /// The amount of tokens to add/remove.
+ /// true if tokens were successfully modified for an , otherwise false.
+ public static bool ModifyTokens(Faction faction, int amount)
{
- foreach (RespawnEffectsController controller in RespawnEffectsController.AllControllers)
- controller?.RpcPlayEffects(effects);
+ if (TryGetWaveBases(faction, out IEnumerable waveBases))
+ {
+ foreach (ILimitedWave limitedWave in waveBases.OfType())
+ {
+ limitedWave.RespawnTokens = amount;
+ }
+
+ return true;
+ }
+
+ return false;
}
///
- /// Play effects when a certain class spawns.
+ /// Tries to get the tokens of a given 's .
///
- /// The effects to be played.
- public static void PlayEffects(RespawnEffectType[] effects) => PlayEffects(effects.Select(effect => (byte)effect).ToArray());
+ /// The from whose to get the tokens.
+ /// The amount of tokens an has, if one was found, otherwise 0.
+ /// true if an was successfully found, otherwise false.
+ public static bool TryGetTokens(SpawnableFaction spawnableFaction, out int tokens)
+ {
+ if (TryGetWaveBase(spawnableFaction, out SpawnableWaveBase waveBase) && waveBase is ILimitedWave limitedWave)
+ {
+ tokens = limitedWave.RespawnTokens;
+ return true;
+ }
+
+ tokens = 0;
+ return false;
+ }
///
- /// Summons the NTF chopper.
+ /// Sets the amount of tokens of an of the given .
///
- public static void SummonNtfChopper() => PlayEffects(new[] { RespawnEffectType.SummonNtfChopper });
+ /// The whose 's tokens to set.
+ /// The amount of tokens to set.
+ /// true if tokens were successfully set for an , otherwise false.
+ public static bool SetTokens(SpawnableFaction spawnableFaction, int amount)
+ {
+ if (TryGetWaveBase(spawnableFaction, out SpawnableWaveBase waveBase) && waveBase is ILimitedWave limitedWave)
+ {
+ limitedWave.RespawnTokens = amount;
+ return true;
+ }
+
+ return false;
+ }
///
- /// Summons the van.
+ /// Starts the spawn sequence of the given .
///
- /// Whether or not to play the Chaos Insurgency spawn music.
- public static void SummonChaosInsurgencyVan(bool playMusic = true)
+ /// The whose wave to spawn.
+ /// Whether the wave should be a mini wave or not.
+ public static void ForceWave(Faction faction, bool isMini = false)
{
- PlayEffects(
- playMusic
- ? new[]
- {
- RespawnEffectType.PlayChaosInsurgencyMusic,
- RespawnEffectType.SummonChaosInsurgencyVan,
- }
- : new[]
- {
- RespawnEffectType.SummonChaosInsurgencyVan,
- });
+ if (faction.TryGetSpawnableFaction(out SpawnableFaction spawnableFaction, isMini))
+ {
+ ForceWave(spawnableFaction);
+ }
}
///
- /// Grants tickets to a .
+ /// Starts the spawn sequence of the given .
///
- /// The to grant tickets to.
- /// The amount of tickets to grant.
- public static void GrantTickets(SpawnableTeamType team, float amount) => RespawnTokensManager.GrantTokens(team, Math.Max(0, amount));
+ /// The whose wave to spawn.
+ public static void ForceWave(SpawnableFaction spawnableFaction)
+ {
+ if (TryGetWaveBase(spawnableFaction, out SpawnableWaveBase spawnableWaveBase))
+ {
+ ForceWave(spawnableWaveBase);
+ }
+ }
///
- /// Removes tickets from a .
+ /// Starts the spawn sequence of the given .
///
- /// The to remove tickets from.
- /// The amount of tickets to remove.
- public static void RemoveTickets(SpawnableTeamType team, float amount) => RespawnTokensManager.RemoveTokens(team, Math.Max(0, amount));
+ /// The to spawn.
+ public static void ForceWave(SpawnableWaveBase spawnableWaveBase)
+ {
+ WaveManager.Spawn(spawnableWaveBase);
+ }
///
- /// Modify tickets from a .
+ /// Pauses respawn waves by removing them from WaveManager.Waves and storing them in .
///
- /// The to modify tickets from.
- /// The amount of tickets to modify.
- public static void ModifyTickets(SpawnableTeamType team, float amount) => RespawnTokensManager.ModifyTokens(team, amount);
+ ///
+ public static void PauseWaves()
+ {
+ PausedWaves.Clear();
+ PausedWaves.AddRange(WaveManager.Waves);
+ WaveManager.Waves.Clear();
+ }
///
- /// Forces a spawn of the given .
+ /// Resumes respawn waves by filling WaveManager.Waves with values stored in .
///
- /// The to spawn.
- /// Whether or not effects will be played with the spawn.
- public static void ForceWave(SpawnableTeamType team, bool playEffects = false)
+ ///
+ /// This also clears .
+ public static void ResumeWaves()
{
- if (playEffects)
- RespawnEffectsController.ExecuteAllEffects(RespawnEffectsController.EffectType.Selection, team);
+ WaveManager.Waves.Clear();
+ WaveManager.Waves.AddRange(PausedWaves);
+ PausedWaves.Clear();
+ }
- RespawnManager.Singleton.ForceSpawnTeam(team);
+ ///
+ /// Restarts respawn waves by clearing WaveManager.Waves and filling it with new values..
+ ///
+ ///
+ /// This also clears .
+ public static void RestartWaves()
+ {
+ WaveManager.Waves.Clear();
+ WaveManager.Waves.AddRange(new List { new ChaosMiniWave(), new ChaosSpawnWave(), new NtfMiniWave(), new NtfSpawnWave() });
+ PausedWaves.Clear();
}
+
+ ///
+ /// Tries to get the influence value of a given .
+ ///
+ /// The whose influence to get.
+ /// The amount of influence a faction has.
+ /// Whether an entry was successfully found.
+ public static bool TryGetFactionInfluence(Faction faction, out float influence) => FactionInfluence.TryGetValue(faction, out influence);
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Roles/DestroyedRole.cs b/EXILED/Exiled.API/Features/Roles/DestroyedRole.cs
new file mode 100644
index 000000000..42e6cfe34
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Roles/DestroyedRole.cs
@@ -0,0 +1,36 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Roles
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Text;
+ using System.Threading.Tasks;
+
+ using PlayerRoles;
+ using PlayerRoles.Voice;
+
+ ///
+ /// Defines a role that represents players with destroyed role.
+ ///
+ internal class DestroyedRole : Role
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// the base .
+ internal DestroyedRole(PlayerRoleBase baseRole)
+ : base(baseRole)
+ {
+ }
+
+ ///
+ public override RoleTypeId Type { get; } = RoleTypeId.Destroyed;
+ }
+}
diff --git a/EXILED/Exiled.API/Features/Roles/FilmMakerRole.cs b/EXILED/Exiled.API/Features/Roles/FilmMakerRole.cs
index 5dcd39f35..632abc33a 100644
--- a/EXILED/Exiled.API/Features/Roles/FilmMakerRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/FilmMakerRole.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Roles/FpcRole.cs b/EXILED/Exiled.API/Features/Roles/FpcRole.cs
index 4fe6151bd..ecc946c9b 100644
--- a/EXILED/Exiled.API/Features/Roles/FpcRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/FpcRole.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -145,17 +145,17 @@ public bool MovementDetected
}
///
- /// Gets a value indicating whether or not the player can send inputs.
+ /// Gets a value indicating whether the player can send inputs.
///
public bool CanSendInputs => FirstPersonController.FpcModule.LockMovement;
///
- /// Gets or sets a value indicating whether or not the player is invisible.
+ /// Gets or sets a value indicating whether the player is invisible.
///
public bool IsInvisible { get; set; }
///
- /// Gets or sets a value indicating whether or not the player should use stamina system. Resets on death.
+ /// Gets or sets a value indicating whether the player should use stamina system. Resets on death.
///
public bool IsUsingStamina
{
@@ -193,12 +193,12 @@ public PlayerMovementState MoveState
}
///
- /// Gets a value indicating whether the is crouching or not.
+ /// Gets a value indicating whether the is crouching.
///
public bool IsCrouching => FirstPersonController.FpcModule.StateProcessor.CrouchPercent > 0;
///
- /// Gets a value indicating whether or not the player is on the ground.
+ /// Gets a value indicating whether the player is on the ground.
///
public bool IsGrounded => FirstPersonController.FpcModule.IsGrounded;
@@ -208,7 +208,7 @@ public PlayerMovementState MoveState
public virtual float MovementSpeed => FirstPersonController.FpcModule.VelocityForState(MoveState, IsCrouching);
///
- /// Gets a value indicating whether or not the is in darkness.
+ /// Gets a value indicating whether the is in darkness.
///
public bool IsInDarkness => FirstPersonController.InDarkness;
@@ -223,17 +223,17 @@ public PlayerMovementState MoveState
public float HorizontalRotation => FirstPersonController.HorizontalRotation;
///
- /// Gets a value indicating whether or not the is AFK.
+ /// Gets a value indicating whether the is AFK.
///
public bool IsAfk => FirstPersonController.IsAFK;
///
- /// Gets a value indicating whether or not this role is protected by a hume shield.
+ /// Gets a value indicating whether this role is protected by a hume shield.
///
public bool IsHumeShieldedRole => this is IHumeShieldRole;
///
- /// Gets or sets a value indicating whether or not the player has noclip enabled.
+ /// Gets or sets a value indicating whether the player has noclip enabled.
///
/// indicating status.
/// For permitting a player to enter and exit noclip freely, see .
diff --git a/EXILED/Exiled.API/Features/Roles/HumanRole.cs b/EXILED/Exiled.API/Features/Roles/HumanRole.cs
index ff58745be..8a238a3e7 100644
--- a/EXILED/Exiled.API/Features/Roles/HumanRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/HumanRole.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -32,19 +32,10 @@ internal HumanRole(HumanGameRole baseRole)
///
public override RoleTypeId Type => Base.RoleTypeId;
- ///
- /// Gets or sets the .
- ///
- public SpawnableTeamType SpawnableTeamType
- {
- get => Base.AssignedSpawnableTeam;
- set => Base.AssignedSpawnableTeam = value;
- }
-
///
/// Gets the player's unit name.
///
- public string UnitName => UnitNameMessageHandler.GetReceived(Base.AssignedSpawnableTeam, Base.UnitNameId);
+ public string UnitName => NamingRulesManager.ClientFetchReceived(Team, UnitNameId);
///
/// Gets or sets the .
diff --git a/EXILED/Exiled.API/Features/Roles/IHumeShieldRole.cs b/EXILED/Exiled.API/Features/Roles/IHumeShieldRole.cs
index 390cd989c..e0921af83 100644
--- a/EXILED/Exiled.API/Features/Roles/IHumeShieldRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/IHumeShieldRole.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Roles/ISubroutinedScpRole.cs b/EXILED/Exiled.API/Features/Roles/ISubroutinedScpRole.cs
index 341bc8896..d3c85c523 100644
--- a/EXILED/Exiled.API/Features/Roles/ISubroutinedScpRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/ISubroutinedScpRole.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Roles/IVoiceRole.cs b/EXILED/Exiled.API/Features/Roles/IVoiceRole.cs
index 74e431fcd..f49fd4fa3 100644
--- a/EXILED/Exiled.API/Features/Roles/IVoiceRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/IVoiceRole.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Roles/NoneRole.cs b/EXILED/Exiled.API/Features/Roles/NoneRole.cs
index b890ddb23..ed52752a5 100644
--- a/EXILED/Exiled.API/Features/Roles/NoneRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/NoneRole.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Roles/OverwatchRole.cs b/EXILED/Exiled.API/Features/Roles/OverwatchRole.cs
index e9a5261e6..92ce09fa3 100644
--- a/EXILED/Exiled.API/Features/Roles/OverwatchRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/OverwatchRole.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Roles/Role.cs b/EXILED/Exiled.API/Features/Roles/Role.cs
index bc9f94d20..ef6d8dcea 100644
--- a/EXILED/Exiled.API/Features/Roles/Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Role.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -18,6 +18,7 @@ namespace Exiled.API.Features.Roles
using PlayerRoles.PlayableScps.Scp049.Zombies;
using UnityEngine;
+ using DestroyedGameRole = PlayerRoles.DestroyedRole;
using FilmmakerGameRole = PlayerRoles.Filmmaker.FilmmakerRole;
using HumanGameRole = PlayerRoles.HumanRole;
using NoneGameRole = PlayerRoles.NoneRole;
@@ -99,20 +100,25 @@ protected Role(PlayerRoleBase baseRole)
public TimeSpan ActiveTime => TimeSpan.FromSeconds(Base.ActiveTime);
///
- /// Gets a value indicating whether or not this role represents a dead role.
+ /// Gets a value indicating whether this role represents a dead role.
///
public bool IsDead => Team is Team.Dead;
///
- /// Gets a value indicating whether or not this role represents a living role.
+ /// Gets a value indicating whether this role represents a living role.
///
public bool IsAlive => !IsDead;
///
- /// Gets a value indicating whether or not this role is still valid. This will only ever be if the Role is stored and accessed at a later date.
+ /// Gets a value indicating whether this role is still valid. This will only ever be if the Role is stored and accessed at a later date.
///
public bool IsValid => Owner != null && Owner.IsConnected && Base == Owner.RoleManager.CurrentRole;
+ ///
+ /// Gets the life identifier for the role.
+ ///
+ public int LifeIdentifier => Base.UniqueLifeIdentifier;
+
///
/// Gets a random spawn position of this role.
///
@@ -126,7 +132,7 @@ protected Role(PlayerRoleBase baseRole)
public static implicit operator RoleTypeId(Role role) => role?.Type ?? RoleTypeId.None;
///
- /// Returns whether or not 2 roles are the same.
+ /// Returns whether 2 roles are the same.
///
/// The role.
/// The other role.
@@ -134,7 +140,7 @@ protected Role(PlayerRoleBase baseRole)
public static bool operator ==(Role left, Role right) => left?.Equals(right) ?? right is null;
///
- /// Returns whether or not the two roles are different.
+ /// Returns whether the two roles are different.
///
/// The role.
/// The other role.
@@ -142,7 +148,7 @@ protected Role(PlayerRoleBase baseRole)
public static bool operator !=(Role left, Role right) => !(left == right);
///
- /// Returns whether or not the role has the same RoleTypeId as the given .
+ /// Returns whether the role has the same RoleTypeId as the given .
///
/// The .
/// The .
@@ -150,7 +156,7 @@ protected Role(PlayerRoleBase baseRole)
public static bool operator ==(Role role, RoleTypeId typeId) => role?.Type == typeId;
///
- /// Returns whether or not the role has a different RoleTypeId as the given .
+ /// Returns whether the role has a different RoleTypeId as the given .
///
/// The .
/// The .
@@ -158,7 +164,7 @@ protected Role(PlayerRoleBase baseRole)
public static bool operator !=(Role role, RoleTypeId typeId) => !(role == typeId);
///
- /// Returns whether or not the role has the same RoleTypeId as the given .
+ /// Returns whether the role has the same RoleTypeId as the given .
///
/// The .
/// The .
@@ -166,7 +172,7 @@ protected Role(PlayerRoleBase baseRole)
public static bool operator ==(RoleTypeId type, Role role) => role == type;
///
- /// Returns whether or not the role has a different RoleTypeId as the given .
+ /// Returns whether the role has a different RoleTypeId as the given .
///
/// The .
/// The .
@@ -228,6 +234,7 @@ public virtual void Set(RoleTypeId newRole, SpawnReason reason, RoleSpawnFlags s
HumanGameRole humanRole => new HumanRole(humanRole),
FilmmakerGameRole filmmakerRole => new FilmMakerRole(filmmakerRole),
NoneGameRole noneRole => new NoneRole(noneRole),
+ DestroyedGameRole destroyedRole => new DestroyedRole(destroyedRole),
_ => null,
};
}
diff --git a/EXILED/Exiled.API/Features/Roles/Scp0492Role.cs b/EXILED/Exiled.API/Features/Roles/Scp0492Role.cs
index f2196a0a7..7250aa466 100644
--- a/EXILED/Exiled.API/Features/Roles/Scp0492Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Scp0492Role.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -93,12 +93,12 @@ public float SimulatedStare
}
///
- /// Gets a value indicating whether or not SCP-049-2 is currently pursuing a target (Bloodlust ability).
+ /// Gets a value indicating whether SCP-049-2 is currently pursuing a target (Bloodlust ability).
///
public bool BloodlustActive => BloodlustAbility.LookingAtTarget;
///
- /// Gets a value indicating whether or not SCP-049-2 is consuming a ragdoll.
+ /// Gets a value indicating whether SCP-049-2 is consuming a ragdoll.
///
public bool IsConsuming => ConsumeAbility.IsInProgress;
@@ -113,17 +113,17 @@ public float SimulatedStare
public float AttackCooldown => AttackAbility.BaseCooldown;
///
- /// Returns a indicating whether or not SCP-049-2 is close enough to a ragdoll to consume it.
+ /// Returns a indicating whether SCP-049-2 is close enough to a ragdoll to consume it.
///
- /// This method only returns whether or not SCP-049-2 is close enough to the body to consume it; the body may have been consumed previously. Make sure to check to ensure the body can be consumed.
+ /// This method only returns whether SCP-049-2 is close enough to the body to consume it; the body may have been consumed previously. Make sure to check to ensure the body can be consumed.
/// The ragdoll to check.
/// if close enough to consume the body; otherwise, .
public bool IsInConsumeRange(BasicRagdoll ragdoll) => ragdoll != null && ConsumeAbility.IsCloseEnough(Owner.Position, ragdoll.transform.position);
///
- /// Returns a indicating whether or not SCP-049-2 is close enough to a ragdoll to consume it.
+ /// Returns a indicating whether SCP-049-2 is close enough to a ragdoll to consume it.
///
- /// This method only returns whether or not SCP-049-2 is close enough to the body to consume it; the body may have been consumed previously. Make sure to check to ensure the body can be consumed.
+ /// This method only returns whether SCP-049-2 is close enough to the body to consume it; the body may have been consumed previously. Make sure to check to ensure the body can be consumed.
/// The ragdoll to check.
/// if close enough to consume the body; otherwise, .
public bool IsInConsumeRange(Ragdoll ragdoll) => ragdoll is not null && IsInConsumeRange(ragdoll.Base);
diff --git a/EXILED/Exiled.API/Features/Roles/Scp049Role.cs b/EXILED/Exiled.API/Features/Roles/Scp049Role.cs
index 2e1384e6e..9c0ac35eb 100644
--- a/EXILED/Exiled.API/Features/Roles/Scp049Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Scp049Role.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -94,12 +94,12 @@ internal Scp049Role(Scp049GameRole baseRole)
public Scp049SenseAbility SenseAbility { get; }
///
- /// Gets a value indicating whether or not SCP-049 is currently reviving a player.
+ /// Gets a value indicating whether SCP-049 is currently reviving a player.
///
public bool IsRecalling => ResurrectAbility.IsInProgress;
///
- /// Gets a value indicating whether or not SCP-049's "Doctor's Call" ability is currently active.
+ /// Gets a value indicating whether SCP-049's "Doctor's Call" ability is currently active.
///
public bool IsCallActive => CallAbility.IsMarkerShown;
@@ -351,31 +351,31 @@ public void Sense(Player player)
public int GetResurrectionCount(Player player) => player is not null ? Scp049ResurrectAbility.GetResurrectionsNumber(player.ReferenceHub) : 0;
///
- /// Returns a indicating whether or not the ragdoll can be resurrected by SCP-049.
+ /// Returns a indicating whether the ragdoll can be resurrected by SCP-049.
///
/// The ragdoll to check.
/// if the body can be revived; otherwise, .
public bool CanResurrect(BasicRagdoll ragdoll) => ragdoll != null && ResurrectAbility.CheckRagdoll(ragdoll);
///
- /// Returns a indicating whether or not the ragdoll can be resurrected by SCP-049.
+ /// Returns a indicating whether the ragdoll can be resurrected by SCP-049.
///
/// The ragdoll to check.
/// if the body can be revived; otherwise, .
public bool CanResurrect(Ragdoll ragdoll) => ragdoll is not null && ResurrectAbility.CheckRagdoll(ragdoll.Base);
///
- /// Returns a indicating whether or not SCP-049 is close enough to a ragdoll to revive it.
+ /// Returns a indicating whether SCP-049 is close enough to a ragdoll to revive it.
///
- /// This method only returns whether or not SCP-049 is close enough to the body to revive it; the body may have expired. Make sure to check to ensure the body can be revived.
+ /// This method only returns whether SCP-049 is close enough to the body to revive it; the body may have expired. Make sure to check to ensure the body can be revived.
/// The ragdoll to check.
/// if close enough to revive the body; otherwise, .
public bool IsInRecallRange(BasicRagdoll ragdoll) => ragdoll != null && ResurrectAbility.IsCloseEnough(Owner.Position, ragdoll.transform.position);
///
- /// Returns a indicating whether or not SCP-049 is close enough to a ragdoll to revive it.
+ /// Returns a indicating whether SCP-049 is close enough to a ragdoll to revive it.
///
- /// This method only returns whether or not SCP-049 is close enough to the body to revive it; the body may have expired. Make sure to check to ensure the body can be revived.
+ /// This method only returns whether SCP-049 is close enough to the body to revive it; the body may have expired. Make sure to check to ensure the body can be revived.
/// The ragdoll to check.
/// if close enough to revive the body; otherwise, .
public bool IsInRecallRange(Ragdoll ragdoll) => ragdoll is not null && IsInRecallRange(ragdoll.Base);
diff --git a/EXILED/Exiled.API/Features/Roles/Scp079Role.cs b/EXILED/Exiled.API/Features/Roles/Scp079Role.cs
index 05334e308..2480ca3d8 100644
--- a/EXILED/Exiled.API/Features/Roles/Scp079Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Scp079Role.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -217,7 +217,7 @@ public Camera Camera
}
///
- /// Gets a value indicating whether or not SCP-079 can transmit its voice to a speaker.
+ /// Gets a value indicating whether SCP-079 can transmit its voice to a speaker.
///
public bool CanTransmit => SpeakerAbility.CanTransmit;
@@ -361,7 +361,7 @@ public float Scp2176LostTime
public float RollRotation => Base.RollRotation;
///
- /// Gets a value indicating whether or not SCP-079's signal is lost due to SCP-2176.
+ /// Gets a value indicating whether SCP-079's signal is lost due to SCP-2176.
///
public bool IsLost => LostSignalHandler.Lost;
@@ -593,7 +593,7 @@ public void ActivateTesla(bool consumeEnergy = true)
Scp079Camera cam = CurrentCameraSync.CurrentCamera;
RewardManager.MarkRoom(cam.Room);
- if (!TeslaGateController.Singleton.TeslaGates.TryGetFirst(x => RoomIdUtils.IsTheSameRoom(cam.Position, x.transform.position), out global::TeslaGate teslaGate))
+ if (!global::TeslaGate.AllGates.TryGetFirst(x => RoomIdUtils.IsTheSameRoom(cam.Position, x.transform.position), out global::TeslaGate teslaGate))
return;
if (consumeEnergy)
diff --git a/EXILED/Exiled.API/Features/Roles/Scp096Role.cs b/EXILED/Exiled.API/Features/Roles/Scp096Role.cs
index f30342b17..ff17c6bcb 100644
--- a/EXILED/Exiled.API/Features/Roles/Scp096Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Scp096Role.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -120,12 +120,12 @@ internal Scp096Role(Scp096GameRole baseRole)
public Scp096RageState RageState => Base.StateController.RageState;
///
- /// Gets a value indicating whether or not SCP-096 can receive targets.
+ /// Gets a value indicating whether SCP-096 can receive targets.
///
public bool CanReceiveTargets => RageCycleAbility._targetsTracker.CanReceiveTargets;
///
- /// Gets a value indicating whether or not SCP-096 can attack.
+ /// Gets a value indicating whether SCP-096 can attack.
///
public bool AttackPossible => AttackAbility.AttackPossible;
@@ -244,21 +244,21 @@ public bool TryNotToCryActive
///
/// Ends SCP-096's enrage cycle.
///
- /// Whether or not to clear the remaining enrage time.
+ /// Whether to clear the remaining enrage time.
public void Calm(bool clearTime = true) => RageManager.ServerEndEnrage(clearTime);
///
- /// Returns whether or not the provided is a target of SCP-096.
+ /// Returns whether the provided is a target of SCP-096.
///
/// The player to check.
- /// Whether or not the player is a target of SCP-096.
+ /// Whether the player is a target of SCP-096.
public bool HasTarget(Player player) => player is not null && TargetsTracker.HasTarget(player.ReferenceHub);
///
- /// Returns whether or not the provided is observed by SCP-096.
+ /// Returns whether the provided is observed by SCP-096.
///
/// The player to check.
- /// Whether or not the player is observed.
+ /// Whether the player is observed.
public bool IsObserved(Player player) => player is not null && TargetsTracker.IsObservedBy(player.ReferenceHub);
///
diff --git a/EXILED/Exiled.API/Features/Roles/Scp106Role.cs b/EXILED/Exiled.API/Features/Roles/Scp106Role.cs
index 9480a37bc..067ee6964 100644
--- a/EXILED/Exiled.API/Features/Roles/Scp106Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Scp106Role.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -13,7 +13,6 @@ namespace Exiled.API.Features.Roles
using PlayerRoles;
using PlayerRoles.PlayableScps;
using PlayerRoles.PlayableScps.HumeShield;
- using PlayerRoles.PlayableScps.Scp049;
using PlayerRoles.PlayableScps.Scp106;
using PlayerRoles.Subroutines;
using PlayerStatsSystem;
@@ -121,16 +120,20 @@ public float Vigor
}
///
- /// Gets or sets a value indicating whether or not SCP-106 is currently submerged.
+ /// Gets or sets a value indicating whether SCP-106 is currently submerged.
///
public bool IsSubmerged
{
- get => Base.IsSubmerged;
- set => HuntersAtlasAbility.SetSubmerged(value);
+ get => HuntersAtlasAbility._syncSubmerged;
+ set
+ {
+ HuntersAtlasAbility._syncSubmerged = value;
+ HuntersAtlasAbility.ServerSendRpc(true);
+ }
}
///
- /// Gets a value indicating whether or not SCP-106 can activate teslas.
+ /// Gets a value indicating whether SCP-106 can activate teslas.
///
public bool CanActivateTesla => Base.CanActivateShock;
@@ -140,7 +143,7 @@ public bool IsSubmerged
public bool CanStopStalk => StalkAbility.CanBeCleared;
///
- /// Gets a value indicating whether or not SCP-106 is currently slow down by a door.
+ /// Gets a value indicating whether SCP-106 is currently slow down by a door.
///
public bool IsSlowdown => MovementModule._slowndownTarget is < 1;
@@ -150,17 +153,12 @@ public bool IsSubmerged
public float SinkholeCurrentTime => SinkholeController.ElapsedToggle;
///
- /// Gets a value indicating the normalized state of the sinkhole.
- ///
- public float SinkholeNormalizedState => SinkholeController.NormalizedState;
-
- ///
- /// Gets a value indicating whether or not SCP-106 is currently in the middle of an animation.
+ /// Gets a value indicating whether SCP-106 is currently in the middle of an animation.
///
public bool IsDuringAnimation => SinkholeController.IsDuringAnimation;
///
- /// Gets a value indicating whether or not SCP-106 sinkhole is hidden.
+ /// Gets a value indicating whether SCP-106 sinkhole is hidden.
///
public bool IsSinkholeHidden => SinkholeController.IsHidden;
@@ -169,63 +167,14 @@ public bool IsSubmerged
///
public bool SinkholeState
{
- get => SinkholeController.State;
- set => SinkholeController.State = value;
+ get => StalkAbility.StalkActive;
+ set => StalkAbility.ServerSetStalk(value);
}
///
/// Gets the sinkhole target duration.
///
- public float SinkholeTargetDuration => SinkholeController.TargetDuration;
-
- ///
- /// Gets the speed multiplier of the sinkhole.
- ///
- public float SinkholeSpeedMultiplier => SinkholeController.SpeedMultiplier;
-
- // TODO: ReAdd Setter but before making an propper way to overwrite NW constant only when the propperty has been used
-#pragma warning disable SA1623 // Property summary documentation should match accessors
-#pragma warning disable SA1202
- ///
- /// Gets or sets how mush cost the Ability Stalk will cost per tick when being stationary.
- ///
- internal float VigorStalkCostStationary { get; } = Scp106StalkAbility.VigorStalkCostStationary;
-
- ///
- /// Gets or sets how mush cost the Ability Stalk will cost per tick when moving.
- ///
- internal float VigorStalkCostMoving { get; } = Scp106StalkAbility.VigorStalkCostMoving;
-
- ///
- /// Gets or sets how mush vigor will be regenerate while moving per seconds.
- ///
- internal float VigorRegeneration { get; } = Scp106StalkAbility.VigorRegeneration;
-
- ///
- /// Gets or sets the duration of Corroding effect.
- ///
- internal float CorrodingTime { get; } = Scp106Attack.CorrodingTime;
-
- ///
- /// Gets or sets how mush vigor Scp106 will gain when being reward for having caught a player.
- ///
- internal float VigorCaptureReward { get; } = Scp106Attack.VigorCaptureReward;
-
- ///
- /// Gets or sets how mush reduction cooldown Scp106 will gain when being reward for having caught a player.
- ///
- internal float CooldownReductionReward { get; } = Scp106Attack.CooldownReductionReward;
-
- ///
- /// Gets or sets the cooldown duration of it's Sinkhole ability's.
- ///
- internal float SinkholeCooldownDuration { get; } = Scp106SinkholeController.CooldownDuration;
-
- ///
- /// Gets or sets how mush vigor it's ability Hunter Atlas will cost per meter.
- ///
- internal float HuntersAtlasCostPerMeter { get; } = Scp106HuntersAtlasAbility.CostPerMeter;
-#pragma warning restore SA1623 // Property summary documentation should match accessors
+ public float SinkholeTargetDuration => SinkholeController.TargetTransitionDuration;
///
/// Gets or sets how mush damage Scp106 will dealt when attacking a player.
@@ -254,21 +203,21 @@ public float CaptureCooldown
///
public float RemainingSinkholeCooldown
{
- get => SinkholeController.Cooldown.Remaining;
+ get => SinkholeController._submergeCooldown.Remaining;
set
{
- SinkholeController.Cooldown.Remaining = value;
+ SinkholeController._submergeCooldown.Remaining = value;
SinkholeController.ServerSendRpc(true);
}
}
///
- /// Gets or sets a value indicating whether or not SCP-106 will enter his stalking mode.
+ /// Gets or sets a value indicating whether SCP-106 will enter his stalking mode.
///
public bool IsStalking
{
- get => StalkAbility.IsActive;
- set => StalkAbility.IsActive = value;
+ get => StalkAbility.StalkActive;
+ set => StalkAbility.ServerSetStalk(value);
}
///
@@ -294,7 +243,7 @@ public bool UsePortal(Vector3 position, float cost = 0f)
return false;
HuntersAtlasAbility._estimatedCost = cost;
- HuntersAtlasAbility.SetSubmerged(true);
+ HuntersAtlasAbility._syncSubmerged = true;
return true;
}
@@ -303,22 +252,24 @@ public bool UsePortal(Vector3 position, float cost = 0f)
/// Send a player to the pocket dimension.
///
/// The to send.
- public void CapturePlayer(Player player) // Convert to bool.
+ /// If the player will be capture.
+ public bool CapturePlayer(Player player)
{
if (player is null)
- return;
+ return false;
Attack._targetHub = player.ReferenceHub;
DamageHandlerBase handler = new ScpDamageHandler(Attack.Owner, AttackDamage, DeathTranslations.PocketDecay);
if (!Attack._targetHub.playerStats.DealDamage(handler))
- return;
+ return false;
Attack.SendCooldown(Attack._hitCooldown);
- Vigor += VigorCaptureReward;
+ Vigor += Scp106Attack.VigorCaptureReward;
Attack.ReduceSinkholeCooldown();
Hitmarker.SendHitmarkerDirectly(Attack.Owner, 1f);
player.EnableEffect(EffectType.PocketCorroding);
+ return true;
}
///
diff --git a/EXILED/Exiled.API/Features/Roles/Scp173Role.cs b/EXILED/Exiled.API/Features/Roles/Scp173Role.cs
index 3a5f625ca..3737c17db 100644
--- a/EXILED/Exiled.API/Features/Roles/Scp173Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Scp173Role.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -145,7 +145,7 @@ public float RemainingTantrumCooldown
}
///
- /// Gets a value indicating whether or not SCP-173 is currently being viewed by one or more players.
+ /// Gets a value indicating whether SCP-173 is currently being viewed by one or more players.
///
public bool IsObserved => ObserversTracker.IsObserved;
@@ -174,7 +174,7 @@ public float SimulatedStare
}
///
- /// Gets or sets a value indicating whether or not SCP-173 is able to blink.
+ /// Gets or sets a value indicating whether SCP-173 is able to blink.
///
public bool BlinkReady
{
@@ -217,7 +217,7 @@ public float BlinkCooldown
public float BlinkDistance => TeleportAbility.EffectiveBlinkDistance;
///
- /// Gets or sets a value indicating whether or not SCP-173's breakneck speed is active.
+ /// Gets or sets a value indicating whether SCP-173's breakneck speed is active.
///
public bool BreakneckActive
{
@@ -233,7 +233,7 @@ public bool BreakneckActive
///
/// Places a Tantrum (SCP-173's ability) under the player.
///
- /// Whether or not to place the tantrum if SCP-173 is currently being viewed.
+ /// Whether to place the tantrum if SCP-173 is currently being viewed.
/// The cooldown until SCP-173 can place a tantrum again. Set to 0 to not affect the cooldown.
/// The instance, or if it cannot be placed.
public TantrumHazard PlaceTantrum(bool failIfObserved = false, float cooldown = 0)
diff --git a/EXILED/Exiled.API/Features/Roles/Scp3114Role.cs b/EXILED/Exiled.API/Features/Roles/Scp3114Role.cs
index 89dcefa15..ab157b92c 100644
--- a/EXILED/Exiled.API/Features/Roles/Scp3114Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Scp3114Role.cs
@@ -1,13 +1,12 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.API.Features.Roles
{
- using System;
using System.Collections.Generic;
using Exiled.API.Enums;
@@ -158,22 +157,12 @@ public RoleTypeId StolenRole
}
}
- ///
- /// Gets or sets the SCP-3114's Ragdoll used for it's FakeIdentity.
- ///
- [Obsolete("Ragdoll in Role now has other meaning. Use IdentityRagdoll instead.")]
- public new Ragdoll Ragdoll
- {
- get => IdentityRagdoll;
- set => IdentityRagdoll = value;
- }
-
///
/// Gets or sets the SCP-3114's Ragdoll used for it's FakeIdentity.
///
public Ragdoll IdentityRagdoll
{
- get => Ragdoll.Get(Identity.CurIdentity.Ragdoll);
+ get => Features.Ragdoll.Get(Identity.CurIdentity.Ragdoll);
set
{
Identity.CurIdentity.Ragdoll = value?.Base;
diff --git a/EXILED/Exiled.API/Features/Roles/Scp939Role.cs b/EXILED/Exiled.API/Features/Roles/Scp939Role.cs
index ec404f349..4396f8f87 100644
--- a/EXILED/Exiled.API/Features/Roles/Scp939Role.cs
+++ b/EXILED/Exiled.API/Features/Roles/Scp939Role.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -158,12 +158,12 @@ public float AttackCooldown
}
///
- /// Gets a value indicating whether or not SCP-939 is currently using its focus ability.
+ /// Gets a value indicating whether SCP-939 is currently using its focus ability.
///
public bool IsFocused => FocusAbility.TargetState;
///
- /// Gets a value indicating whether or not SCP-939 is currently lunging.
+ /// Gets a value indicating whether SCP-939 is currently lunging.
///
public bool IsLunging => LungeAbility.State is not Scp939LungeState.None;
@@ -217,7 +217,7 @@ public float MimicryCooldown
public int SavedVoices => MimicryRecorder.SavedVoices.Count;
///
- /// Gets a value indicating whether or not SCP-939 has a placed mimic point.
+ /// Gets a value indicating whether SCP-939 has a placed mimic point.
///
public bool MimicryPointActive => MimicPointController.Active;
diff --git a/EXILED/Exiled.API/Features/Roles/SpectatorRole.cs b/EXILED/Exiled.API/Features/Roles/SpectatorRole.cs
index 3bb2f052f..d7fbcc792 100644
--- a/EXILED/Exiled.API/Features/Roles/SpectatorRole.cs
+++ b/EXILED/Exiled.API/Features/Roles/SpectatorRole.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -49,7 +49,7 @@ internal SpectatorRole(SpectatorGameRole baseRole)
public Vector3 DeathPosition => Base.DeathPosition.Position;
///
- /// Gets a value indicating whether the is ready to respawn or not.
+ /// Gets a value indicating whether the is ready to respawn.
///
public bool IsReadyToRespawn => Base.ReadyToRespawn;
diff --git a/EXILED/Exiled.API/Features/Room.cs b/EXILED/Exiled.API/Features/Room.cs
index 4ca8bc4d3..f0440ad64 100644
--- a/EXILED/Exiled.API/Features/Room.cs
+++ b/EXILED/Exiled.API/Features/Room.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -156,7 +156,7 @@ public Color Color
}
///
- /// Gets or sets a value indicating whether or not the lights in this room are currently off.
+ /// Gets or sets a value indicating whether the lights in this room are currently off.
///
public bool AreLightsOff
{
@@ -395,7 +395,7 @@ public void UnlockAll()
/// Returns the Room in a human-readable format.
///
/// A string containing Room-related data.
- public override string ToString() => $"{Type} ({Zone}) [{Doors.Count}] *{Cameras.Count}* |{TeslaGate != null}|";
+ public override string ToString() => $"{Type} ({Zone}) [{Doors?.Count}] *{Cameras?.Count}* |{TeslaGate != null}|";
///
/// Factory method to create and add a component to a Transform.
@@ -412,62 +412,73 @@ private static RoomType FindType(GameObject gameObject)
// Try to remove brackets if they exist.
return gameObject.name.RemoveBracketsOnEndOfName() switch
{
- "LCZ_Armory" => RoomType.LczArmory,
- "LCZ_Curve" => RoomType.LczCurve,
- "LCZ_Straight" => RoomType.LczStraight,
- "LCZ_330" => RoomType.Lcz330,
- "LCZ_914" => RoomType.Lcz914,
- "LCZ_Crossing" => RoomType.LczCrossing,
- "LCZ_TCross" => RoomType.LczTCross,
+ "PocketWorld" => RoomType.Pocket,
+ "Outside" => RoomType.Surface,
"LCZ_Cafe" => RoomType.LczCafe,
- "LCZ_Plants" => RoomType.LczPlants,
"LCZ_Toilets" => RoomType.LczToilets,
+ "LCZ_TCross" => RoomType.LczTCross,
"LCZ_Airlock" => RoomType.LczAirlock,
- "LCZ_173" => RoomType.Lcz173,
- "LCZ_ClassDSpawn" => RoomType.LczClassDSpawn,
+ "LCZ_ChkpA" => RoomType.LczCheckpointA,
"LCZ_ChkpB" => RoomType.LczCheckpointB,
+ "LCZ_Plants" => RoomType.LczPlants,
+ "LCZ_Straight" => RoomType.LczStraight,
+ "LCZ_Armory" => RoomType.LczArmory,
+ "LCZ_Crossing" => RoomType.LczCrossing,
+ "LCZ_Curve" => RoomType.LczCurve,
+ "LCZ_173" => RoomType.Lcz173,
+ "LCZ_330" => RoomType.Lcz330,
"LCZ_372" => RoomType.LczGlassBox,
- "LCZ_ChkpA" => RoomType.LczCheckpointA,
- "HCZ_079" => RoomType.Hcz079,
- "HCZ_Room3ar" => RoomType.HczArmory,
+ "LCZ_914" => RoomType.Lcz914,
+ "LCZ_ClassDSpawn" => RoomType.LczClassDSpawn,
+ "HCZ_Nuke" => RoomType.HczNuke,
+ "HCZ_TArmory" => RoomType.HczArmory,
+ "HCZ_MicroHID_New" => RoomType.HczHid,
+ "HCZ_Crossroom_Water" => RoomType.HczCrossRoomWater,
"HCZ_Testroom" => RoomType.HczTestRoom,
- "HCZ_Hid" => RoomType.HczHid,
"HCZ_049" => RoomType.Hcz049,
- "HCZ_Crossing" => RoomType.HczCrossing,
- "HCZ_106" => RoomType.Hcz106,
- "HCZ_Nuke" => RoomType.HczNuke,
- "HCZ_Tesla" => RoomType.HczTesla,
- "HCZ_Servers" => RoomType.HczServers,
- "HCZ_Room3" => RoomType.HczTCross,
- "HCZ_457" => RoomType.Hcz096,
+ "HCZ_079" => RoomType.Hcz079,
+ "HCZ_096" => RoomType.Hcz096,
+ "HCZ_106_Rework" => RoomType.Hcz106,
+ "HCZ_939" => RoomType.Hcz939,
+ "HCZ_Tesla_Rework" => RoomType.HczTesla,
"HCZ_Curve" => RoomType.HczCurve,
+ "HCZ_Crossing" => RoomType.HczCrossing,
+ "HCZ_Intersection" => RoomType.HczIntersection,
+ "HCZ_Intersection_Junk" => RoomType.HczIntersectionJunk,
+ "HCZ_Corner_Deep" => RoomType.HczCornerDeep,
"HCZ_Straight" => RoomType.HczStraight,
- "EZ_Endoof" => RoomType.EzVent,
- "EZ_Intercom" => RoomType.EzIntercom,
+ "HCZ_Straight_C" => RoomType.HczStraightC,
+ "HCZ_Straight_PipeRoom"=> RoomType.HczStraightPipeRoom,
+ "HCZ_Straight Variant" => RoomType.HczStraightVariant,
+ "HCZ_ChkpA" => RoomType.HczElevatorA,
+ "HCZ_ChkpB" => RoomType.HczElevatorB,
"EZ_GateA" => RoomType.EzGateA,
- "EZ_PCs_small" => RoomType.EzDownstairsPcs,
+ "EZ_GateB" => RoomType.EzGateB,
+ "EZ_ThreeWay" => RoomType.EzTCross,
+ "EZ_Crossing" => RoomType.EzCrossing,
"EZ_Curve" => RoomType.EzCurve,
"EZ_PCs" => RoomType.EzPcs,
- "EZ_Crossing" => RoomType.EzCrossing,
+ "EZ_upstairs" => RoomType.EzUpstairsPcs,
+ "EZ_Intercom" => RoomType.EzIntercom,
+ "EZ_Smallrooms2" => RoomType.EzSmallrooms,
+ "EZ_PCs_small" => RoomType.EzDownstairsPcs,
+ "EZ_Chef" => RoomType.EzChef,
+ "EZ_Endoof" => RoomType.EzVent,
"EZ_CollapsedTunnel" => RoomType.EzCollapsedTunnel,
- "EZ_Smallrooms2" => RoomType.EzConference,
+ "EZ_Smallrooms1" => RoomType.EzConference,
"EZ_Straight" => RoomType.EzStraight,
+ "EZ_StraightColumn" => RoomType.EzStraightColumn,
"EZ_Cafeteria" => RoomType.EzCafeteria,
- "EZ_upstairs" => RoomType.EzUpstairsPcs,
- "EZ_GateB" => RoomType.EzGateB,
"EZ_Shelter" => RoomType.EzShelter,
- "EZ_ThreeWay" => RoomType.EzTCross,
- "PocketWorld" => RoomType.Pocket,
- "Outside" => RoomType.Surface,
- "HCZ_939" => RoomType.Hcz939,
- "EZ Part" => RoomType.EzCheckpointHallway,
- "HCZ_ChkpA" => RoomType.HczElevatorA,
- "HCZ_ChkpB" => RoomType.HczElevatorB,
- "HCZ Part" => gameObject.transform.parent.name switch
+ "EZ_HCZ_Checkpoint Part" => gameObject.transform.position.z switch
{
- "HCZ_EZ_Checkpoint (A)" => RoomType.HczEzCheckpointA,
- "HCZ_EZ_Checkpoint (B)" => RoomType.HczEzCheckpointB,
- _ => RoomType.Unknown
+ > 80 => RoomType.EzCheckpointHallwayA,
+ _ => RoomType.EzCheckpointHallwayB,
+ },
+ "HCZ_EZ_Checkpoint Part" => gameObject.transform.position.z switch
+ {
+ > 80 => RoomType.HczEzCheckpointA,
+ _ => RoomType.HczEzCheckpointB
},
_ => RoomType.Unknown,
};
@@ -477,6 +488,9 @@ private static ZoneType FindZone(GameObject gameObject)
{
Transform transform = gameObject.transform;
+ if (gameObject.name == "PocketWorld")
+ return ZoneType.Pocket;
+
return transform.parent?.name.RemoveBracketsOnEndOfName() switch
{
"HeavyRooms" => ZoneType.HeavyContainment,
@@ -493,14 +507,14 @@ private void InternalCreate()
RoomIdentifierToRoom.Add(Identifier, this);
Zone = FindZone(gameObject);
-#if Debug
- if (Type is RoomType.Unknown)
- Log.Error($"[ZONETYPE UNKNOWN] {this}");
+#if DEBUG
+ if (Zone is ZoneType.Unspecified)
+ Log.Error($"[ZONETYPE UNKNOWN] {this} Zone : {Identifier?.Zone}");
#endif
Type = FindType(gameObject);
-#if Debug
+#if DEBUG
if (Type is RoomType.Unknown)
- Log.Error($"[ROOMTYPE UNKNOWN] {this}");
+ Log.Error($"[ROOMTYPE UNKNOWN] {this} Name : {gameObject?.name} Shape : {Identifier?.Shape}");
#endif
RoomLightControllersValue.AddRange(gameObject.GetComponentsInChildren());
diff --git a/EXILED/Exiled.API/Features/Round.cs b/EXILED/Exiled.API/Features/Round.cs
index fb06a1b86..b6ee2b35f 100644
--- a/EXILED/Exiled.API/Features/Round.cs
+++ b/EXILED/Exiled.API/Features/Round.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -42,22 +42,22 @@ public static class Round
public static DateTime StartedTime => DateTime.Now - ElapsedTime;
///
- /// Gets a value indicating whether the round is started or not.
+ /// Gets a value indicating whether the round is started.
///
- public static bool IsStarted => ReferenceHub.LocalHub?.characterClassManager.RoundStarted ?? false;
+ public static bool IsStarted => ReferenceHub.TryGetHostHub(out ReferenceHub hub) && hub.characterClassManager.RoundStarted;
///
- /// Gets a value indicating whether the round in progress or not.
+ /// Gets a value indicating whether the round in progress.
///
- public static bool InProgress => ReferenceHub.LocalHub != null && RoundSummary.RoundInProgress();
+ public static bool InProgress => !IsEnded && RoundSummary.RoundInProgress();
///
- /// Gets a value indicating whether the round is ended or not.
+ /// Gets a value indicating whether the round is ended.
///
- public static bool IsEnded => RoundSummary.singleton._roundEnded;
+ public static bool IsEnded => RoundSummary._singletonSet && RoundSummary.singleton._roundEnded;
///
- /// Gets a value indicating whether the round is lobby or not.
+ /// Gets a value indicating whether the round is lobby.
///
public static bool IsLobby => !(IsEnded || IsStarted);
@@ -68,16 +68,16 @@ public static class Round
public static RoundSummary.SumInfo_ClassList LastClassList { get; internal set; }
///
- /// Gets or sets a value indicating the amount of Chaos Targets remaining.
+ /// Gets or sets a value indicating the amount of Extra Targets remaining.
///
- public static int ChaosTargetCount
+ public static int ExtraTargetCount
{
- get => RoundSummary.singleton.Network_chaosTargetCount;
- set => RoundSummary.singleton.Network_chaosTargetCount = value;
+ get => RoundSummary.singleton.Network_extraTargets;
+ set => RoundSummary.singleton.Network_extraTargets = value;
}
///
- /// Gets or sets a value indicating whether the round is locked or not.
+ /// Gets or sets a value indicating whether the round is locked.
///
public static bool IsLocked
{
@@ -86,7 +86,7 @@ public static bool IsLocked
}
///
- /// Gets or sets a value indicating whether the lobby is locked or not.
+ /// Gets or sets a value indicating whether the lobby is locked.
///
public static bool IsLobbyLocked
{
@@ -122,14 +122,9 @@ public static int Kills
}
///
- /// Gets or sets the number of surviving SCPs.
+ /// Gets the number of surviving SCPs.
///
- public static int SurvivingSCPs
- {
- get => RoundSummary.SurvivingSCPs;
- [Obsolete("This value is rewritten by NW every time it's used", true)]
- set => RoundSummary.SurvivingSCPs = value;
- }
+ public static int SurvivingSCPs => RoundSummary.SurvivingSCPs;
///
/// Gets or sets the number of kills made by SCPs.
@@ -194,7 +189,7 @@ public static IEnumerable AliveSides
/// Restarts the round with custom settings.
///
///
- /// Indicates whether or not it'll be a fast restart.
+ /// Indicates whether it'll be a fast restart.
/// If it's a fast restart, then players won't be reconnected from
/// the server; otherwise, they will.
///
@@ -234,9 +229,9 @@ public static void Restart(bool fastRestart = true, bool overrideRestartAction =
/// Forces the round to end, regardless of which factions are alive.
///
///
- /// Indicates whether or not it'll force the restart with no check if it's locked.
+ /// Indicates whether it'll force the restart with no check if it's locked.
///
- /// A describing whether or not the round was successfully ended.
+ /// A describing whether the round was successfully ended.
public static bool EndRound(bool forceEnd = false)
{
if (RoundSummary.singleton.KeepRoundOnOne && Player.Dictionary.Count < 2 && !forceEnd)
diff --git a/EXILED/Exiled.API/Features/Scp3114Ragdoll.cs b/EXILED/Exiled.API/Features/Scp3114Ragdoll.cs
index 494ec7cdc..a8856d142 100644
--- a/EXILED/Exiled.API/Features/Scp3114Ragdoll.cs
+++ b/EXILED/Exiled.API/Features/Scp3114Ragdoll.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -67,7 +67,7 @@ public float RevealElapsed
}
///
- /// Gets or sets a value indicating whether or not this corpse will trigger animation.
+ /// Gets or sets a value indicating whether this corpse will trigger animation.
///
public bool IsPlayingAnimation
{
diff --git a/EXILED/Exiled.API/Features/Scp914.cs b/EXILED/Exiled.API/Features/Scp914.cs
index 93ef42e37..b117e1e64 100644
--- a/EXILED/Exiled.API/Features/Scp914.cs
+++ b/EXILED/Exiled.API/Features/Scp914.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Server.cs b/EXILED/Exiled.API/Features/Server.cs
index 5dea5ee84..c79d0c4c1 100644
--- a/EXILED/Exiled.API/Features/Server.cs
+++ b/EXILED/Exiled.API/Features/Server.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -74,12 +74,12 @@ public static string Name
public static string Version => GameCore.Version.VersionString;
///
- /// Gets a value indicating whether or not streaming of this version is allowed.
+ /// Gets a value indicating whether streaming of this version is allowed.
///
public static bool StreamingAllowed => GameCore.Version.StreamingAllowed;
///
- /// Gets a value indicating whether or not this server is on a beta version of SCP:SL.
+ /// Gets a value indicating whether this server is on a beta version of SCP:SL.
///
public static bool IsBeta => GameCore.Version.PublicBeta || GameCore.Version.PrivateBeta;
@@ -99,7 +99,7 @@ public static string Name
public static string IpAddress => ServerConsole.Ip;
///
- /// Gets a value indicating whether or not this server is a dedicated server.
+ /// Gets a value indicating whether this server is a dedicated server.
///
public static bool IsDedicated => ServerStatic.IsDedicated;
@@ -128,7 +128,7 @@ public static short MaxTps
public static double Frametime => Math.Round(1f / Time.deltaTime);
///
- /// Gets or sets a value indicating whether or not friendly fire is enabled.
+ /// Gets or sets a value indicating whether friendly fire is enabled.
///
///
public static bool FriendlyFire
@@ -159,7 +159,7 @@ public static int MaxPlayerCount
}
///
- /// Gets a value indicating whether or not late join is enabled.
+ /// Gets a value indicating whether late join is enabled.
///
public static bool LateJoinEnabled => LateJoinTime > 0;
@@ -181,7 +181,7 @@ public static bool IsHeavilyModded
}
///
- /// Gets or sets a value indicating whether or not this server has the whitelist enabled.
+ /// Gets or sets a value indicating whether this server has the whitelist enabled.
///
public static bool IsWhitelisted
{
@@ -195,12 +195,12 @@ public static bool IsWhitelisted
public static HashSet WhitelistedPlayers => WhiteList.Users;
///
- /// Gets a value indicating whether or not this server is verified.
+ /// Gets a value indicating whether this server is verified.
///
public static bool IsVerified => CustomNetworkManager.IsVerified;
///
- /// Gets or sets a value indicating whether or not idle mode is enabled.
+ /// Gets or sets a value indicating whether idle mode is enabled.
///
public static bool IsIdleModeEnabled
{
@@ -267,14 +267,6 @@ public static bool ShutdownRedirect(ushort redirectPort)
return true;
}
- ///
- /// Runs a server command.
- ///
- /// The command to be run.
- /// The running the command.
- [Obsolete("Use Server.ExecuteCommand() instead.")]
- public static void RunCommand(string command, CommandSender sender = null) => GameCore.Console.singleton.TypeCommand(command, sender);
-
///
/// Executes a server command.
///
diff --git a/EXILED/Exiled.API/Features/Spawn/DynamicSpawnPoint.cs b/EXILED/Exiled.API/Features/Spawn/DynamicSpawnPoint.cs
index d56b20419..3a6c7146b 100644
--- a/EXILED/Exiled.API/Features/Spawn/DynamicSpawnPoint.cs
+++ b/EXILED/Exiled.API/Features/Spawn/DynamicSpawnPoint.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Spawn/LockerSpawnPoint.cs b/EXILED/Exiled.API/Features/Spawn/LockerSpawnPoint.cs
index ecc434127..ad0019ce4 100644
--- a/EXILED/Exiled.API/Features/Spawn/LockerSpawnPoint.cs
+++ b/EXILED/Exiled.API/Features/Spawn/LockerSpawnPoint.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Spawn/RoleSpawnPoint.cs b/EXILED/Exiled.API/Features/Spawn/RoleSpawnPoint.cs
index 3b41c40fa..6b2d31422 100644
--- a/EXILED/Exiled.API/Features/Spawn/RoleSpawnPoint.cs
+++ b/EXILED/Exiled.API/Features/Spawn/RoleSpawnPoint.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Spawn/RoomSpawnPoint.cs b/EXILED/Exiled.API/Features/Spawn/RoomSpawnPoint.cs
index 7336fd083..97041a2c9 100644
--- a/EXILED/Exiled.API/Features/Spawn/RoomSpawnPoint.cs
+++ b/EXILED/Exiled.API/Features/Spawn/RoomSpawnPoint.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Spawn/SpawnLocation.cs b/EXILED/Exiled.API/Features/Spawn/SpawnLocation.cs
index 3b175f761..975d5bc77 100644
--- a/EXILED/Exiled.API/Features/Spawn/SpawnLocation.cs
+++ b/EXILED/Exiled.API/Features/Spawn/SpawnLocation.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Spawn/SpawnPoint.cs b/EXILED/Exiled.API/Features/Spawn/SpawnPoint.cs
index 7d3827b76..880ea9e35 100644
--- a/EXILED/Exiled.API/Features/Spawn/SpawnPoint.cs
+++ b/EXILED/Exiled.API/Features/Spawn/SpawnPoint.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Spawn/SpawnProperties.cs b/EXILED/Exiled.API/Features/Spawn/SpawnProperties.cs
index 4cdf3345b..6b5ab7d79 100644
--- a/EXILED/Exiled.API/Features/Spawn/SpawnProperties.cs
+++ b/EXILED/Exiled.API/Features/Spawn/SpawnProperties.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/Spawn/StaticSpawnPoint.cs b/EXILED/Exiled.API/Features/Spawn/StaticSpawnPoint.cs
index be39c0fe4..4574da576 100644
--- a/EXILED/Exiled.API/Features/Spawn/StaticSpawnPoint.cs
+++ b/EXILED/Exiled.API/Features/Spawn/StaticSpawnPoint.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Features/TeslaGate.cs b/EXILED/Exiled.API/Features/TeslaGate.cs
index 4d7909592..90595f7cd 100644
--- a/EXILED/Exiled.API/Features/TeslaGate.cs
+++ b/EXILED/Exiled.API/Features/TeslaGate.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -92,7 +92,7 @@ internal TeslaGate(BaseTeslaGate baseTeslaGate, Room room)
public Room Room { get; }
///
- /// Gets a value indicating whether or not the tesla gate's shock burst is in progess.
+ /// Gets a value indicating whether the tesla gate's shock burst is in progess.
///
public bool IsShocking => Base.InProgress;
@@ -166,7 +166,7 @@ public bool IsIdling
}
///
- /// Gets or sets a value indicating whether or not the tesla gate's next burst should be treated as instant burst.
+ /// Gets or sets a value indicating whether the tesla gate's next burst should be treated as instant burst.
/// The instant burst ignores the standard cooldown time, reducing it to the cooldown time used for bursts triggered by SCP-079.
///
public bool UseInstantBurst
@@ -216,7 +216,7 @@ public static TeslaGate Get(BaseTeslaGate baseTeslaGate) => BaseTeslaGateToTesla
///
/// The instance.
/// A or if not found.
- /// Whether or not the tesla gate was found.
+ /// Whether the tesla gate was found.
public static bool TryGet(BaseTeslaGate baseTeslaGate, out TeslaGate gate)
{
gate = Get(baseTeslaGate);
@@ -228,7 +228,7 @@ public static bool TryGet(BaseTeslaGate baseTeslaGate, out TeslaGate gate)
///
/// The condition to satify.
/// A of which contains elements that satify the condition.
- /// Whether or not at least one tesla gate was found.
+ /// Whether at least one tesla gate was found.
public static bool TryGet(Func predicate, out IEnumerable gates)
{
gates = Get(predicate);
diff --git a/EXILED/Exiled.API/Features/Toys/AdminToy.cs b/EXILED/Exiled.API/Features/Toys/AdminToy.cs
index 5287096a1..01f54e8d2 100644
--- a/EXILED/Exiled.API/Features/Toys/AdminToy.cs
+++ b/EXILED/Exiled.API/Features/Toys/AdminToy.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -98,7 +98,7 @@ public Quaternion Rotation
set
{
AdminToyBase.transform.rotation = value;
- AdminToyBase.NetworkRotation = new LowPrecisionQuaternion(value);
+ AdminToyBase.NetworkRotation = value;
}
}
@@ -155,6 +155,7 @@ public static AdminToy Get(AdminToyBase adminToyBase)
LightSourceToy lightSourceToy => new Light(lightSourceToy),
PrimitiveObjectToy primitiveObjectToy => new Primitive(primitiveObjectToy),
ShootingTarget shootingTarget => new ShootingTargetToy(shootingTarget),
+ SpeakerToy speakerToy => new Speaker(speakerToy),
_ => throw new System.NotImplementedException()
};
}
diff --git a/EXILED/Exiled.API/Features/Toys/Light.cs b/EXILED/Exiled.API/Features/Toys/Light.cs
index e484c9e04..757480e90 100644
--- a/EXILED/Exiled.API/Features/Toys/Light.cs
+++ b/EXILED/Exiled.API/Features/Toys/Light.cs
@@ -1,13 +1,12 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.API.Features.Toys
{
- using System;
using System.Linq;
using AdminToys;
@@ -32,6 +31,11 @@ internal Light(LightSourceToy lightSourceToy)
Base = lightSourceToy;
}
+ ///
+ /// Gets the prefab.
+ ///
+ public static LightSourceToy Prefab => PrefabHelper.GetPrefab(PrefabType.LightSourceToy);
+
///
/// Gets the base .
///
@@ -55,6 +59,33 @@ public float Range
set => Base.NetworkLightRange = value;
}
+ ///
+ /// Gets or sets the angle of the light.
+ ///
+ public float SpotAngle
+ {
+ get => Base.NetworkSpotAngle;
+ set => Base.NetworkSpotAngle = value;
+ }
+
+ ///
+ /// Gets or sets the inner angle of the light.
+ ///
+ public float InnerSpotAngle
+ {
+ get => Base.NetworkInnerSpotAngle;
+ set => Base.NetworkInnerSpotAngle = value;
+ }
+
+ ///
+ /// Gets or sets the shadow strength of the light.
+ ///
+ public float ShadowStrength
+ {
+ get => Base.NetworkShadowStrength;
+ set => Base.NetworkShadowStrength = value;
+ }
+
///
/// Gets or sets the color of the primitive.
///
@@ -67,10 +98,19 @@ public Color Color
///
/// Gets or sets a value indicating whether the light should cause shadows from other objects.
///
- public bool ShadowEmission
+ public LightShape LightShape
+ {
+ get => Base.NetworkLightShape;
+ set => Base.NetworkLightShape = value;
+ }
+
+ ///
+ /// Gets or sets a value indicating whether the light should cause shadows from other objects.
+ ///
+ public LightType LightType
{
- get => Base.NetworkLightShadows;
- set => Base.NetworkLightShadows = value;
+ get => Base.NetworkLightType;
+ set => Base.NetworkLightType = value;
}
///
@@ -95,11 +135,12 @@ public static Light Create(Vector3? position = null, Vector3? rotation = null, V
/// The new .
public static Light Create(Vector3? position /*= null*/, Vector3? rotation /*= null*/, Vector3? scale /*= null*/, bool spawn /*= true*/, Color? color /*= null*/)
{
- Light light = new(UnityEngine.Object.Instantiate(ToysHelper.LightBaseObject));
-
- light.Position = position ?? Vector3.zero;
- light.Rotation = Quaternion.Euler(rotation ?? Vector3.zero);
- light.Scale = scale ?? Vector3.one;
+ Light light = new(UnityEngine.Object.Instantiate(Prefab))
+ {
+ Position = position ?? Vector3.zero,
+ Rotation = Quaternion.Euler(rotation ?? Vector3.zero),
+ Scale = scale ?? Vector3.one,
+ };
if (spawn)
light.Spawn();
@@ -116,8 +157,8 @@ public static Light Create(Vector3? position /*= null*/, Vector3? rotation /*= n
/// The corresponding instance.
public static Light Get(LightSourceToy lightSourceToy)
{
- AdminToy adminToy = Map.Toys.FirstOrDefault(x => x.AdminToyBase == lightSourceToy);
- return adminToy is not null ? adminToy as Light : new Light(lightSourceToy);
+ AdminToy adminToy = List.FirstOrDefault(x => x.AdminToyBase == lightSourceToy);
+ return adminToy is not null ? adminToy as Light : new(lightSourceToy);
}
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Toys/Primitive.cs b/EXILED/Exiled.API/Features/Toys/Primitive.cs
index 647350b16..9ca95036d 100644
--- a/EXILED/Exiled.API/Features/Toys/Primitive.cs
+++ b/EXILED/Exiled.API/Features/Toys/Primitive.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -31,6 +31,11 @@ public class Primitive : AdminToy, IWrapper
internal Primitive(PrimitiveObjectToy toyAdminToyBase)
: base(toyAdminToyBase, AdminToyType.PrimitiveObject) => Base = toyAdminToyBase;
+ ///
+ /// Gets the prefab.
+ ///
+ public static PrimitiveObjectToy Prefab => PrefabHelper.GetPrefab(PrefabType.PrimitiveObjectToy);
+
///
/// Gets the base .
///
@@ -87,7 +92,7 @@ public PrimitiveFlags Flags
/// The position of the .
/// The rotation of the .
/// The scale of the .
- /// Whether or not the should be initially spawned.
+ /// Whether the should be initially spawned.
/// The new .
public static Primitive Create(Vector3? position = null, Vector3? rotation = null, Vector3? scale = null, bool spawn = true)
=> Create(position, rotation, scale, spawn, null);
@@ -99,7 +104,7 @@ public static Primitive Create(Vector3? position = null, Vector3? rotation = nul
/// The position of the .
/// The rotation of the .
/// The scale of the .
- /// Whether or not the should be initially spawned.
+ /// Whether the should be initially spawned.
/// The new .
public static Primitive Create(PrimitiveType primitiveType = PrimitiveType.Sphere, Vector3? position = null, Vector3? rotation = null, Vector3? scale = null, bool spawn = true)
=> Create(primitiveType, position, rotation, scale, spawn, null);
@@ -110,22 +115,21 @@ public static Primitive Create(PrimitiveType primitiveType = PrimitiveType.Spher
/// The position of the .
/// The rotation of the .
/// The scale of the .
- /// Whether or not the should be initially spawned.
+ /// Whether the should be initially spawned.
/// The color of the .
/// The new .
public static Primitive Create(Vector3? position /*= null*/, Vector3? rotation /*= null*/, Vector3? scale /*= null*/, bool spawn /*= true*/, Color? color /*= null*/)
{
- Primitive primitive = new(Object.Instantiate(ToysHelper.PrimitiveBaseObject));
+ Primitive primitive = new(Object.Instantiate(Prefab));
primitive.Position = position ?? Vector3.zero;
primitive.Rotation = Quaternion.Euler(rotation ?? Vector3.zero);
primitive.Scale = scale ?? Vector3.one;
+ primitive.Color = color ?? Color.gray;
if (spawn)
primitive.Spawn();
- primitive.Color = color ?? Color.gray;
-
return primitive;
}
@@ -136,23 +140,23 @@ public static Primitive Create(Vector3? position /*= null*/, Vector3? rotation /
/// The position of the .
/// The rotation of the .
/// The scale of the .
- /// Whether or not the should be initially spawned.
+ /// Whether the should be initially spawned.
/// The color of the .
/// The new .
public static Primitive Create(PrimitiveType primitiveType /*= PrimitiveType.Sphere*/, Vector3? position /*= null*/, Vector3? rotation /*= null*/, Vector3? scale /*= null*/, bool spawn /*= true*/, Color? color /*= null*/)
{
- Primitive primitive = new(Object.Instantiate(ToysHelper.PrimitiveBaseObject));
+ Primitive primitive = new(Object.Instantiate(Prefab));
primitive.Position = position ?? Vector3.zero;
primitive.Rotation = Quaternion.Euler(rotation ?? Vector3.zero);
primitive.Scale = scale ?? Vector3.one;
- if (spawn)
- primitive.Spawn();
-
primitive.Base.NetworkPrimitiveType = primitiveType;
primitive.Color = color ?? Color.gray;
+ if (spawn)
+ primitive.Spawn();
+
return primitive;
}
@@ -164,24 +168,24 @@ public static Primitive Create(PrimitiveType primitiveType /*= PrimitiveType.Sph
/// The position of the .
/// The rotation of the .
/// The scale of the .
- /// Whether or not the should be initially spawned.
+ /// Whether the should be initially spawned.
/// The color of the .
/// The new .
public static Primitive Create(PrimitiveType primitiveType /*= PrimitiveType.Sphere*/, PrimitiveFlags flags, Vector3? position /*= null*/, Vector3? rotation /*= null*/, Vector3? scale /*= null*/, bool spawn /*= true*/, Color? color /*= null*/)
{
- Primitive primitive = new(Object.Instantiate(ToysHelper.PrimitiveBaseObject));
+ Primitive primitive = new(Object.Instantiate(Prefab));
primitive.Position = position ?? Vector3.zero;
primitive.Rotation = Quaternion.Euler(rotation ?? Vector3.zero);
primitive.Scale = scale ?? Vector3.one;
primitive.Flags = flags;
- if (spawn)
- primitive.Spawn();
-
primitive.Base.NetworkPrimitiveType = primitiveType;
primitive.Color = color ?? Color.gray;
+ if (spawn)
+ primitive.Spawn();
+
return primitive;
}
@@ -192,20 +196,20 @@ public static Primitive Create(PrimitiveType primitiveType /*= PrimitiveType.Sph
/// The new .
public static Primitive Create(PrimitiveSettings primitiveSettings)
{
- Primitive primitive = new(Object.Instantiate(ToysHelper.PrimitiveBaseObject));
+ Primitive primitive = new(Object.Instantiate(Prefab));
primitive.Position = primitiveSettings.Position;
primitive.Rotation = Quaternion.Euler(primitiveSettings.Rotation);
primitive.Scale = primitiveSettings.Scale;
primitive.Flags = primitiveSettings.Flags;
- if (primitiveSettings.Spawn)
- primitive.Spawn();
-
primitive.Base.NetworkPrimitiveType = primitiveSettings.PrimitiveType;
primitive.Color = primitiveSettings.Color;
primitive.IsStatic = primitiveSettings.IsStatic;
+ if (primitiveSettings.Spawn)
+ primitive.Spawn();
+
return primitive;
}
@@ -216,8 +220,8 @@ public static Primitive Create(PrimitiveSettings primitiveSettings)
/// The corresponding instance.
public static Primitive Get(PrimitiveObjectToy primitiveObjectToy)
{
- AdminToy adminToy = Map.Toys.FirstOrDefault(x => x.AdminToyBase == primitiveObjectToy);
- return adminToy is not null ? adminToy as Primitive : new Primitive(primitiveObjectToy);
+ AdminToy adminToy = List.FirstOrDefault(x => x.AdminToyBase == primitiveObjectToy);
+ return adminToy is not null ? adminToy as Primitive : new(primitiveObjectToy);
}
}
}
diff --git a/EXILED/Exiled.API/Features/Toys/ShootingTargetToy.cs b/EXILED/Exiled.API/Features/Toys/ShootingTargetToy.cs
index 01cb47db3..2951459bc 100644
--- a/EXILED/Exiled.API/Features/Toys/ShootingTargetToy.cs
+++ b/EXILED/Exiled.API/Features/Toys/ShootingTargetToy.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -46,6 +46,21 @@ internal ShootingTargetToy(ShootingTarget target)
Type = TypeLookup.TryGetValue(Base.gameObject.name.Substring(0, Base.gameObject.name.Length - 7), out ShootingTargetType type) ? type : ShootingTargetType.Unknown;
}
+ ///
+ /// Gets the prefab for Sport Shooting Target.
+ ///
+ public static ShootingTarget SportShootingTargetPrefab => PrefabHelper.GetPrefab(PrefabType.SportTarget);
+
+ ///
+ /// Gets the prefab for DBoy Shooting Target.
+ ///
+ public static ShootingTarget DboyShootingTargetPrefab => PrefabHelper.GetPrefab(PrefabType.DBoyTarget);
+
+ ///
+ /// Gets the prefab for Binary Shooting Target.
+ ///
+ public static ShootingTarget BinaryShootingTargetPrefab => PrefabHelper.GetPrefab(PrefabType.BinaryTarget);
+
///
/// Gets the base-game for this target.
///
@@ -135,7 +150,7 @@ public int AutoResetTime
}
///
- /// Gets or sets a value indicating whether or not the target is in sync mode.
+ /// Gets or sets a value indicating whether the target is in sync mode.
///
public bool IsSynced
{
@@ -165,19 +180,19 @@ public static ShootingTargetToy Create(ShootingTargetType type, Vector3? positio
{
case ShootingTargetType.ClassD:
{
- shootingTargetToy = new ShootingTargetToy(Object.Instantiate(ToysHelper.DboyShootingTargetObject));
+ shootingTargetToy = new(Object.Instantiate(DboyShootingTargetPrefab));
break;
}
case ShootingTargetType.Binary:
{
- shootingTargetToy = new ShootingTargetToy(Object.Instantiate(ToysHelper.BinaryShootingTargetObject));
+ shootingTargetToy = new(Object.Instantiate(BinaryShootingTargetPrefab));
break;
}
default:
{
- shootingTargetToy = new ShootingTargetToy(Object.Instantiate(ToysHelper.SportShootingTargetObject));
+ shootingTargetToy = new(Object.Instantiate(SportShootingTargetPrefab));
break;
}
}
@@ -199,8 +214,8 @@ public static ShootingTargetToy Create(ShootingTargetType type, Vector3? positio
/// The corresponding instance.
public static ShootingTargetToy Get(ShootingTarget shootingTarget)
{
- AdminToy adminToy = Map.Toys.FirstOrDefault(x => x.AdminToyBase == shootingTarget);
- return adminToy is not null ? adminToy as ShootingTargetToy : new ShootingTargetToy(shootingTarget);
+ AdminToy adminToy = List.FirstOrDefault(x => x.AdminToyBase == shootingTarget);
+ return adminToy is not null ? adminToy as ShootingTargetToy : new(shootingTarget);
}
///
@@ -214,7 +229,7 @@ public static ShootingTargetToy Get(ShootingTarget shootingTarget)
/// The damage to be dealt.
/// The dealing the damage.
/// The exact location of the hit.
- /// Whether or not the damage was sent.
+ /// Whether the damage was sent.
public bool Damage(float damage, DamageHandlerBase damageHandler, Vector3 exactHit) => Base.Damage(damage, damageHandler, exactHit);
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Toys/Speaker.cs b/EXILED/Exiled.API/Features/Toys/Speaker.cs
new file mode 100644
index 000000000..c51b8bcb7
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Toys/Speaker.cs
@@ -0,0 +1,112 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Toys
+{
+ using AdminToys;
+ using Enums;
+ using Exiled.API.Interfaces;
+ using UnityEngine;
+
+ ///
+ /// A wrapper class for .
+ ///
+ public class Speaker : AdminToy, IWrapper
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The of the toy.
+ internal Speaker(SpeakerToy speakerToy)
+ : base(speakerToy, AdminToyType.Speaker) => Base = speakerToy;
+
+ ///
+ /// Gets the prefab.
+ ///
+ public static SpeakerToy Prefab => PrefabHelper.GetPrefab(PrefabType.SpeakerToy);
+
+ ///
+ /// Gets the base .
+ ///
+ public SpeakerToy Base { get; }
+
+ ///
+ /// Gets or sets the volume of the audio source.
+ ///
+ ///
+ /// A representing the volume level of the audio source,
+ /// where 0.0 is silent and 1.0 is full volume.
+ ///
+ public float Volume
+ {
+ get => Base.NetworkVolume;
+ set => Base.NetworkVolume = value;
+ }
+
+ ///
+ /// Gets or sets a value indicating whether the audio source is spatialized.
+ ///
+ ///
+ /// A where true means the audio source is spatial, allowing
+ /// for 3D audio positioning relative to the listener; false means it is non-spatial.
+ ///
+ public bool IsSpatial
+ {
+ get => Base.NetworkIsSpatial;
+ set => Base.NetworkIsSpatial = value;
+ }
+
+ ///
+ /// Gets or sets the maximum distance at which the audio source can be heard.
+ ///
+ ///
+ /// A representing the maximum hearing distance for the audio source.
+ /// Beyond this distance, the audio will not be audible.
+ ///
+ public float MaxDistance
+ {
+ get => Base.NetworkMaxDistance;
+ set => Base.NetworkMaxDistance = value;
+ }
+
+ ///
+ /// Gets or sets the minimum distance at which the audio source reaches full volume.
+ ///
+ ///
+ /// A representing the distance from the source at which the audio is heard at full volume.
+ /// Within this range, volume will not decrease with proximity.
+ ///
+ public float MinDistance
+ {
+ get => Base.NetworkMinDistance;
+ set => Base.NetworkMinDistance = value;
+ }
+
+ ///
+ /// Creates a new .
+ ///
+ /// The position of the .
+ /// The rotation of the .
+ /// The scale of the .
+ /// Whether the should be initially spawned.
+ /// The new .
+ public static Speaker Create(Vector3? position, Vector3? rotation, Vector3? scale, bool spawn)
+ {
+ Speaker speaker = new(UnityEngine.Object.Instantiate(Prefab))
+ {
+ Position = position ?? Vector3.zero,
+ Rotation = Quaternion.Euler(rotation ?? Vector3.zero),
+ Scale = scale ?? Vector3.one,
+ };
+
+ if (spawn)
+ speaker.Spawn();
+
+ return speaker;
+ }
+ }
+}
diff --git a/EXILED/Exiled.API/Features/Toys/ToysHelper.cs b/EXILED/Exiled.API/Features/Toys/ToysHelper.cs
deleted file mode 100644
index 1f1c5f207..000000000
--- a/EXILED/Exiled.API/Features/Toys/ToysHelper.cs
+++ /dev/null
@@ -1,142 +0,0 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
-// Licensed under the CC BY-SA 3.0 license.
-//
-// -----------------------------------------------------------------------
-
-namespace Exiled.API.Features.Toys
-{
- using AdminToys;
-
- using Mirror;
-
- using UnityEngine;
-
- ///
- /// A helper class for interacting with toys.
- ///
- public static class ToysHelper
- {
- private static PrimitiveObjectToy primitiveBaseObject;
- private static LightSourceToy lightBaseObject;
- private static ShootingTarget sportShootingTargetObject;
- private static ShootingTarget dboyShootingTargetObject;
- private static ShootingTarget binaryShootingTargetObject;
-
- ///
- /// Gets the base to instantiate when creating a new primitive.
- ///
- public static PrimitiveObjectToy PrimitiveBaseObject
- {
- get
- {
- if (primitiveBaseObject is null)
- {
- foreach (GameObject gameObject in NetworkClient.prefabs.Values)
- {
- if (gameObject.TryGetComponent(out PrimitiveObjectToy component))
- {
- primitiveBaseObject = component;
- break;
- }
- }
- }
-
- return primitiveBaseObject;
- }
- }
-
- ///
- /// Gets the base to instantiate when creating a new light.
- ///
- public static LightSourceToy LightBaseObject
- {
- get
- {
- if (lightBaseObject is null)
- {
- foreach (GameObject gameObject in NetworkClient.prefabs.Values)
- {
- if (gameObject.TryGetComponent(out LightSourceToy component))
- {
- lightBaseObject = component;
- break;
- }
- }
- }
-
- return lightBaseObject;
- }
- }
-
- ///
- /// Gets the base to instantiate when creating a new sport shooting target.
- ///
- public static ShootingTarget SportShootingTargetObject
- {
- get
- {
- if (sportShootingTargetObject is null)
- {
- foreach (GameObject gameObject in NetworkClient.prefabs.Values)
- {
- if ((gameObject.name == "sportTargetPrefab") && gameObject.TryGetComponent(out ShootingTarget shootingTarget))
- {
- sportShootingTargetObject = shootingTarget;
- break;
- }
- }
- }
-
- return sportShootingTargetObject;
- }
- }
-
- ///
- /// Gets the base to instantiate when creating a new dboy shooting target.
- ///
- public static ShootingTarget DboyShootingTargetObject
- {
- get
- {
- if (dboyShootingTargetObject is null)
- {
- foreach (GameObject gameObject in NetworkClient.prefabs.Values)
- {
- if ((gameObject.name == "dboyTargetPrefab") && gameObject.TryGetComponent(out ShootingTarget shootingTarget))
- {
- dboyShootingTargetObject = shootingTarget;
- break;
- }
- }
- }
-
- return dboyShootingTargetObject;
- }
- }
-
- ///
- /// Gets the base to instantiate when creating a new binary shooting target.
- ///
- public static ShootingTarget BinaryShootingTargetObject
- {
- get
- {
- if (binaryShootingTargetObject is null)
- {
- foreach (GameObject gameObject in NetworkClient.prefabs.Values)
- {
- if ((gameObject.name == "binaryTargetPrefab") && gameObject.TryGetComponent(out ShootingTarget shootingTarget))
- {
- binaryShootingTargetObject = shootingTarget;
- break;
- }
- }
- }
-
- return binaryShootingTargetObject;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Warhead.cs b/EXILED/Exiled.API/Features/Warhead.cs
index 241d94c73..a7369cfab 100644
--- a/EXILED/Exiled.API/Features/Warhead.cs
+++ b/EXILED/Exiled.API/Features/Warhead.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -43,7 +43,7 @@ public static class Warhead
public static GameObject Lever => SitePanel.lever.gameObject;
///
- /// Gets or sets a value indicating whether or not automatic detonation is enabled.
+ /// Gets or sets a value indicating whether automatic detonation is enabled.
///
public static bool AutoDetonate
{
@@ -52,7 +52,7 @@ public static bool AutoDetonate
}
///
- /// Gets or sets a value indicating whether or not doors will be opened when the warhead activates.
+ /// Gets or sets a value indicating whether doors will be opened when the warhead activates.
///
public static bool OpenDoors
{
@@ -66,7 +66,7 @@ public static bool OpenDoors
public static IReadOnlyCollection BlastDoors => BlastDoor.Instances;
///
- /// Gets or sets a value indicating whether or not the warhead lever is enabled.
+ /// Gets or sets a value indicating whether the warhead lever is enabled.
///
public static bool LeverStatus
{
@@ -75,7 +75,7 @@ public static bool LeverStatus
}
///
- /// Gets or sets a value indicating whether or not the warhead's outside panel has been opened.
+ /// Gets or sets a value indicating whether the warhead's outside panel has been opened.
///
public static bool IsKeycardActivated
{
@@ -111,12 +111,12 @@ public static WarheadStatus Status
}
///
- /// Gets a value indicating whether or not the warhead has already been detonated.
+ /// Gets a value indicating whether the warhead has already been detonated.
///
- public static bool IsDetonated => Controller._alreadyDetonated;
+ public static bool IsDetonated => Controller.AlreadyDetonated;
///
- /// Gets a value indicating whether or not the warhead detonation is in progress.
+ /// Gets a value indicating whether the warhead detonation is in progress.
///
public static bool IsInProgress => Controller.Info.InProgress;
@@ -135,7 +135,7 @@ public static float DetonationTimer
public static float RealDetonationTimer => Controller.CurScenario.TimeToDetonate;
///
- /// Gets or sets a value indicating whether or not the warhead can be disabled.
+ /// Gets or sets a value indicating whether the warhead can be disabled.
///
public static bool IsLocked
{
@@ -153,7 +153,7 @@ public static int Kills
}
///
- /// Gets a value indicating whether or not the warhead can be started.
+ /// Gets a value indicating whether the warhead can be started.
///
public static bool CanBeStarted => !IsInProgress && !IsDetonated && Controller.CooldownEndTime <= NetworkTime.time;
@@ -197,11 +197,11 @@ public static void Start()
public static void Shake() => Controller.RpcShake(false);
///
- /// Gets whether or not the provided position will be detonated by the alpha warhead.
+ /// Gets whether the provided position will be detonated by the alpha warhead.
///
/// The position to check.
/// If , only lifts will be checked.
- /// Whether or not the given position is prone to being detonated.
+ /// Whether the given position is prone to being detonated.
public static bool CanBeDetonated(Vector3 pos, bool includeOnlyLifts = false) => AlphaWarheadController.CanBeDetonated(pos, includeOnlyLifts);
}
}
diff --git a/EXILED/Exiled.API/Features/Waves/TimedWave.cs b/EXILED/Exiled.API/Features/Waves/TimedWave.cs
new file mode 100644
index 000000000..346bcd6c1
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Waves/TimedWave.cs
@@ -0,0 +1,198 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Waves
+{
+ using System.Collections.Generic;
+ using System.Linq;
+
+ using Exiled.API.Enums;
+ using PlayerRoles;
+ using Respawning;
+ using Respawning.Announcements;
+ using Respawning.Waves;
+
+ ///
+ /// Represents a timed wave.
+ ///
+ public class TimedWave
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The that this class should be based off of.
+ ///
+ public TimedWave(TimeBasedWave wave) => Base = wave;
+
+ ///
+ /// Gets the base .
+ ///
+ public TimeBasedWave Base { get; }
+
+ ///
+ /// Gets the name of the wave timer.
+ ///
+ public string Name => Base.GetType().Name;
+
+ ///
+ /// Gets a value indicating whether the wave is a mini wave.
+ ///
+ public bool IsMiniWave => Base is IMiniWave;
+
+ ///
+ /// Gets the wave timer instance.
+ ///
+ public WaveTimer Timer => new(Base.Timer);
+
+ ///
+ /// Gets the faction of this wave.
+ ///
+ public Faction Faction => Base.TargetFaction;
+
+ ///
+ /// Gets the team of this wave.
+ ///
+ public Team Team => Base.TargetFaction.GetSpawnableTeam();
+
+ ///
+ /// Gets the spawnable faction for this wave.
+ ///
+ public SpawnableFaction SpawnableFaction => Faction switch
+ {
+ Faction.FoundationStaff when IsMiniWave => SpawnableFaction.NtfMiniWave,
+ Faction.FoundationStaff => SpawnableFaction.NtfWave,
+ Faction.FoundationEnemy when IsMiniWave => SpawnableFaction.ChaosMiniWave,
+ _ => SpawnableFaction.ChaosWave
+ };
+
+ ///
+ /// Gets the maximum amount of people that can spawn in this wave.
+ ///
+ public int MaxAmount => Base.MaxWaveSize;
+
+ ///
+ /// Gets the for this wave.
+ ///
+ /// Wave must implement .
+ public WaveAnnouncementBase Announcement => Base is IAnnouncedWave announcedWave ? announcedWave.Announcement : null;
+
+ ///
+ /// Get the timed waves for the specified faction.
+ ///
+ ///
+ /// The faction to get the waves for.
+ ///
+ ///
+ /// The waves if found.
+ ///
+ ///
+ /// A value indicating whether the wave were found.
+ ///
+ public static bool TryGetTimedWaves(Faction faction, out List waves)
+ {
+ List spawnableWaveBases = WaveManager.Waves.Where(w => w is TimeBasedWave wave && wave.TargetFaction == faction).ToList();
+ if(!spawnableWaveBases.Any())
+ {
+ waves = null;
+ return false;
+ }
+
+ waves = spawnableWaveBases.Select(w => new TimedWave((TimeBasedWave)w)).ToList();
+ return true;
+ }
+
+ ///
+ /// Get the timed waves for the specified faction.
+ ///
+ /// The faction to get the waves for.
+ /// The waves if found.
+ /// A value indicating whether the wave were found.
+ public static bool TryGetTimedWaves(Team team, out List waves)
+ {
+ List spawnableWaveBases = WaveManager.Waves.Where(w => w is TimeBasedWave wave && wave.TargetFaction.GetSpawnableTeam() == team).ToList();
+ if(!spawnableWaveBases.Any())
+ {
+ waves = null;
+ return false;
+ }
+
+ waves = spawnableWaveBases.Select(w => new TimedWave((TimeBasedWave)w)).ToList();
+ return true;
+ }
+
+ ///
+ /// Get the timed wave for the specified type.
+ ///
+ ///
+ /// The wave type to get.
+ ///
+ ///
+ /// The type of wave to get. Must be a . I.e. or .
+ ///
+ ///
+ /// A value indicating whether the wave was found.
+ ///
+ public static bool TryGetTimedWave(out TimedWave wave)
+ where T : TimeBasedWave
+ {
+ foreach (SpawnableWaveBase waveBase in WaveManager.Waves)
+ {
+ if (waveBase is not TimeBasedWave timeWave || timeWave.GetType() != typeof(T))
+ continue;
+
+ wave = new TimedWave(timeWave);
+ return true;
+ }
+
+ wave = null;
+ return false;
+ }
+
+ ///
+ /// Get all timed waves.
+ ///
+ ///
+ /// A list of all timed waves.
+ ///
+ public static List GetTimedWaves()
+ {
+ List waves = new();
+ foreach (SpawnableWaveBase wave in WaveManager.Waves)
+ {
+ if (wave is TimeBasedWave timeBasedWave)
+ {
+ waves.Add(new TimedWave(timeBasedWave));
+ }
+ }
+
+ return waves;
+ }
+
+ ///
+ /// Destroys this wave.
+ ///
+ public void Destroy() => Base.Destroy();
+
+ ///
+ /// Populates this wave with the specified amount of roles.
+ ///
+ ///
+ /// The queue to populate.
+ ///
+ ///
+ /// The amount of people to populate.
+ ///
+ public void PopulateQueue(Queue queue, int amount) => Base.PopulateQueue(queue, amount);
+
+ ///
+ /// Plays the announcement for this wave.
+ ///
+ /// Wave must implement .
+ public void PlayAnnouncement() => Announcement?.PlayAnnouncement();
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Waves/WaveTimer.cs b/EXILED/Exiled.API/Features/Waves/WaveTimer.cs
new file mode 100644
index 000000000..b99f2cf2b
--- /dev/null
+++ b/EXILED/Exiled.API/Features/Waves/WaveTimer.cs
@@ -0,0 +1,193 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.API.Features.Waves
+{
+ using System;
+
+ using System.Collections.Generic;
+
+ using System.Linq;
+
+ using PlayerRoles;
+
+ using Respawning;
+
+ using Respawning.Waves;
+
+ ///
+ /// Represents a wave timer.
+ ///
+ public class WaveTimer
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The that this class should be based off of.
+ public WaveTimer(Respawning.Waves.WaveTimer wave) => Base = wave;
+
+ ///
+ /// Gets the base .
+ ///
+ public Respawning.Waves.WaveTimer Base { get; }
+
+ ///
+ /// Gets the name of the wave timer.
+ ///
+ public string Name => Base._wave.GetType().Name;
+
+ ///
+ /// Gets a value indicating whether the wave is a mini wave.
+ ///
+ public bool IsMiniWave => Base._wave is IMiniWave;
+
+ ///
+ /// Gets the amount of time left before the wave spawns.
+ ///
+ public TimeSpan TimeLeft => TimeSpan.FromSeconds(Base.TimeLeft);
+
+ ///
+ /// Gets the amount of time passed since the last wave spawned.
+ ///
+ public TimeSpan TimePassed => TimeSpan.FromSeconds(Base.TimePassed);
+
+ ///
+ /// Gets the amount of time left before this wave unpause.
+ ///
+ public TimeSpan PauseTimeLeft => TimeSpan.FromSeconds(Base.PauseTimeLeft);
+
+ ///
+ /// Gets the amount of time this wave has been paused for.
+ ///
+ public TimeSpan PausedFor => TimeSpan.FromSeconds(Base._pauseTimer);
+
+ ///
+ /// Gets a value indicating whether this wave is paused.
+ ///
+ public bool IsPaused => Base.IsPaused;
+
+ ///
+ /// Gets a value indicating whether this wave is ready to spawn.
+ ///
+ public bool IsReady => Base.IsReadyToSpawn;
+
+ ///
+ /// Gets a value indicating whether this wave is out of respawns.
+ ///
+ public bool IsRespawnable => !Base.IsOutOfRespawns;
+
+ ///
+ /// Gets the default amount of time between a respawn of this wave.
+ ///
+ public float DefaultSpawnInterval => Base.DefaultSpawnInterval;
+
+ ///
+ /// Gets the actual amount of time between a respawn of this wave.
+ ///
+ public float SpawnInterval => Base.SpawnIntervalSeconds;
+
+ ///
+ /// Get the wave timers for the specified faction.
+ ///
+ /// The faction.
+ /// The waves, if any.
+ /// A bool indicating if waves were found.
+ public static bool TryGetWaveTimers(Faction faction, out List waves)
+ {
+ if (!TimedWave.TryGetTimedWaves(faction, out List timedWaves))
+ {
+ waves = null;
+ return false;
+ }
+
+ waves = timedWaves.Select(wave => wave.Timer).ToList();
+ return true;
+ }
+
+ ///
+ /// Get the wave timers for the specified faction.
+ ///
+ /// The team.
+ /// The waves, if any.
+ /// A bool indicating if waves were found.
+ public static bool TryGetWaveTimers(Team team, out List waves)
+ {
+ if (!TimedWave.TryGetTimedWaves(team, out List timedWaves))
+ {
+ waves = null;
+ return false;
+ }
+
+ waves = timedWaves.Select(wave => wave.Timer).ToList();
+ return true;
+ }
+
+ ///
+ /// Gets all wave timers.
+ ///
+ /// A list of all wave timers.
+ public static List GetWaveTimers()
+ {
+ return TimedWave.GetTimedWaves().Select(l => l.Timer).ToList();
+ }
+
+ ///
+ /// Destroys this wave timer.
+ ///
+ public void Destroy() => Base.Destroy();
+
+ ///
+ /// Pauses this wave timer.
+ ///
+ ///
+ /// The amount of time to pause this wave timer for.
+ ///
+ public void Pause(float seconds) => Base.Pause(seconds);
+
+ ///
+ /// Unpauses this wave timer.
+ ///
+ public void Unpause() => Base.Pause(0);
+
+ ///
+ /// Resets this wave timer.
+ ///
+ ///
+ /// A value indicating whether the should be reset.
+ ///
+ public void Reset(bool resetInterval = true) => Base.Reset(resetInterval);
+
+ ///
+ /// Update the timer.
+ ///
+ public void Update() => Base.Update();
+
+ ///
+ /// Add time to the wave timer.
+ ///
+ ///
+ /// The amount of time to add in seconds.
+ ///
+ public void AddTime(float seconds) => Base.AddTime(seconds);
+
+ ///
+ /// Set the amount of time before the wave spawns.
+ ///
+ ///
+ /// The amount of time before the wave spawns.
+ ///
+ public void SetTime(TimeSpan time) => SetTime((float)time.TotalSeconds);
+
+ ///
+ /// Set the amount of time before the wave spawns.
+ ///
+ ///
+ /// The amount of time before the wave spawns, in seconds.
+ ///
+ public void SetTime(float seconds) => Base.SetTime(seconds);
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Window.cs b/EXILED/Exiled.API/Features/Window.cs
index 63ca362fd..a84767e1e 100644
--- a/EXILED/Exiled.API/Features/Window.cs
+++ b/EXILED/Exiled.API/Features/Window.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -38,9 +38,9 @@ internal Window(BreakableWindow window, Room room)
Base = window;
Room = room;
Type = GetGlassType();
-#if Debug
+#if DEBUG
if (Type is GlassType.Unknown)
- Log.Error($"[GLASSTYPE UNKNOWN] {this}");
+ Log.Error($"[GLASSTYPE UNKNOWN] {this} BASE = {Base}");
#endif
}
@@ -89,12 +89,12 @@ public Vector3 Position
}
///
- /// Gets a value indicating whether or not this window is breakable.
+ /// Gets a value indicating whether this window is breakable.
///
public bool IsBreakable => !Base.isBroken;
///
- /// Gets or sets a value indicating whether or not this window is broken.
+ /// Gets or sets a value indicating whether this window is broken.
///
public bool IsBroken
{
@@ -121,7 +121,7 @@ public Quaternion Rotation
}
///
- /// Gets or sets a value indicating whether or not this window can be broken by SCP.
+ /// Gets or sets a value indicating whether this window can be broken by SCP.
///
public bool DisableScpDamage
{
@@ -130,12 +130,12 @@ public bool DisableScpDamage
}
///
- /// Gets or sets a value indicating whether or not this window is broken.
+ /// Gets or sets a value indicating whether this window is broken.
///
- public BreakableWindow.BreakableWindowStatus SyncStatus
+ public bool SyncStatus
{
- get => Base.NetworksyncStatus;
- set => Base.NetworksyncStatus = value;
+ get => Base.prevStatus;
+ set => Base.prevStatus = value;
}
///
@@ -159,7 +159,7 @@ public static Window Get(BreakableWindow breakableWindow) => BreakableWindowToWi
///
/// Gets a of filtered based on a predicate.
///
- /// The condition to satify.
+ /// The condition to satisfy.
/// A of which contains elements that satify the condition.
public static IEnumerable Get(Func predicate) => List.Where(predicate);
@@ -168,7 +168,7 @@ public static Window Get(BreakableWindow breakableWindow) => BreakableWindowToWi
///
/// The instance.
/// A or if not found.
- /// Whether or not a window was found.
+ /// Whether a window was found.
public static bool TryGet(BreakableWindow breakableWindow, out Window window)
{
window = Get(breakableWindow);
@@ -178,9 +178,9 @@ public static bool TryGet(BreakableWindow breakableWindow, out Window window)
///
/// Try-get a of filtered based on a predicate.
///
- /// The condition to satify.
+ /// The condition to satisfy.
/// A of which contains elements that satify the condition.
- /// Whether or not at least one window was found.
+ /// Whether at least one window was found.
public static bool TryGet(Func predicate, out IEnumerable windows)
{
windows = Get(predicate);
@@ -220,7 +220,7 @@ public void DamageWindow(float amount, DamageHandlerBase handler)
RoomType.LczGlassBox => GlassType.GR18,
RoomType.LczPlants => GlassType.Plants,
RoomType.Hcz049 => GlassType.Scp049,
- RoomType.Hcz079 => Recontainer.Base._activatorGlass == Base ? GlassType.Scp079Trigger : GlassType.Scp079,
+ RoomType.Hcz079 => Base._preventScpDamage ? GlassType.Scp079Trigger : GlassType.Scp079,
RoomType.HczHid => GlassType.MicroHid,
RoomType.HczTestRoom => GlassType.TestRoom,
RoomType.HczEzCheckpointA => GlassType.HczEzCheckpointA,
diff --git a/EXILED/Exiled.API/Interfaces/IConfig.cs b/EXILED/Exiled.API/Interfaces/IConfig.cs
index 629350ef3..b6f550a7d 100644
--- a/EXILED/Exiled.API/Interfaces/IConfig.cs
+++ b/EXILED/Exiled.API/Interfaces/IConfig.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -15,15 +15,15 @@ namespace Exiled.API.Interfaces
public interface IConfig
{
///
- /// Gets or sets a value indicating whether the plugin is enabled or not.
+ /// Gets or sets a value indicating whether the plugin is enabled.
///
- [Description("Whether or not this plugin is enabled.")]
+ [Description("Whether this plugin is enabled.")]
bool IsEnabled { get; set; }
///
- /// Gets or sets a value indicating whether debug messages should be displayed in the console or not.
+ /// Gets or sets a value indicating whether debug messages should be displayed in the console.
///
- [Description("Whether or not debug messages should be shown in the console.")]
+ [Description("Whether debug messages should be shown in the console.")]
bool Debug { get; set; }
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Interfaces/IDamageableDoor.cs b/EXILED/Exiled.API/Interfaces/IDamageableDoor.cs
index 6a4e60ec8..f98eebde9 100644
--- a/EXILED/Exiled.API/Interfaces/IDamageableDoor.cs
+++ b/EXILED/Exiled.API/Interfaces/IDamageableDoor.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -25,12 +25,12 @@ public interface IDamageableDoor
public float MaxHealth { get; set; }
///
- /// Gets or sets a value indicating whether or not door is destroyed.
+ /// Gets or sets a value indicating whether door is destroyed.
///
public bool IsDestroyed { get; set; }
///
- /// Gets a value indicating whether or not this door is breakable.
+ /// Gets a value indicating whether this door is breakable.
///
public bool IsBreakable { get; }
@@ -39,6 +39,11 @@ public interface IDamageableDoor
///
public DoorDamageType IgnoredDamage { get; set; }
+ ///
+ /// Repair the door.
+ ///
+ public void Repair();
+
///
/// Damages the door.
///
diff --git a/EXILED/Exiled.API/Interfaces/INonInteractableDoor.cs b/EXILED/Exiled.API/Interfaces/INonInteractableDoor.cs
index 1f2433d26..eb9ee702d 100644
--- a/EXILED/Exiled.API/Interfaces/INonInteractableDoor.cs
+++ b/EXILED/Exiled.API/Interfaces/INonInteractableDoor.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -13,12 +13,12 @@ namespace Exiled.API.Interfaces
public interface INonInteractableDoor
{
///
- /// Gets or sets a value indicating whether or not door should ignore lockdowns.
+ /// Gets or sets a value indicating whether door should ignore lockdowns.
///
public bool IgnoreLockdowns { get; set; }
///
- /// Gets or sets a value indicating whether or not door should ignore RA requests.
+ /// Gets or sets a value indicating whether door should ignore RA requests.
///
public bool IgnoreRemoteAdmin { get; set; }
}
diff --git a/EXILED/Exiled.API/Interfaces/IPlugin.cs b/EXILED/Exiled.API/Interfaces/IPlugin.cs
index ab7ed01af..ef44c7152 100644
--- a/EXILED/Exiled.API/Interfaces/IPlugin.cs
+++ b/EXILED/Exiled.API/Interfaces/IPlugin.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Interfaces/IPosition.cs b/EXILED/Exiled.API/Interfaces/IPosition.cs
index 0c7ba1340..467495137 100644
--- a/EXILED/Exiled.API/Interfaces/IPosition.cs
+++ b/EXILED/Exiled.API/Interfaces/IPosition.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Interfaces/IRotation.cs b/EXILED/Exiled.API/Interfaces/IRotation.cs
index 41c92484e..f7e244b19 100644
--- a/EXILED/Exiled.API/Interfaces/IRotation.cs
+++ b/EXILED/Exiled.API/Interfaces/IRotation.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Interfaces/ITranslation.cs b/EXILED/Exiled.API/Interfaces/ITranslation.cs
index 35879cae6..76d8f2bd2 100644
--- a/EXILED/Exiled.API/Interfaces/ITranslation.cs
+++ b/EXILED/Exiled.API/Interfaces/ITranslation.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Interfaces/IWorldSpace.cs b/EXILED/Exiled.API/Interfaces/IWorldSpace.cs
index 89511d0d4..0df54e81e 100644
--- a/EXILED/Exiled.API/Interfaces/IWorldSpace.cs
+++ b/EXILED/Exiled.API/Interfaces/IWorldSpace.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Interfaces/IWrapper.cs b/EXILED/Exiled.API/Interfaces/IWrapper.cs
index 2ac5dfa94..c2ee03b01 100644
--- a/EXILED/Exiled.API/Interfaces/IWrapper.cs
+++ b/EXILED/Exiled.API/Interfaces/IWrapper.cs
@@ -1,20 +1,17 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.API.Interfaces
{
- using UnityEngine;
-
///
/// Defines the contract for classes that wrap a base-game object.
///
/// The base-game class that is being wrapped.
public interface IWrapper
- where T : MonoBehaviour
{
///
/// Gets the base that this class is wrapping.
diff --git a/EXILED/Exiled.API/Structs/ArmorAmmoLimit.cs b/EXILED/Exiled.API/Structs/ArmorAmmoLimit.cs
index 86046d71e..c71b1973b 100644
--- a/EXILED/Exiled.API/Structs/ArmorAmmoLimit.cs
+++ b/EXILED/Exiled.API/Structs/ArmorAmmoLimit.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Structs/AttachmentIdentifier.cs b/EXILED/Exiled.API/Structs/AttachmentIdentifier.cs
index f9fbbaf06..cc27b57a0 100644
--- a/EXILED/Exiled.API/Structs/AttachmentIdentifier.cs
+++ b/EXILED/Exiled.API/Structs/AttachmentIdentifier.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.API/Structs/PrimitiveSettings.cs b/EXILED/Exiled.API/Structs/PrimitiveSettings.cs
index 1cb6639fe..24fcc0439 100644
--- a/EXILED/Exiled.API/Structs/PrimitiveSettings.cs
+++ b/EXILED/Exiled.API/Structs/PrimitiveSettings.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -23,8 +23,8 @@ public struct PrimitiveSettings
/// The position of the primitive.
/// The rotation of the primitive.
/// The scale of the primitive.
- /// Whether or not the primitive should be spawned.
- /// Whether or not the primitive should be static.
+ /// Whether the primitive should be spawned.
+ /// Whether the primitive should be static.
public PrimitiveSettings(PrimitiveType primitiveType, Color color, Vector3 position, Vector3 rotation, Vector3 scale, bool spawn, bool isStatic)
{
PrimitiveType = primitiveType;
@@ -45,7 +45,7 @@ public PrimitiveSettings(PrimitiveType primitiveType, Color color, Vector3 posit
/// The position of the primitive.
/// The rotation of the primitive.
/// The scale of the primitive.
- /// Whether or not the primitive should be spawned.
+ /// Whether the primitive should be spawned.
public PrimitiveSettings(PrimitiveType primitiveType, Color color, Vector3 position, Vector3 rotation, Vector3 scale, bool spawn)
{
PrimitiveType = primitiveType;
@@ -67,7 +67,7 @@ public PrimitiveSettings(PrimitiveType primitiveType, Color color, Vector3 posit
/// The position of the primitive.
/// The rotation of the primitive.
/// The scale of the primitive.
- /// Whether or not the primitive should be spawned.
+ /// Whether the primitive should be spawned.
public PrimitiveSettings(PrimitiveType primitiveType, PrimitiveFlags primitiveFlags, Color color, Vector3 position, Vector3 rotation, Vector3 scale, bool spawn)
{
PrimitiveType = primitiveType;
@@ -111,12 +111,12 @@ public PrimitiveSettings(PrimitiveType primitiveType, PrimitiveFlags primitiveFl
public Vector3 Scale { get; }
///
- /// Gets a value indicating whether or not the primitive should be spawned.
+ /// Gets a value indicating whether the primitive should be spawned.
///
public bool IsStatic { get; }
///
- /// Gets a value indicating whether or not the primitive should be spawned.
+ /// Gets a value indicating whether the primitive should be spawned.
///
public bool Spawn { get; }
}
diff --git a/EXILED/Exiled.API/Structs/RadioRangeSettings.cs b/EXILED/Exiled.API/Structs/RadioRangeSettings.cs
index 8063452b3..077216ede 100644
--- a/EXILED/Exiled.API/Structs/RadioRangeSettings.cs
+++ b/EXILED/Exiled.API/Structs/RadioRangeSettings.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CreditTags/Commands/ShowCreditTag.cs b/EXILED/Exiled.CreditTags/Commands/ShowCreditTag.cs
index 20705c25c..fa2e8305e 100644
--- a/EXILED/Exiled.CreditTags/Commands/ShowCreditTag.cs
+++ b/EXILED/Exiled.CreditTags/Commands/ShowCreditTag.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CreditTags/Config.cs b/EXILED/Exiled.CreditTags/Config.cs
index e07d2d90d..5696f3ec9 100644
--- a/EXILED/Exiled.CreditTags/Config.cs
+++ b/EXILED/Exiled.CreditTags/Config.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -30,7 +30,7 @@ public sealed class Config : IConfig
[Description("Overrides Custom Player Info if exists")]
public bool CustomPlayerInfoOverride { get; private set; } = false;
- [Description("Whether or not the plugin should ignore a player's DNT flag. By default (false), players with DNT flag will not be checked for credit tags.")]
+ [Description("Whether the plugin should ignore a player's DNT flag. By default (false), players with DNT flag will not be checked for credit tags.")]
public bool IgnoreDntFlag { get; private set; } = false;
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.CreditTags/CreditTags.cs b/EXILED/Exiled.CreditTags/CreditTags.cs
index d6cef99ab..09ee281b7 100644
--- a/EXILED/Exiled.CreditTags/CreditTags.cs
+++ b/EXILED/Exiled.CreditTags/CreditTags.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CreditTags/Enums/InfoSide.cs b/EXILED/Exiled.CreditTags/Enums/InfoSide.cs
index 98512669c..9d87360d4 100644
--- a/EXILED/Exiled.CreditTags/Enums/InfoSide.cs
+++ b/EXILED/Exiled.CreditTags/Enums/InfoSide.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CreditTags/Enums/RankType.cs b/EXILED/Exiled.CreditTags/Enums/RankType.cs
index 8c6d55d7b..e8d024712 100644
--- a/EXILED/Exiled.CreditTags/Enums/RankType.cs
+++ b/EXILED/Exiled.CreditTags/Enums/RankType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CreditTags/Events/CreditsHandler.cs b/EXILED/Exiled.CreditTags/Events/CreditsHandler.cs
index 1520ead87..06c30e30f 100644
--- a/EXILED/Exiled.CreditTags/Events/CreditsHandler.cs
+++ b/EXILED/Exiled.CreditTags/Events/CreditsHandler.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CreditTags/Exiled.CreditTags.csproj b/EXILED/Exiled.CreditTags/Exiled.CreditTags.csproj
index adc9595c8..9382489fb 100644
--- a/EXILED/Exiled.CreditTags/Exiled.CreditTags.csproj
+++ b/EXILED/Exiled.CreditTags/Exiled.CreditTags.csproj
@@ -43,6 +43,4 @@
if [[ ! -z "$EXILED_DEV_REFERENCES" ]]; then cp "$(OutputPath)$(AssemblyName).dll" "$EXILED_DEV_REFERENCES/Plugins/"; fi
-
-
diff --git a/EXILED/Exiled.CreditTags/Features/DatabaseHandler.cs b/EXILED/Exiled.CreditTags/Features/DatabaseHandler.cs
index e31fe2615..11c6a6c2a 100644
--- a/EXILED/Exiled.CreditTags/Features/DatabaseHandler.cs
+++ b/EXILED/Exiled.CreditTags/Features/DatabaseHandler.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CreditTags/Features/Rank.cs b/EXILED/Exiled.CreditTags/Features/Rank.cs
index 086280b20..23d899079 100644
--- a/EXILED/Exiled.CreditTags/Features/Rank.cs
+++ b/EXILED/Exiled.CreditTags/Features/Rank.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CreditTags/Features/TagItem.cs b/EXILED/Exiled.CreditTags/Features/TagItem.cs
index d58d0f850..da01986a5 100644
--- a/EXILED/Exiled.CreditTags/Features/TagItem.cs
+++ b/EXILED/Exiled.CreditTags/Features/TagItem.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CreditTags/Features/ThreadSafeRequest.cs b/EXILED/Exiled.CreditTags/Features/ThreadSafeRequest.cs
index dbb0b03a0..b6ceaee01 100644
--- a/EXILED/Exiled.CreditTags/Features/ThreadSafeRequest.cs
+++ b/EXILED/Exiled.CreditTags/Features/ThreadSafeRequest.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomItems/API/EventArgs/OwnerChangingRoleEventArgs.cs b/EXILED/Exiled.CustomItems/API/EventArgs/OwnerChangingRoleEventArgs.cs
index bce3caf20..d3be3e4c9 100644
--- a/EXILED/Exiled.CustomItems/API/EventArgs/OwnerChangingRoleEventArgs.cs
+++ b/EXILED/Exiled.CustomItems/API/EventArgs/OwnerChangingRoleEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomItems/API/EventArgs/OwnerDyingEventArgs.cs b/EXILED/Exiled.CustomItems/API/EventArgs/OwnerDyingEventArgs.cs
index bd8a1f1fb..1bc1ace8e 100644
--- a/EXILED/Exiled.CustomItems/API/EventArgs/OwnerDyingEventArgs.cs
+++ b/EXILED/Exiled.CustomItems/API/EventArgs/OwnerDyingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomItems/API/EventArgs/OwnerEscapingEventArgs.cs b/EXILED/Exiled.CustomItems/API/EventArgs/OwnerEscapingEventArgs.cs
index 3c224754e..2fc89ef33 100644
--- a/EXILED/Exiled.CustomItems/API/EventArgs/OwnerEscapingEventArgs.cs
+++ b/EXILED/Exiled.CustomItems/API/EventArgs/OwnerEscapingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -30,20 +30,7 @@ public class OwnerEscapingEventArgs : EscapingEventArgs
///
/// The instance.
public OwnerEscapingEventArgs(Item item, EscapingEventArgs ev)
- : this(item, ev.Player, ev.NewRole, ev.EscapeScenario, ev.RespawnTickets)
- {
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- ///
- ///
- ///
- ///
- public OwnerEscapingEventArgs(Item item, Player player, RoleTypeId newRole, EscapeScenario escapeScenario, KeyValuePair respawnTickets = default)
- : base(player, newRole, escapeScenario, respawnTickets)
+ : base(ev.Player, ev.NewRole, ev.EscapeScenario)
{
Item = item;
}
diff --git a/EXILED/Exiled.CustomItems/API/EventArgs/OwnerHandcuffingEventArgs.cs b/EXILED/Exiled.CustomItems/API/EventArgs/OwnerHandcuffingEventArgs.cs
index 584b9583f..2d9c26d5a 100644
--- a/EXILED/Exiled.CustomItems/API/EventArgs/OwnerHandcuffingEventArgs.cs
+++ b/EXILED/Exiled.CustomItems/API/EventArgs/OwnerHandcuffingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomItems/API/EventArgs/UpgradingEventArgs.cs b/EXILED/Exiled.CustomItems/API/EventArgs/UpgradingEventArgs.cs
index 1bd22ad7a..f416b6cef 100644
--- a/EXILED/Exiled.CustomItems/API/EventArgs/UpgradingEventArgs.cs
+++ b/EXILED/Exiled.CustomItems/API/EventArgs/UpgradingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomItems/API/EventArgs/UpgradingItemEventArgs.cs b/EXILED/Exiled.CustomItems/API/EventArgs/UpgradingItemEventArgs.cs
index b7fa13dd0..398687e79 100644
--- a/EXILED/Exiled.CustomItems/API/EventArgs/UpgradingItemEventArgs.cs
+++ b/EXILED/Exiled.CustomItems/API/EventArgs/UpgradingItemEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomItems/API/Extensions.cs b/EXILED/Exiled.CustomItems/API/Extensions.cs
index 07f6ed2ef..b527a2191 100644
--- a/EXILED/Exiled.CustomItems/API/Extensions.cs
+++ b/EXILED/Exiled.CustomItems/API/Extensions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs b/EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs
index b50954d64..f87d47378 100644
--- a/EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs
+++ b/EXILED/Exiled.CustomItems/API/Features/CustomArmor.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomGrenade.cs b/EXILED/Exiled.CustomItems/API/Features/CustomGrenade.cs
index bb818ad7b..48d725ce7 100644
--- a/EXILED/Exiled.CustomItems/API/Features/CustomGrenade.cs
+++ b/EXILED/Exiled.CustomItems/API/Features/CustomGrenade.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -94,7 +94,7 @@ public virtual Pickup Throw(Vector3 position, float force, float weight, float f
NetworkServer.Spawn(thrownProjectile.gameObject);
thrownProjectile.InfoReceivedHook(default, newInfo);
if (thrownProjectile.TryGetComponent(out Rigidbody component))
- throwable.Base.PropelBody(component, throwable.Base.FullThrowSettings.StartTorque, ThrowableNetworkHandler.GetLimitedVelocity(velocity), force, throwable.Base.FullThrowSettings.UpwardsFactor);
+ throwable.Base.PropelBody(component, throwable.Base.FullThrowSettings.StartTorque, ThrowableNetworkHandler.GetLimitedVelocity(velocity));
thrownProjectile.ServerActivate();
return Pickup.Get(thrownProjectile);
diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomItem.cs b/EXILED/Exiled.CustomItems/API/Features/CustomItem.cs
index c8598a98b..2789f2fd1 100644
--- a/EXILED/Exiled.CustomItems/API/Features/CustomItem.cs
+++ b/EXILED/Exiled.CustomItems/API/Features/CustomItem.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -53,7 +53,6 @@ namespace Exiled.CustomItems.API.Features
///
public abstract class CustomItem
{
- private static Dictionary typeLookupTable = new();
private static Dictionary stringLookupTable = new();
private static Dictionary idLookupTable = new();
@@ -116,24 +115,11 @@ public virtual ItemType Type
public HashSet TrackedSerials { get; } = new();
///
- /// Gets a value indicating whether or not this item causes things to happen that may be considered hacks, and thus be shown to global moderators as being present in a player's inventory when they gban them.
+ /// Gets a value indicating whether this item causes things to happen that may be considered hacks, and thus be shown to global moderators as being present in a player's inventory when they gban them.
///
[YamlIgnore]
public virtual bool ShouldMessageOnGban { get; } = false;
- ///
- /// Gets a with a specific ID.
- ///
- /// The ID.
- /// The matching the search, if not registered.
- [Obsolete("Use Get(uint) instead.", true)]
- public static CustomItem? Get(int id)
- {
- if (!idLookupTable.ContainsKey((uint)id))
- idLookupTable.Add((uint)id, Registered.FirstOrDefault(i => i.Id == id));
- return idLookupTable[(uint)id];
- }
-
///
/// Gets a with a specific ID.
///
@@ -159,23 +145,18 @@ public virtual ItemType Type
}
///
- /// Gets a with a specific type.
+ /// Retrieves a collection of instances that match a specified type.
///
/// The type.
- /// The matching the search, if not registered.
- public static CustomItem? Get(Type t)
- {
- if (!typeLookupTable.ContainsKey(t))
- typeLookupTable.Add(t, Registered.FirstOrDefault(i => i.GetType() == t));
- return typeLookupTable[t];
- }
+ /// An containing all registered of the specified type.
+ public static IEnumerable Get(Type t) => Registered.Where(i => i.GetType() == t);
///
/// Tries to get a with a specific ID.
///
/// The ID to look for.
/// The found , if not registered.
- /// Returns a value indicating whether the was found or not.
+ /// Returns a value indicating whether the was found.
public static bool TryGet(uint id, out CustomItem? customItem)
{
customItem = Get(id);
@@ -188,7 +169,7 @@ public static bool TryGet(uint id, out CustomItem? customItem)
///
/// The name to look for.
/// The found , if not registered.
- /// Returns a value indicating whether the was found or not.
+ /// Returns a value indicating whether the was found.
public static bool TryGet(string name, out CustomItem? customItem)
{
customItem = null;
@@ -201,16 +182,16 @@ public static bool TryGet(string name, out CustomItem? customItem)
}
///
- /// Tries to get a with a specific type.
+ /// Attempts to retrieve a collection of instances of a specified type.
///
/// The of the item to look for.
- /// The found , if not registered.
- /// Returns a value indicating whether the was found or not.
- public static bool TryGet(Type t, out CustomItem? customItem)
+ /// An output parameter that will contain the found instances, or an empty collection if none are registered.
+ /// A boolean value indicating whether any instances of the specified type were found.
+ public static bool TryGet(Type t, out IEnumerable customItems)
{
- customItem = Get(t);
+ customItems = Get(t);
- return customItem is not null;
+ return customItems.Any();
}
///
@@ -279,7 +260,7 @@ public static bool TryGet(Pickup pickup, out CustomItem? customItem)
/// The ID of the to spawn.
/// The location to spawn the item.
/// The instance of the .
- /// Returns a value indicating whether the was spawned or not.
+ /// Returns a value indicating whether the was spawned.
public static bool TrySpawn(uint id, Vector3 position, out Pickup? pickup)
{
pickup = default;
@@ -298,7 +279,7 @@ public static bool TrySpawn(uint id, Vector3 position, out Pickup? pickup)
/// The name of the to spawn.
/// The location to spawn the item.
/// The instance of the .
- /// Returns a value indicating whether the was spawned or not.
+ /// Returns a value indicating whether the was spawned.
public static bool TrySpawn(string name, Vector3 position, out Pickup? pickup)
{
pickup = default;
@@ -345,27 +326,10 @@ public static bool TryGive(Player player, uint id, bool displayMessage = true)
return true;
}
- ///
- /// Gives to a specific a specic .
- ///
- /// The to give the item to.
- /// The of the item to give.
- /// Indicates a value whether will be called when the player receives the or not.
- /// Returns a value indicating if the player was given the or not.
- public static bool TryGive(Player player, Type t, bool displayMessage = true)
- {
- if (!TryGet(t, out CustomItem? item))
- return false;
-
- item?.Give(player, displayMessage);
-
- return true;
- }
-
///
/// Registers all the 's present in the current assembly.
///
- /// Whether or not reflection is skipped (more efficient if you are not using your custom item classes as config objects).
+ /// Whether reflection is skipped (more efficient if you are not using your custom item classes as config objects).
/// The class to search properties for, if different from the plugin's config class.
/// A of which contains all registered 's.
public static IEnumerable RegisterItems(bool skipReflection = false, object? overrideClass = null)
@@ -444,7 +408,7 @@ public static IEnumerable RegisterItems(bool skipReflection = false,
///
/// The of containing the target types.
/// A value indicating whether the target types should be ignored.
- /// Whether or not reflection is skipped (more efficient if you are not using your custom item classes as config objects).
+ /// Whether reflection is skipped (more efficient if you are not using your custom item classes as config objects).
/// The class to search properties for, if different from the plugin's config class.
/// A of which contains all registered 's.
public static IEnumerable RegisterItems(IEnumerable targetTypes, bool isIgnored = false, bool skipReflection = false, object? overrideClass = null)
@@ -619,20 +583,17 @@ public virtual uint Spawn(IEnumerable spawnPoints, uint limit)
spawned++;
-#pragma warning disable CS0618 // Type or member is obsolete \\ TODO: REMOVE THIS
- if (spawnPoint is DynamicSpawnPoint dynamicSpawnPoint && dynamicSpawnPoint.Location == SpawnLocationType.InsideLocker)
+ /*if (spawnPoint is DynamicSpawnPoint dynamicSpawnPoint && dynamicSpawnPoint.Location == SpawnLocationType.InsideLocker)
{
for (int i = 0; i < 50; i++)
{
- if (Map.Lockers is null)
+ if (Exiled.API.Features.Lockers.Locker.List is null)
{
Log.Debug($"{nameof(Spawn)}: Locker list is null.");
continue;
}
- Locker locker =
- Map.Lockers[
- Loader.Random.Next(Map.Lockers.Count)];
+ Locker locker = Exiled.API.Features.Lockers.Locker.Random();
if (locker is null)
{
@@ -683,8 +644,20 @@ public virtual uint Spawn(IEnumerable spawnPoints, uint limit)
}
Log.Debug($"Spawned {Name} at {spawnPoint.Position} ({spawnPoint.Name})");
+ }*/
+
+ Pickup? pickup = Spawn(spawnPoint.Position);
+
+ if (pickup == null)
+ continue;
+
+ if (spawnPoint is LockerSpawnPoint)
+ pickup.IsLocked = true;
+
+ if (pickup.Is(out Exiled.API.Features.Pickups.FirearmPickup firearmPickup) && this is CustomWeapon customWeapon)
+ {
+ // set MaxAmmo if synced TODO
}
-#pragma warning restore CS0618 // Type or member is obsolete
}
return spawned;
@@ -720,7 +693,7 @@ public virtual void SpawnAll()
///
/// The who will receive the item.
/// The to be given.
- /// Indicates whether or not will be called when the player receives the item.
+ /// Indicates whether will be called when the player receives the item.
public virtual void Give(Player player, Item item, bool displayMessage = true)
{
try
@@ -746,14 +719,14 @@ public virtual void Give(Player player, Item item, bool displayMessage = true)
///
/// The who will receive the item.
/// The to be given.
- /// Indicates whether or not will be called when the player receives the item.
+ /// Indicates whether will be called when the player receives the item.
public virtual void Give(Player player, Pickup pickup, bool displayMessage = true) => Give(player, player.AddItem(pickup), displayMessage);
///
/// Gives the to a player.
///
/// The who will receive the item.
- /// Indicates whether or not will be called when the player receives the item.
+ /// Indicates whether will be called when the player receives the item.
public virtual void Give(Player player, bool displayMessage = true) => Give(player, Item.Create(Type), displayMessage);
///
@@ -761,7 +734,6 @@ public virtual void Give(Player player, Item item, bool displayMessage = true)
///
public virtual void Init()
{
- typeLookupTable.Add(GetType(), this);
stringLookupTable.Add(Name, this);
idLookupTable.Add(Id, this);
@@ -775,7 +747,6 @@ public virtual void Destroy()
{
UnsubscribeEvents();
- typeLookupTable.Remove(GetType());
stringLookupTable.Remove(Name);
idLookupTable.Remove(Id);
}
@@ -807,7 +778,7 @@ public virtual void Destroy()
///
/// Registers a .
///
- /// Returns a value indicating whether the was registered or not.
+ /// Returns a value indicating whether the was registered.
internal bool TryRegister()
{
if (!Instance?.Config.IsEnabled ?? false)
@@ -842,7 +813,7 @@ internal bool TryRegister()
///
/// Tries to unregister a .
///
- /// Returns a value indicating whether the was unregistered or not.
+ /// Returns a value indicating whether the was unregistered.
internal bool TryUnregister()
{
Destroy();
@@ -965,7 +936,7 @@ protected virtual void OnUpgrading(UpgradingItemEventArgs ev)
///
/// The acquiring the item.
/// The being acquired.
- /// Whether or not the Pickup hint should be displayed.
+ /// Whether the Pickup hint should be displayed.
protected virtual void OnAcquired(Player player, Item item, bool displayMessage)
{
if (displayMessage)
@@ -1002,7 +973,7 @@ protected virtual void ShowSelectedMessage(Player player)
private void OnInternalOwnerChangingRole(ChangingRoleEventArgs ev)
{
- if (ev.Reason == SpawnReason.Escaped)
+ if (ev.Reason is SpawnReason.Escaped or SpawnReason.Destroyed)
return;
foreach (Item item in ev.Player.Items.ToList())
diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs b/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs
index 6b051a761..728a81d31 100644
--- a/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs
+++ b/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -60,7 +60,7 @@ public override ItemType Type
public virtual byte ClipSize { get; set; }
///
- /// Gets or sets a value indicating whether or not to allow friendly fire with this weapon on FF-enabled servers.
+ /// Gets or sets a value indicating whether to allow friendly fire with this weapon on FF-enabled servers.
///
public virtual bool FriendlyFire { get; set; }
@@ -104,7 +104,7 @@ public override ItemType Type
if (!Attachments.IsEmpty())
firearm.AddAttachment(Attachments);
- byte ammo = firearm.Ammo;
+ int ammo = firearm.Ammo;
firearm.MaxAmmo = ClipSize;
Log.Debug($"{nameof(Name)}.{nameof(Spawn)}: Spawning weapon with {ammo} ammo.");
Pickup? pickup = firearm.CreatePickup(position);
@@ -214,7 +214,7 @@ private void OnInternalReloading(ReloadingWeaponEventArgs ev)
Log.Debug($"{nameof(Name)}.{nameof(OnInternalReloading)}: Continuing with internal reload..");
ev.IsAllowed = false;
- byte remainingClip = ((Firearm)ev.Player.CurrentItem).Ammo;
+ int remainingClip = ((Firearm)ev.Player.CurrentItem).Ammo;
if (remainingClip >= ClipSize)
return;
@@ -229,7 +229,7 @@ private void OnInternalReloading(ReloadingWeaponEventArgs ev)
return;
}
- ev.Player.Connection.Send(new RequestMessage(ev.Firearm.Serial, RequestType.Reload));
+ ev.Firearm.Reload(true);
byte amountToReload = (byte)Math.Min(ClipSize - remainingClip, ev.Player.Ammo[ammoType.GetItemType()]);
diff --git a/EXILED/Exiled.CustomItems/Commands/Give.cs b/EXILED/Exiled.CustomItems/Commands/Give.cs
index cf228ca56..cc63ed222 100644
--- a/EXILED/Exiled.CustomItems/Commands/Give.cs
+++ b/EXILED/Exiled.CustomItems/Commands/Give.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -18,6 +18,8 @@ namespace Exiled.CustomItems.Commands
using Exiled.Permissions.Extensions;
using RemoteAdmin;
+ using UnityStandardAssets.Effects;
+ using Utils;
///
/// The command to give a player an item.
@@ -97,22 +99,27 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s
response = $"Custom item {item?.Name} given to all players who can receive them ({eligiblePlayers.Count} players)";
return true;
default:
- if (Player.Get(identifier) is not { } player)
- {
- response = $"Unable to find player: {identifier}.";
- return false;
- }
+ break;
+ }
- if (!CheckEligible(player))
- {
- response = "Player cannot receive custom items!";
- return false;
- }
+ IEnumerable list = Player.GetProcessedData(arguments, 1);
+
+ if (list.IsEmpty())
+ {
+ response = "Cannot find player! Try using the player ID!";
+ return false;
+ }
+ foreach (Player player in list)
+ {
+ if (CheckEligible(player))
+ {
item?.Give(player);
- response = $"{item?.Name} given to {player.Nickname} ({player.UserId})";
- return true;
+ }
}
+
+ response = $"{item?.Name} given to {list.Count()} players!";
+ return true;
}
///
@@ -120,4 +127,4 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s
///
private bool CheckEligible(Player player) => player.IsAlive && !player.IsCuffed && (player.Items.Count < 8);
}
-}
\ No newline at end of file
+}
diff --git a/EXILED/Exiled.CustomItems/Commands/Info.cs b/EXILED/Exiled.CustomItems/Commands/Info.cs
index 0b6c6e549..bc48698b3 100644
--- a/EXILED/Exiled.CustomItems/Commands/Info.cs
+++ b/EXILED/Exiled.CustomItems/Commands/Info.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomItems/Commands/List/List.cs b/EXILED/Exiled.CustomItems/Commands/List/List.cs
index 98f3e2d12..d564d9649 100644
--- a/EXILED/Exiled.CustomItems/Commands/List/List.cs
+++ b/EXILED/Exiled.CustomItems/Commands/List/List.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomItems/Commands/List/Registered.cs b/EXILED/Exiled.CustomItems/Commands/List/Registered.cs
index d10bc0f0e..70ffe5e26 100644
--- a/EXILED/Exiled.CustomItems/Commands/List/Registered.cs
+++ b/EXILED/Exiled.CustomItems/Commands/List/Registered.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomItems/Commands/List/Tracked.cs b/EXILED/Exiled.CustomItems/Commands/List/Tracked.cs
index ed826f463..c04e50fe6 100644
--- a/EXILED/Exiled.CustomItems/Commands/List/Tracked.cs
+++ b/EXILED/Exiled.CustomItems/Commands/List/Tracked.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomItems/Commands/Main.cs b/EXILED/Exiled.CustomItems/Commands/Main.cs
index 46c9573d4..7aba0b036 100644
--- a/EXILED/Exiled.CustomItems/Commands/Main.cs
+++ b/EXILED/Exiled.CustomItems/Commands/Main.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomItems/Commands/Spawn.cs b/EXILED/Exiled.CustomItems/Commands/Spawn.cs
index 99f438e43..a66158403 100644
--- a/EXILED/Exiled.CustomItems/Commands/Spawn.cs
+++ b/EXILED/Exiled.CustomItems/Commands/Spawn.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomItems/Config.cs b/EXILED/Exiled.CustomItems/Config.cs
index ffb59c274..ffe22066d 100644
--- a/EXILED/Exiled.CustomItems/Config.cs
+++ b/EXILED/Exiled.CustomItems/Config.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -19,7 +19,7 @@ namespace Exiled.CustomItems
public class Config : IConfig
{
///
- [Description("Indicates whether this plugin is enabled or not.")]
+ [Description("Indicates whether this plugin is enabled.")]
public bool IsEnabled { get; set; } = true;
///
diff --git a/EXILED/Exiled.CustomItems/CustomItems.cs b/EXILED/Exiled.CustomItems/CustomItems.cs
index 207f55b6f..adac9294a 100644
--- a/EXILED/Exiled.CustomItems/CustomItems.cs
+++ b/EXILED/Exiled.CustomItems/CustomItems.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomItems/Events/MapHandler.cs b/EXILED/Exiled.CustomItems/Events/MapHandler.cs
index 61993e03c..ed1ae6197 100644
--- a/EXILED/Exiled.CustomItems/Events/MapHandler.cs
+++ b/EXILED/Exiled.CustomItems/Events/MapHandler.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomItems/Events/PlayerHandler.cs b/EXILED/Exiled.CustomItems/Events/PlayerHandler.cs
index 397a90ddc..d8ded3078 100644
--- a/EXILED/Exiled.CustomItems/Events/PlayerHandler.cs
+++ b/EXILED/Exiled.CustomItems/Events/PlayerHandler.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomItems/Patches/PlayerInventorySee.cs b/EXILED/Exiled.CustomItems/Patches/PlayerInventorySee.cs
index 1620477ba..8efcc98fb 100644
--- a/EXILED/Exiled.CustomItems/Patches/PlayerInventorySee.cs
+++ b/EXILED/Exiled.CustomItems/Patches/PlayerInventorySee.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/API/Extensions.cs b/EXILED/Exiled.CustomRoles/API/Extensions.cs
index 7d8379f28..a2d6bb25f 100644
--- a/EXILED/Exiled.CustomRoles/API/Extensions.cs
+++ b/EXILED/Exiled.CustomRoles/API/Extensions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/API/Features/ActiveAbility.cs b/EXILED/Exiled.CustomRoles/API/Features/ActiveAbility.cs
index 929295615..cadc7c63f 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/ActiveAbility.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/ActiveAbility.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -227,14 +227,6 @@ protected virtual void AbilityEnded(Player player)
{
}
- ///
- /// Called when the ability is successfully used.
- ///
- /// The using the ability.
- [Obsolete("The Keypress Activator will already do this, you do not need to call this unless you are overwriting the keypress activator.", true)]
- protected virtual void ShowMessage(Player player) =>
- player.ShowHint(string.Format(CustomRoles.Instance!.Config.UsedAbilityHint.Content, Name, Description), CustomRoles.Instance.Config.UsedAbilityHint.Duration);
-
///
/// Called when the ability is selected.
///
diff --git a/EXILED/Exiled.CustomRoles/API/Features/CustomAbility.cs b/EXILED/Exiled.CustomRoles/API/Features/CustomAbility.cs
index d076f7b38..e39f4bf3d 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/CustomAbility.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/CustomAbility.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -106,7 +106,7 @@ public static bool TryGet(string name, out CustomAbility? customAbility)
///
/// Registers all the 's present in the current assembly.
///
- /// Whether or not reflection is skipped (more efficient if you are not using your custom item classes as config objects).
+ /// Whether reflection is skipped (more efficient if you are not using your custom item classes as config objects).
/// The class to search properties for, if different from the plugin's config class.
/// A of which contains all registered 's.
public static IEnumerable RegisterAbilities(bool skipReflection = false, object? overrideClass = null)
@@ -150,7 +150,7 @@ public static IEnumerable RegisterAbilities(bool skipReflection =
///
/// The of containing the target types.
/// A value indicating whether the target types should be ignored.
- /// Whether or not reflection is skipped (more efficient if you are not using your custom item classes as config objects).
+ /// Whether reflection is skipped (more efficient if you are not using your custom item classes as config objects).
/// The class to search properties for, if different from the plugin's config class.
/// A of which contains all registered 's.
public static IEnumerable RegisterAbilities(IEnumerable targetTypes, bool isIgnored = false, bool skipReflection = false, object? overrideClass = null)
diff --git a/EXILED/Exiled.CustomRoles/API/Features/CustomRole.cs b/EXILED/Exiled.CustomRoles/API/Features/CustomRole.cs
index 43c1b5172..b8217fb41 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/CustomRole.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/CustomRole.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -131,7 +131,7 @@ public abstract class CustomRole
public virtual float SpawnChance { get; set; }
///
- /// Gets or sets a value indicating whether the spawn system is ignored for this role or not.
+ /// Gets or sets a value indicating whether the spawn system is ignored for this role.
///
public virtual bool IgnoreSpawnSystem { get; set; }
@@ -274,7 +274,7 @@ public static bool TryGet(Player player, out IReadOnlyCollection cus
///
/// Registers all the 's present in the current assembly.
///
- /// Whether or not reflection is skipped (more efficient if you are not using your custom item classes as config objects).
+ /// Whether reflection is skipped (more efficient if you are not using your custom item classes as config objects).
/// The class to search properties for, if different from the plugin's config class.
/// A of which contains all registered 's.
public static IEnumerable RegisterRoles(bool skipReflection = false, object? overrideClass = null) => RegisterRoles(skipReflection, overrideClass, true, Assembly.GetCallingAssembly());
@@ -282,9 +282,9 @@ public static bool TryGet(Player player, out IReadOnlyCollection cus
///
/// Registers all the 's present in the current assembly.
///
- /// Whether or not reflection is skipped (more efficient if you are not using your custom item classes as config objects).
+ /// Whether reflection is skipped (more efficient if you are not using your custom item classes as config objects).
/// The class to search properties for, if different from the plugin's config class.
- /// Whether or not inherited attributes should be taken into account for registration.
+ /// Whether inherited attributes should be taken into account for registration.
/// Assembly which is calling this method.
/// A of which contains all registered 's.
public static IEnumerable RegisterRoles(bool skipReflection = false, object? overrideClass = null, bool inheritAttributes = true, Assembly? assembly = null)
@@ -338,7 +338,7 @@ public static IEnumerable RegisterRoles(bool skipReflection = false,
///
/// The of containing the target types.
/// A value indicating whether the target types should be ignored.
- /// Whether or not reflection is skipped (more efficient if you are not using your custom item classes as config objects).
+ /// Whether reflection is skipped (more efficient if you are not using your custom item classes as config objects).
/// The class to search properties for, if different from the plugin's config class.
/// A of which contains all registered 's.
public static IEnumerable RegisterRoles(IEnumerable targetTypes, bool isIgnored = false, bool skipReflection = false, object? overrideClass = null)
@@ -776,7 +776,7 @@ internal bool TryUnregister()
///
/// The to try giving the item to.
/// The name of the item to try adding.
- /// Whether or not the item was able to be added.
+ /// Whether the item was able to be added.
protected bool TryAddItem(Player player, string itemName)
{
if (CustomItem.TryGet(itemName, out CustomItem? customItem))
@@ -926,6 +926,9 @@ private void OnInternalSpawning(SpawningEventArgs ev)
private void OnInternalChangingRole(ChangingRoleEventArgs ev)
{
+ if(ev.Reason == SpawnReason.Destroyed)
+ return;
+
if (Check(ev.Player) && ((ev.NewRole == RoleTypeId.Spectator && !KeepRoleOnDeath) || (ev.NewRole != RoleTypeId.Spectator && ev.NewRole != Role && !KeepRoleOnChangingRole)))
{
RemoveRole(ev.Player);
diff --git a/EXILED/Exiled.CustomRoles/API/Features/Enums/CheckType.cs b/EXILED/Exiled.CustomRoles/API/Features/Enums/CheckType.cs
index bbf59087e..fb636665a 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/Enums/CheckType.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/Enums/CheckType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/API/Features/Enums/KeypressActivationType.cs b/EXILED/Exiled.CustomRoles/API/Features/Enums/KeypressActivationType.cs
index da9708f63..d63845ff7 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/Enums/KeypressActivationType.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/Enums/KeypressActivationType.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/API/Features/Extensions/ParserExtension.cs b/EXILED/Exiled.CustomRoles/API/Features/Extensions/ParserExtension.cs
index 62b89a9f0..49463b8e8 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/Extensions/ParserExtension.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/Extensions/ParserExtension.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/API/Features/Interfaces/ITypeDiscriminator.cs b/EXILED/Exiled.CustomRoles/API/Features/Interfaces/ITypeDiscriminator.cs
index 57c2c9de5..aa4f415b3 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/Interfaces/ITypeDiscriminator.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/Interfaces/ITypeDiscriminator.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/API/Features/KeypressActivator.cs b/EXILED/Exiled.CustomRoles/API/Features/KeypressActivator.cs
index 28a557195..4e94c1dba 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/KeypressActivator.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/KeypressActivator.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/API/Features/Parsers/AbstractClassNodeTypeResolver.cs b/EXILED/Exiled.CustomRoles/API/Features/Parsers/AbstractClassNodeTypeResolver.cs
index 5a5f78dae..2a9ff722d 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/Parsers/AbstractClassNodeTypeResolver.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/Parsers/AbstractClassNodeTypeResolver.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/API/Features/Parsers/AggregateExpectationTypeResolver.cs b/EXILED/Exiled.CustomRoles/API/Features/Parsers/AggregateExpectationTypeResolver.cs
index 2ad9b4588..abf9f24f2 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/Parsers/AggregateExpectationTypeResolver.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/Parsers/AggregateExpectationTypeResolver.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/API/Features/Parsers/ParsingEventBuffer.cs b/EXILED/Exiled.CustomRoles/API/Features/Parsers/ParsingEventBuffer.cs
index e5f4ecfb9..9b7c9e113 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/Parsers/ParsingEventBuffer.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/Parsers/ParsingEventBuffer.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/API/Features/PassiveAbility.cs b/EXILED/Exiled.CustomRoles/API/Features/PassiveAbility.cs
index 4fa0671eb..8dbe7f5dc 100644
--- a/EXILED/Exiled.CustomRoles/API/Features/PassiveAbility.cs
+++ b/EXILED/Exiled.CustomRoles/API/Features/PassiveAbility.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/Commands/Give.cs b/EXILED/Exiled.CustomRoles/Commands/Give.cs
index f69ab08ad..4eb357feb 100644
--- a/EXILED/Exiled.CustomRoles/Commands/Give.cs
+++ b/EXILED/Exiled.CustomRoles/Commands/Give.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -19,6 +19,7 @@ namespace Exiled.CustomRoles.Commands
using Exiled.Permissions.Extensions;
using RemoteAdmin;
+ using Utils;
///
/// The command to give a role to player(s).
@@ -96,16 +97,24 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s
ListPool.Pool.Return(players);
return true;
default:
- if (Player.Get(identifier) is not Player ply)
- {
- response = $"Unable to find a player: {identifier}";
- return false;
- }
-
- role.AddRole(ply);
- response = $"{role.Name} given to {ply.Nickname}.";
- return true;
+ break;
+ }
+
+ IEnumerable list = Player.GetProcessedData(arguments, 1);
+ if (list.IsEmpty())
+ {
+ response = "Cannot find player! Try using the player ID!";
+ return false;
}
+
+ foreach (Player player in list)
+ {
+ role.AddRole(player);
+ }
+
+ response = $"Customrole {role.Name} given to {list.Count()} players!";
+
+ return true;
}
catch (Exception e)
{
diff --git a/EXILED/Exiled.CustomRoles/Commands/Info.cs b/EXILED/Exiled.CustomRoles/Commands/Info.cs
index c0e00b38a..a4fc7938c 100644
--- a/EXILED/Exiled.CustomRoles/Commands/Info.cs
+++ b/EXILED/Exiled.CustomRoles/Commands/Info.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/Commands/List/Abilities.cs b/EXILED/Exiled.CustomRoles/Commands/List/Abilities.cs
index 6cf5e8490..8fd1e9cd6 100644
--- a/EXILED/Exiled.CustomRoles/Commands/List/Abilities.cs
+++ b/EXILED/Exiled.CustomRoles/Commands/List/Abilities.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/Commands/List/List.cs b/EXILED/Exiled.CustomRoles/Commands/List/List.cs
index 661cecb49..5e706b53f 100644
--- a/EXILED/Exiled.CustomRoles/Commands/List/List.cs
+++ b/EXILED/Exiled.CustomRoles/Commands/List/List.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/Commands/List/Registered.cs b/EXILED/Exiled.CustomRoles/Commands/List/Registered.cs
index e3f6bd39a..98ba945a6 100644
--- a/EXILED/Exiled.CustomRoles/Commands/List/Registered.cs
+++ b/EXILED/Exiled.CustomRoles/Commands/List/Registered.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/Commands/Parent.cs b/EXILED/Exiled.CustomRoles/Commands/Parent.cs
index 7a9b402ac..f64facabe 100644
--- a/EXILED/Exiled.CustomRoles/Commands/Parent.cs
+++ b/EXILED/Exiled.CustomRoles/Commands/Parent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/Commands/UseAbility.cs b/EXILED/Exiled.CustomRoles/Commands/UseAbility.cs
index c43e2f396..10accb287 100644
--- a/EXILED/Exiled.CustomRoles/Commands/UseAbility.cs
+++ b/EXILED/Exiled.CustomRoles/Commands/UseAbility.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/Config.cs b/EXILED/Exiled.CustomRoles/Config.cs
index d6d48d5ed..3ce80a2c8 100644
--- a/EXILED/Exiled.CustomRoles/Config.cs
+++ b/EXILED/Exiled.CustomRoles/Config.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -19,14 +19,14 @@ namespace Exiled.CustomRoles
public class Config : IConfig
{
///
- [Description("Whether or not the plugin is enabled.")]
+ [Description("Whether the plugin is enabled.")]
public bool IsEnabled { get; set; } = true;
///
/// Gets or sets a value indicating whether debug messages should be printed to the console.
///
/// .
- [Description("Whether or not debug messages should be shown.")]
+ [Description("Whether debug messages should be shown.")]
public bool Debug { get; set; } = false;
///
@@ -44,13 +44,13 @@ public class Config : IConfig
///
/// Gets or sets a value indicating whether keypress ability activations can be used on the server.
///
- [Description("Whether or not Keypress ability activations will work on the server.")]
+ [Description("Whether Keypress ability activations will work on the server.")]
public bool UseKeypressActivation { get; set; } = true;
///
/// Gets or sets a value indicating whether abilities that are not the keypress primary can still be activated.
///
- [Description("Whether or not abilities that are not selected as the current keypress ability can still be activated.")]
+ [Description("Whether abilities that are not selected as the current keypress ability can still be activated.")]
public bool ActivateOnlySelected { get; set; } = true;
///
diff --git a/EXILED/Exiled.CustomRoles/CustomRoles.cs b/EXILED/Exiled.CustomRoles/CustomRoles.cs
index 1da6aefba..4ea4c77f1 100644
--- a/EXILED/Exiled.CustomRoles/CustomRoles.cs
+++ b/EXILED/Exiled.CustomRoles/CustomRoles.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.CustomRoles/Events/PlayerHandlers.cs b/EXILED/Exiled.CustomRoles/Events/PlayerHandlers.cs
index 08377a43a..b53556f00 100644
--- a/EXILED/Exiled.CustomRoles/Events/PlayerHandlers.cs
+++ b/EXILED/Exiled.CustomRoles/Events/PlayerHandlers.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Attributes/EventPatchAttribute.cs b/EXILED/Exiled.Events/Attributes/EventPatchAttribute.cs
index 0dae92502..fbcb0d52c 100644
--- a/EXILED/Exiled.Events/Attributes/EventPatchAttribute.cs
+++ b/EXILED/Exiled.Events/Attributes/EventPatchAttribute.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/Config/EConfig.cs b/EXILED/Exiled.Events/Commands/Config/EConfig.cs
index 6b6ead4b6..6d4882873 100644
--- a/EXILED/Exiled.Events/Commands/Config/EConfig.cs
+++ b/EXILED/Exiled.Events/Commands/Config/EConfig.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/Config/Merge.cs b/EXILED/Exiled.Events/Commands/Config/Merge.cs
index 7bad3a00e..b9916ede6 100644
--- a/EXILED/Exiled.Events/Commands/Config/Merge.cs
+++ b/EXILED/Exiled.Events/Commands/Config/Merge.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/Config/Split.cs b/EXILED/Exiled.Events/Commands/Config/Split.cs
index ad42f3024..9fad9c3e1 100644
--- a/EXILED/Exiled.Events/Commands/Config/Split.cs
+++ b/EXILED/Exiled.Events/Commands/Config/Split.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/Hub/Hub.cs b/EXILED/Exiled.Events/Commands/Hub/Hub.cs
index ba36480fa..5df93df48 100644
--- a/EXILED/Exiled.Events/Commands/Hub/Hub.cs
+++ b/EXILED/Exiled.Events/Commands/Hub/Hub.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/Hub/HubApi/ApiProvider.cs b/EXILED/Exiled.Events/Commands/Hub/HubApi/ApiProvider.cs
index ad2f59223..873346830 100644
--- a/EXILED/Exiled.Events/Commands/Hub/HubApi/ApiProvider.cs
+++ b/EXILED/Exiled.Events/Commands/Hub/HubApi/ApiProvider.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/Hub/HubApi/Models/HubPlugin.cs b/EXILED/Exiled.Events/Commands/Hub/HubApi/Models/HubPlugin.cs
index cac15a689..7d0a7b8f0 100644
--- a/EXILED/Exiled.Events/Commands/Hub/HubApi/Models/HubPlugin.cs
+++ b/EXILED/Exiled.Events/Commands/Hub/HubApi/Models/HubPlugin.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/Hub/Install.cs b/EXILED/Exiled.Events/Commands/Hub/Install.cs
index b1d7e7e10..323a23010 100644
--- a/EXILED/Exiled.Events/Commands/Hub/Install.cs
+++ b/EXILED/Exiled.Events/Commands/Hub/Install.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/PluginManager/Disable.cs b/EXILED/Exiled.Events/Commands/PluginManager/Disable.cs
index 81d3bdffd..4169b84cd 100644
--- a/EXILED/Exiled.Events/Commands/PluginManager/Disable.cs
+++ b/EXILED/Exiled.Events/Commands/PluginManager/Disable.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/PluginManager/Enable.cs b/EXILED/Exiled.Events/Commands/PluginManager/Enable.cs
index 4e400fe81..36b6aa1ec 100644
--- a/EXILED/Exiled.Events/Commands/PluginManager/Enable.cs
+++ b/EXILED/Exiled.Events/Commands/PluginManager/Enable.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/PluginManager/Patches.cs b/EXILED/Exiled.Events/Commands/PluginManager/Patches.cs
index 61d729f82..6d5651e30 100644
--- a/EXILED/Exiled.Events/Commands/PluginManager/Patches.cs
+++ b/EXILED/Exiled.Events/Commands/PluginManager/Patches.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -38,7 +38,7 @@ public sealed class Patches : ICommand
public string[] Aliases { get; } = { "patched" };
///
- public string Description { get; } = "Returns information about all patches (whether they are patched or not)";
+ public string Description { get; } = "Returns information about all patches (whether they are patched)";
///
public bool Execute(ArraySegment arguments, ICommandSender sender, out string response)
diff --git a/EXILED/Exiled.Events/Commands/PluginManager/PluginManager.cs b/EXILED/Exiled.Events/Commands/PluginManager/PluginManager.cs
index 2a4a550b4..1f9a62c13 100644
--- a/EXILED/Exiled.Events/Commands/PluginManager/PluginManager.cs
+++ b/EXILED/Exiled.Events/Commands/PluginManager/PluginManager.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/PluginManager/Show.cs b/EXILED/Exiled.Events/Commands/PluginManager/Show.cs
index cd7379932..0b9f4d545 100644
--- a/EXILED/Exiled.Events/Commands/PluginManager/Show.cs
+++ b/EXILED/Exiled.Events/Commands/PluginManager/Show.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/Reload/All.cs b/EXILED/Exiled.Events/Commands/Reload/All.cs
index a46af1f5e..55c791c0c 100644
--- a/EXILED/Exiled.Events/Commands/Reload/All.cs
+++ b/EXILED/Exiled.Events/Commands/Reload/All.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/Reload/Configs.cs b/EXILED/Exiled.Events/Commands/Reload/Configs.cs
index 2c6ed0a27..05f75a07e 100644
--- a/EXILED/Exiled.Events/Commands/Reload/Configs.cs
+++ b/EXILED/Exiled.Events/Commands/Reload/Configs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/Reload/GamePlay.cs b/EXILED/Exiled.Events/Commands/Reload/GamePlay.cs
index 02a02460a..780689bc7 100644
--- a/EXILED/Exiled.Events/Commands/Reload/GamePlay.cs
+++ b/EXILED/Exiled.Events/Commands/Reload/GamePlay.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/Reload/Permissions.cs b/EXILED/Exiled.Events/Commands/Reload/Permissions.cs
index a0e9b9ec4..ae8bd4c16 100644
--- a/EXILED/Exiled.Events/Commands/Reload/Permissions.cs
+++ b/EXILED/Exiled.Events/Commands/Reload/Permissions.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/Reload/Plugins.cs b/EXILED/Exiled.Events/Commands/Reload/Plugins.cs
index f41d6027c..b10e46de7 100644
--- a/EXILED/Exiled.Events/Commands/Reload/Plugins.cs
+++ b/EXILED/Exiled.Events/Commands/Reload/Plugins.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/Reload/Reload.cs b/EXILED/Exiled.Events/Commands/Reload/Reload.cs
index b68927f63..7fa7fd22f 100644
--- a/EXILED/Exiled.Events/Commands/Reload/Reload.cs
+++ b/EXILED/Exiled.Events/Commands/Reload/Reload.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/Reload/RemoteAdmin.cs b/EXILED/Exiled.Events/Commands/Reload/RemoteAdmin.cs
index 7c21428b3..888288e94 100644
--- a/EXILED/Exiled.Events/Commands/Reload/RemoteAdmin.cs
+++ b/EXILED/Exiled.Events/Commands/Reload/RemoteAdmin.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/Reload/Translations.cs b/EXILED/Exiled.Events/Commands/Reload/Translations.cs
index 621a7036b..99459b3f1 100644
--- a/EXILED/Exiled.Events/Commands/Reload/Translations.cs
+++ b/EXILED/Exiled.Events/Commands/Reload/Translations.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Commands/TpsCommand.cs b/EXILED/Exiled.Events/Commands/TpsCommand.cs
index 2d7412919..722de3b61 100644
--- a/EXILED/Exiled.Events/Commands/TpsCommand.cs
+++ b/EXILED/Exiled.Events/Commands/TpsCommand.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Config.cs b/EXILED/Exiled.Events/Config.cs
index b141cd17e..56a8206e7 100644
--- a/EXILED/Exiled.Events/Config.cs
+++ b/EXILED/Exiled.Events/Config.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -27,21 +27,21 @@ public sealed class Config : IConfig
public bool UseDynamicPatching { get; set; } = true;
///
- /// Gets or sets a value indicating whether SCP-173 can be blocked or not by the tutorial.
+ /// Gets or sets a value indicating whether SCP-173 can be blocked by the tutorial.
///
- [Description("Indicates whether SCP-173 can be blocked or not by the tutorial")]
+ [Description("Indicates whether SCP-173 can be blocked by the tutorial")]
public bool CanTutorialBlockScp173 { get; set; } = true;
///
- /// Gets or sets a value indicating whether SCP-096 can be triggered or not by the tutorial.
+ /// Gets or sets a value indicating whether SCP-096 can be triggered by the tutorial.
///
- [Description("Indicates whether SCP-096 can be triggered or not by the tutorial")]
+ [Description("Indicates whether SCP-096 can be triggered by the tutorial")]
public bool CanTutorialTriggerScp096 { get; set; } = true;
///
/// Gets or sets a value indicating whether SCP-049 can activate the sense ability on tutorials.
///
- [Description("Indicates whether SCP-049 can sense tutorial players or not")]
+ [Description("Indicates whether SCP-049 can sense tutorial players")]
public bool CanScp049SenseTutorial { get; set; } = true;
///
@@ -69,9 +69,9 @@ public sealed class Config : IConfig
public bool ShouldDropInventory { get; set; } = true;
///
- /// Gets or sets a value indicating whether the blood can be spawned or not.
+ /// Gets or sets a value indicating whether the blood can be spawned.
///
- [Description("Indicates whether the blood can be spawned or not")]
+ [Description("Indicates whether the blood can be spawned")]
public bool CanSpawnBlood { get; set; } = true;
///
@@ -99,15 +99,15 @@ public sealed class Config : IConfig
public bool ShouldReloadTranslationsAtRoundRestart { get; set; } = false;
///
- /// Gets a value indicating whether bans should be logged or not.
+ /// Gets a value indicating whether bans should be logged.
///
- [Description("Indicates whether bans should be logged or not")]
+ [Description("Indicates whether bans should be logged")]
public bool ShouldLogBans { get; private set; } = true;
///
/// Gets or sets a value indicating whether to log RA commands.
///
- [Description("Whether or not to log RA commands.")]
+ [Description("Whether to log RA commands.")]
public bool LogRaCommands { get; set; } = true;
}
}
diff --git a/EXILED/Exiled.Events/EventArgs/Cassie/SendingCassieMessageEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Cassie/SendingCassieMessageEventArgs.cs
index c21f7c9f6..e39a463c2 100644
--- a/EXILED/Exiled.Events/EventArgs/Cassie/SendingCassieMessageEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Cassie/SendingCassieMessageEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -26,7 +26,7 @@ public class SendingCassieMessageEventArgs : IDeniableEvent
///
///
///
- /// Indicates whether the event can be executed or not.
+ /// Indicates whether the event can be executed.
public SendingCassieMessageEventArgs(string words, bool makeHold, bool makeNoise, bool isAllowed = true)
{
Words = words;
@@ -41,17 +41,17 @@ public SendingCassieMessageEventArgs(string words, bool makeHold, bool makeNoise
public string Words { get; set; }
///
- /// Gets or sets a value indicating whether or not the message should be held.
+ /// Gets or sets a value indicating whether the message should be held.
///
public bool MakeHold { get; set; }
///
- /// Gets or sets a value indicating whether or not the message should make noise.
+ /// Gets or sets a value indicating whether the message should make noise.
///
public bool MakeNoise { get; set; }
///
- /// Gets or sets a value indicating whether or not the message can be sent.
+ /// Gets or sets a value indicating whether the message can be sent.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IAttackerEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IAttackerEvent.cs
index f69b43cad..bb523f3d7 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IAttackerEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IAttackerEvent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/ICameraEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/ICameraEvent.cs
index 53aadf762..8c44ab58b 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/ICameraEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/ICameraEvent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IDeniableEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IDeniableEvent.cs
index 41a4e78ea..b0bff1a13 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IDeniableEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IDeniableEvent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -13,7 +13,7 @@ namespace Exiled.Events.EventArgs.Interfaces
public interface IDeniableEvent : IExiledEvent
{
///
- /// Gets or sets a value indicating whether or not the event is allowed to continue.
+ /// Gets or sets a value indicating whether the event is allowed to continue.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IDoorEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IDoorEvent.cs
index 34a02f036..971e24b72 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IDoorEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IDoorEvent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IExiledEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IExiledEvent.cs
index 1e1c55bfc..06d0c5d33 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IExiledEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IExiledEvent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IFirearmEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IFirearmEvent.cs
index 9f73249a0..0cf0ba281 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IFirearmEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IFirearmEvent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IGeneratorEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IGeneratorEvent.cs
index 479636f7a..5cddb0a8f 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IGeneratorEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IGeneratorEvent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IHazardEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IHazardEvent.cs
index d10d34631..6c78c62d1 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IHazardEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IHazardEvent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IItemEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IItemEvent.cs
index 978cb2bc7..5e838badd 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IItemEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IItemEvent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IPickupEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IPickupEvent.cs
index d1defc093..b44547f97 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IPickupEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IPickupEvent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IPlayerEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IPlayerEvent.cs
index 46c7e2aaf..fec096f0b 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IPlayerEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IPlayerEvent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IRagdollEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IRagdollEvent.cs
index fe1fd61ad..c15fbc028 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IRagdollEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IRagdollEvent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IRoomEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IRoomEvent.cs
index c1bc250e3..0ff4df980 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IRoomEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IRoomEvent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp0492Event.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp0492Event.cs
index 65f6edd22..483ebaa64 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp0492Event.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp0492Event.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp049Event.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp049Event.cs
index 29d5e7327..d705b8802 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp049Event.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp049Event.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp079Event.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp079Event.cs
index 6a2ddae8f..ebe5290f0 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp079Event.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp079Event.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp096Event.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp096Event.cs
index faafdbcb4..ab4abc431 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp096Event.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp096Event.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp106Event.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp106Event.cs
index 2fb875167..45df12dc6 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp106Event.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp106Event.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp1344Event.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp1344Event.cs
new file mode 100644
index 000000000..c2009ae7d
--- /dev/null
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp1344Event.cs
@@ -0,0 +1,22 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.EventArgs.Interfaces
+{
+ using Exiled.API.Features.Items;
+
+ ///
+ /// Event args used for all related events.
+ ///
+ public interface IScp1344Event : IItemEvent
+ {
+ ///
+ /// Gets the triggering the event.
+ ///
+ public Scp1344 Scp1344 { get; }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp173Event.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp173Event.cs
index c9b2f6eb1..86cd0992c 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp173Event.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp173Event.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp3114Event.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp3114Event.cs
index 5683a7a7a..a18abcc29 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp3114Event.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp3114Event.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp330Event.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp330Event.cs
index 45a3072e7..4a3e4a492 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp330Event.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp330Event.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp939Event.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp939Event.cs
index 12aed0e08..998fd7318 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IScp939Event.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IScp939Event.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/ITeslaEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/ITeslaEvent.cs
index 3f6c95287..7f79c1b15 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/ITeslaEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/ITeslaEvent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Interfaces/IUsableEvent.cs b/EXILED/Exiled.Events/EventArgs/Interfaces/IUsableEvent.cs
index 67b28f5b6..2c29879f8 100644
--- a/EXILED/Exiled.Events/EventArgs/Interfaces/IUsableEvent.cs
+++ b/EXILED/Exiled.Events/EventArgs/Interfaces/IUsableEvent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Item/ChangingAmmoEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/ChangingAmmoEventArgs.cs
index bc45d3bbf..6e76f8b7a 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/ChangingAmmoEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/ChangingAmmoEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -61,7 +61,7 @@ public ChangingAmmoEventArgs(InventorySystem.Items.ItemBase firearm, byte oldAmm
public byte NewAmmo { get; set; }
///
- /// Gets or sets a value indicating whether or not the ammo can be changed.
+ /// Gets or sets a value indicating whether the ammo can be changed.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Item/ChangingAttachmentsEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/ChangingAttachmentsEventArgs.cs
index fad3ec0b5..c0d621a29 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/ChangingAttachmentsEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/ChangingAttachmentsEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -70,7 +70,7 @@ public ChangingAttachmentsEventArgs(Player player, InventorySystem.Items.Firearm
public uint NewCode { get; }
///
- /// Gets or sets a value indicating whether or not the attachments can be changed.
+ /// Gets or sets a value indicating whether the attachments can be changed.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs
index 6ac613800..7e7a6e58b 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs
@@ -1,14 +1,12 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Item
{
- using System;
-
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
@@ -16,14 +14,14 @@ namespace Exiled.Events.EventArgs.Item
///
/// Contains all information before a player charges a .
///
- public class ChargingJailbirdEventArgs : IPlayerEvent, IItemEvent, IDeniableEvent
+ public class ChargingJailbirdEventArgs : IPlayerEvent, IItemEvent
{
///
/// Initializes a new instance of the class.
///
///
/// The item being charged.
- /// Whether the item can be charged or not.
+ /// Whether the item can be charged.
public ChargingJailbirdEventArgs(ReferenceHub player, InventorySystem.Items.ItemBase swingItem, bool isAllowed = true)
{
Player = Player.Get(player);
@@ -49,13 +47,8 @@ public ChargingJailbirdEventArgs(ReferenceHub player, InventorySystem.Items.Item
public Item Item => Jailbird;
///
- /// Gets or sets a value indicating whether or not the Jailbird can be charged.
+ /// Gets a value indicating whether the Jailbird can be charged.
///
- public bool IsAllowed
- {
- get;
- [Obsolete("This event cannot be denied as it will cause desync.")]
- set;
- }
+ public bool IsAllowed { get; }
}
}
diff --git a/EXILED/Exiled.Events/EventArgs/Item/KeycardInteractingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/KeycardInteractingEventArgs.cs
index 181f7c7eb..1f3e45e4a 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/KeycardInteractingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/KeycardInteractingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -54,7 +54,7 @@ public KeycardInteractingEventArgs(BaseKeycardPickup pickup, Player player, Door
public Door Door { get; }
///
- /// Gets or sets a value indicating whether or not the keycard can interact with the door.
+ /// Gets or sets a value indicating whether the keycard can interact with the door.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Item/ReceivingPreferenceEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/ReceivingPreferenceEventArgs.cs
index 72e04e534..a7cdb73f7 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/ReceivingPreferenceEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/ReceivingPreferenceEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -81,7 +81,7 @@ public uint NewCode
}
///
- /// Gets or sets a value indicating whether or not the attachments preference is allowed.
+ /// Gets or sets a value indicating whether the attachments preference is allowed.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Item/SwingingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/SwingingEventArgs.cs
index 6c8f0fce8..0a63b6c9b 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/SwingingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/SwingingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -21,7 +21,7 @@ public class SwingingEventArgs : IPlayerEvent, IItemEvent, IDeniableEvent
///
///
/// The item being swung.
- /// Whether the item can be swung or not.
+ /// Whether the item can be swung.
public SwingingEventArgs(ReferenceHub player, InventorySystem.Items.ItemBase swingItem, bool isAllowed = true)
{
Player = Player.Get(player);
@@ -45,7 +45,7 @@ public SwingingEventArgs(ReferenceHub player, InventorySystem.Items.ItemBase swi
public Item Item => Jailbird;
///
- /// Gets or sets a value indicating whether or not the item can be swung.
+ /// Gets or sets a value indicating whether the item can be swung.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Item/UsingRadioPickupBatteryEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/UsingRadioPickupBatteryEventArgs.cs
index 5367b4363..722a581dd 100644
--- a/EXILED/Exiled.Events/EventArgs/Item/UsingRadioPickupBatteryEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Item/UsingRadioPickupBatteryEventArgs.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Map/AnnouncingChaosEntranceEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/AnnouncingChaosEntranceEventArgs.cs
new file mode 100644
index 000000000..e0e7fb893
--- /dev/null
+++ b/EXILED/Exiled.Events/EventArgs/Map/AnnouncingChaosEntranceEventArgs.cs
@@ -0,0 +1,46 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.EventArgs.Map
+{
+ using System.Text;
+
+ using Exiled.API.Features.Waves;
+ using Exiled.Events.EventArgs.Interfaces;
+ using Respawning.Announcements;
+
+ ///
+ /// Contains all information before Chaos wave entrance.
+ ///
+ public class AnnouncingChaosEntranceEventArgs : IDeniableEvent
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ ///
+ public AnnouncingChaosEntranceEventArgs(WaveAnnouncementBase announcement, StringBuilder builder)
+ {
+ Wave = TimedWave.GetTimedWaves().Find(x => x.Announcement == announcement);
+ Words = builder;
+ }
+
+ ///
+ /// Gets the entering wave.
+ ///
+ public TimedWave Wave { get; }
+
+ ///
+ /// Gets the of the words that C.A.S.S.I.E will say.
+ /// It doesn't affect the subtitle part that will be sent to the client.
+ ///
+ public StringBuilder Words { get; }
+
+ ///
+ public bool IsAllowed { get; set; } = true;
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Map/AnnouncingDecontaminationEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/AnnouncingDecontaminationEventArgs.cs
index 6b13ed6a5..44290de80 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/AnnouncingDecontaminationEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/AnnouncingDecontaminationEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -49,7 +49,7 @@ public AnnouncingDecontaminationEventArgs(int announcementId, PhaseFunction phas
public PhaseFunction PhaseFunction { get; }
///
- /// Gets a value indicating whether the announcement is going to be global or not.
+ /// Gets a value indicating whether the announcement is going to be global.
///
public bool IsGlobal { get; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Map/AnnouncingNtfEntranceEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/AnnouncingNtfEntranceEventArgs.cs
index 7f701de08..40a9fd315 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/AnnouncingNtfEntranceEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/AnnouncingNtfEntranceEventArgs.cs
@@ -1,13 +1,15 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Map
{
+ using Exiled.API.Features.Waves;
using Interfaces;
+ using Respawning.Announcements;
///
/// Contains all information before C.A.S.S.I.E announces the NTF entrance.
@@ -17,26 +19,23 @@ public class AnnouncingNtfEntranceEventArgs : IDeniableEvent
///
/// Initializes a new instance of the class.
///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public AnnouncingNtfEntranceEventArgs(int scpsLeft, string unitName, int unitNumber, bool isAllowed = true)
+ ///
+ ///
+ ///
+ ///
+ public AnnouncingNtfEntranceEventArgs(WaveAnnouncementBase announcement, int scpsLeft, string unitName, int unitNumber)
{
+ Wave = TimedWave.GetTimedWaves().Find(x => x.Announcement == announcement);
ScpsLeft = scpsLeft;
UnitName = unitName;
UnitNumber = unitNumber;
- IsAllowed = isAllowed;
}
+ ///
+ /// Gets the entering wave.
+ ///
+ public TimedWave Wave { get; }
+
///
/// Gets or sets the number of SCPs left.
///
@@ -53,8 +52,8 @@ public AnnouncingNtfEntranceEventArgs(int scpsLeft, string unitName, int unitNum
public int UnitNumber { get; set; }
///
- /// Gets or sets a value indicating whether or not the NTF spawn will be announced by C.A.S.S.I.E.
+ /// Gets or sets a value indicating whether the NTF spawn will be announced by C.A.S.S.I.E.
///
- public bool IsAllowed { get; set; }
+ public bool IsAllowed { get; set; } = true;
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Map/AnnouncingScpTerminationEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/AnnouncingScpTerminationEventArgs.cs
index 2636eb26f..a083ac1fa 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/AnnouncingScpTerminationEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/AnnouncingScpTerminationEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -69,7 +69,7 @@ public AnnouncingScpTerminationEventArgs(Player scp, DamageHandlerBase damageHan
public CustomDamageHandler DamageHandler { get; set; }
///
- /// Gets or sets a value indicating whether or not the SCP termination will be announced by C.A.S.S.I.E.
+ /// Gets or sets a value indicating whether the SCP termination will be announced by C.A.S.S.I.E.
///
public bool IsAllowed { get; set; } = true;
}
diff --git a/EXILED/Exiled.Events/EventArgs/Map/ChangedIntoGrenadeEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/ChangedIntoGrenadeEventArgs.cs
index 0490c68a4..94f5b93a3 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/ChangedIntoGrenadeEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/ChangedIntoGrenadeEventArgs.cs
@@ -1,14 +1,12 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Map
{
- using System;
-
using Exiled.API.Features.Pickups;
using Exiled.API.Features.Pickups.Projectiles;
using Exiled.Events.EventArgs.Interfaces;
@@ -26,8 +24,8 @@ public class ChangedIntoGrenadeEventArgs : IExiledEvent
/// The .
public ChangedIntoGrenadeEventArgs(TimedGrenadePickup pickup, ThrownProjectile projectile)
{
- Pickup = (GrenadePickup)API.Features.Pickups.Pickup.Get(pickup);
- Projectile = (Projectile)API.Features.Pickups.Pickup.Get(projectile);
+ Pickup = API.Features.Pickups.Pickup.Get(pickup);
+ Projectile = API.Features.Pickups.Pickup.Get(projectile);
}
///
@@ -39,11 +37,5 @@ public ChangedIntoGrenadeEventArgs(TimedGrenadePickup pickup, ThrownProjectile p
/// Gets a value indicating the projectile that spawned.
///
public Projectile Projectile { get; }
-
- ///
- /// Gets or sets a value indicating how long the fuse of the changed grenade will be.
- ///
- [Obsolete("Use Projectile.Is(Projectile, out TimeGrenadeProjectile timeGrenadeProjectile) ? timeGrenadeProjectile.FuseTime : 0 instead of this", true)]
- public double FuseTime { get; set; }
}
}
diff --git a/EXILED/Exiled.Events/EventArgs/Map/ChangingIntoGrenadeEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/ChangingIntoGrenadeEventArgs.cs
index 765d38f61..262a686f7 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/ChangingIntoGrenadeEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/ChangingIntoGrenadeEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Map/DecontaminatingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/DecontaminatingEventArgs.cs
index 6bce5e780..5dd63d46b 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/DecontaminatingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/DecontaminatingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -26,7 +26,7 @@ public DecontaminatingEventArgs(bool isAllowed = true)
}
///
- /// Gets or sets a value indicating whether or not light containment zone decontamination can begin.
+ /// Gets or sets a value indicating whether light containment zone decontamination can begin.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Map/ExplodingGrenadeEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/ExplodingGrenadeEventArgs.cs
index a0dbd7920..27b0bc165 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/ExplodingGrenadeEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/ExplodingGrenadeEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -39,7 +39,7 @@ public ExplodingGrenadeEventArgs(Footprint thrower, Vector3 position, ExplosionG
Player = Player.Get(thrower.Hub);
Projectile = Pickup.Get(grenade);
Position = position;
- TargetsToAffect = ListPool.Pool.Get();
+ TargetsToAffect = HashSetPool.Pool.Get();
if (Projectile.Base is not ExplosionGrenade)
return;
@@ -59,8 +59,7 @@ public ExplodingGrenadeEventArgs(Footprint thrower, Vector3 position, ExplosionG
{
if (Server.FriendlyFire || IndividualFriendlyFire.CheckFriendlyFirePlayer(thrower, hub))
{
- if (!TargetsToAffect.Contains(player))
- TargetsToAffect.Add(player);
+ TargetsToAffect.Add(player);
}
}
@@ -69,8 +68,7 @@ public ExplodingGrenadeEventArgs(Footprint thrower, Vector3 position, ExplosionG
{
if (Server.FriendlyFire || thrower.Hub == Server.Host.ReferenceHub || HitboxIdentity.IsEnemy(thrower.Role, hub.roleManager.CurrentRole.RoleTypeId))
{
- if (!TargetsToAffect.Contains(player))
- TargetsToAffect.Add(player);
+ TargetsToAffect.Add(player);
}
}
@@ -94,12 +92,12 @@ public ExplodingGrenadeEventArgs(Footprint thrower, Vector3 position, ExplosionG
///
///
///
- public ExplodingGrenadeEventArgs(Player thrower, EffectGrenade grenade, List targetsToAffect, bool isAllowed = true)
+ public ExplodingGrenadeEventArgs(Player thrower, EffectGrenade grenade, HashSet targetsToAffect, bool isAllowed = true)
{
Player = thrower ?? Server.Host;
Projectile = Pickup.Get(grenade);
Position = Projectile.Position;
- TargetsToAffect = ListPool.Pool.Get(targetsToAffect ?? new());
+ TargetsToAffect = HashSetPool.Pool.Get(targetsToAffect ?? new HashSet());
IsAllowed = isAllowed;
}
@@ -108,7 +106,7 @@ public ExplodingGrenadeEventArgs(Player thrower, EffectGrenade grenade, List
~ExplodingGrenadeEventArgs()
{
- ListPool.Pool.Return(TargetsToAffect);
+ HashSetPool.Pool.Return(TargetsToAffect);
}
///
@@ -119,7 +117,7 @@ public ExplodingGrenadeEventArgs(Player thrower, EffectGrenade grenade, List
/// Gets the players who could be affected by the grenade, if any, and the damage that be dealt.
///
- public List TargetsToAffect { get; }
+ public HashSet TargetsToAffect { get; }
///
/// Gets the grenade that is exploding.
@@ -127,7 +125,7 @@ public ExplodingGrenadeEventArgs(Player thrower, EffectGrenade grenade, List
- /// Gets or sets a value indicating whether or not the grenade can be thrown.
+ /// Gets or sets a value indicating whether the grenade can be thrown.
///
public bool IsAllowed { get; set; } = true;
diff --git a/EXILED/Exiled.Events/EventArgs/Map/FillingLockerEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/FillingLockerEventArgs.cs
index 2d28744b2..66043379d 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/FillingLockerEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/FillingLockerEventArgs.cs
@@ -1,14 +1,12 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Map
{
- using System;
-
using Exiled.API.Features.Lockers;
using Exiled.API.Features.Pickups;
using Exiled.Events.EventArgs.Interfaces;
@@ -40,12 +38,6 @@ public FillingLockerEventArgs(ItemPickupBase pickupBase, LockerChamber lockerCha
///
public Pickup Pickup { get; }
- ///
- /// Gets a value indicating the target locker chamber.
- ///
- [Obsolete("Use Chamber instead.")]
- public LockerChamber LockerChamber => Chamber.Base;
-
///
/// Gets a locker which is containing .
///
@@ -57,7 +49,7 @@ public FillingLockerEventArgs(ItemPickupBase pickupBase, LockerChamber lockerCha
public Chamber Chamber { get; }
///
- /// Gets or sets a value indicating whether or not the item can be spawned.
+ /// Gets or sets a value indicating whether the item can be spawned.
///
public bool IsAllowed { get; set; } = true;
}
diff --git a/EXILED/Exiled.Events/EventArgs/Map/GeneratorActivatingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/GeneratorActivatingEventArgs.cs
index aa8fad27e..b6187bb2b 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/GeneratorActivatingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/GeneratorActivatingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -39,7 +39,7 @@ public GeneratorActivatingEventArgs(Scp079Generator generator, bool isAllowed =
public Generator Generator { get; }
///
- /// Gets or sets a value indicating whether the generator can be activated or not.
+ /// Gets or sets a value indicating whether the generator can be activated.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Map/PickupAddedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/PickupAddedEventArgs.cs
index 6b1c17523..faa0b772a 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/PickupAddedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/PickupAddedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Map/PickupDestroyedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/PickupDestroyedEventArgs.cs
index 982073b9a..49bba314c 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/PickupDestroyedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/PickupDestroyedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Map/PlacingBloodEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/PlacingBloodEventArgs.cs
deleted file mode 100644
index 58a06aeaf..000000000
--- a/EXILED/Exiled.Events/EventArgs/Map/PlacingBloodEventArgs.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
-// Licensed under the CC BY-SA 3.0 license.
-//
-// -----------------------------------------------------------------------
-
-namespace Exiled.Events.EventArgs.Map
-{
- using API.Features;
-
- using Interfaces;
-
- using UnityEngine;
-
- ///
- /// Contains all information before placing a blood decal.
- ///
- public class PlacingBloodEventArgs : IPlayerEvent, IDeniableEvent
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public PlacingBloodEventArgs(Player player, Player target, RaycastHit hit, bool isAllowed = true)
- {
- Player = player;
- Target = target;
- Position = hit.point;
- IsAllowed = isAllowed;
- }
-
- ///
- /// Gets the who's placing the blood.
- ///
- public Player Player { get; }
-
- ///
- /// Gets the target's instance.
- ///
- public Player Target { get; }
-
- ///
- /// Gets or sets the blood placing position.
- ///
- public Vector3 Position { get; set; }
-
- ///
- /// Gets or sets a value indicating whether or not the blood can be placed.
- ///
- public bool IsAllowed { get; set; }
- }
-}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Map/PlacingBulletHoleEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/PlacingBulletHoleEventArgs.cs
index 8e237af27..8a066fbaf 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/PlacingBulletHoleEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/PlacingBulletHoleEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -8,7 +8,7 @@
namespace Exiled.Events.EventArgs.Map
{
using API.Features;
-
+ using Exiled.API.Features.Items;
using Interfaces;
using UnityEngine;
@@ -16,20 +16,21 @@ namespace Exiled.Events.EventArgs.Map
///
/// Contains all information before placing a bullet hole decal.
///
- public class PlacingBulletHoleEventArgs : IPlayerEvent, IDeniableEvent
+ public class PlacingBulletHoleEventArgs : IFirearmEvent, IPlayerEvent, IDeniableEvent
{
///
/// Initializes a new instance of the class.
///
- ///
- ///
+ ///
+ ///
///
///
///
///
- public PlacingBulletHoleEventArgs(Player owner, RaycastHit hit)
+ public PlacingBulletHoleEventArgs(Item firearm, RaycastHit hit)
{
- Player = owner;
+ Firearm = firearm.As();
+ Player = Firearm.Owner;
Position = hit.point;
Rotation = Quaternion.LookRotation(hit.normal);
}
@@ -45,7 +46,7 @@ public PlacingBulletHoleEventArgs(Player owner, RaycastHit hit)
public Quaternion Rotation { get; set; }
///
- /// Gets or sets a value indicating whether or not the decal can be placed.
+ /// Gets or sets a value indicating whether the decal can be placed.
///
public bool IsAllowed { get; set; } = true;
@@ -53,5 +54,11 @@ public PlacingBulletHoleEventArgs(Player owner, RaycastHit hit)
/// Gets the decal owner.
///
public Player Player { get; }
+
+ ///
+ public Firearm Firearm { get; }
+
+ ///
+ public Item Item => Firearm;
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Map/PlacingPickupIntoPocketDimensionEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/PlacingPickupIntoPocketDimensionEventArgs.cs
index dfe70c3ed..3dcef688d 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/PlacingPickupIntoPocketDimensionEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/PlacingPickupIntoPocketDimensionEventArgs.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Map/Scp244SpawningEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/Scp244SpawningEventArgs.cs
index fd6a6fa76..263deba65 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/Scp244SpawningEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/Scp244SpawningEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -47,7 +47,7 @@ public Scp244SpawningEventArgs(RoomIdentifier room, Scp244DeployablePickup scp24
public Scp244Pickup Scp244Pickup { get; }
///
- /// Gets or sets a value indicating whether or not the item can be spawning.
+ /// Gets or sets a value indicating whether the item can be spawning.
///
public bool IsAllowed { get; set; } = true;
}
diff --git a/EXILED/Exiled.Events/EventArgs/Map/SpawningItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/SpawningItemEventArgs.cs
index 7e1ef1cf6..4476b8841 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/SpawningItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/SpawningItemEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -43,7 +43,7 @@ public SpawningItemEventArgs(ItemPickupBase pickupBase, bool shouldInitiallySpaw
public Pickup Pickup { get; }
///
- /// Gets or sets a value indicating whether or not the item will be initially spawned.
+ /// Gets or sets a value indicating whether the item will be initially spawned.
///
public bool ShouldInitiallySpawn { get; set; }
@@ -57,7 +57,7 @@ public SpawningItemEventArgs(ItemPickupBase pickupBase, bool shouldInitiallySpaw
public Door TriggerDoor { get; set; }
///
- /// Gets or sets a value indicating whether or not the item can be spawned.
+ /// Gets or sets a value indicating whether the item can be spawned.
///
public bool IsAllowed { get; set; } = true;
}
diff --git a/EXILED/Exiled.Events/EventArgs/Map/SpawningTeamVehicleEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/SpawningTeamVehicleEventArgs.cs
index 6cc821d7a..2e455ff30 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/SpawningTeamVehicleEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/SpawningTeamVehicleEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -9,6 +9,7 @@ namespace Exiled.Events.EventArgs.Map
{
using Exiled.Events.EventArgs.Interfaces;
using Respawning;
+ using Respawning.Waves;
///
/// Contains all information before the server spawns a team's respawn vehicle.
@@ -24,7 +25,7 @@ public class SpawningTeamVehicleEventArgs : IDeniableEvent
///
///
///
- public SpawningTeamVehicleEventArgs(SpawnableTeamType team, bool isAllowed = true)
+ public SpawningTeamVehicleEventArgs(SpawnableWaveBase team, bool isAllowed = true)
{
Team = team;
IsAllowed = isAllowed;
@@ -33,10 +34,10 @@ public SpawningTeamVehicleEventArgs(SpawnableTeamType team, bool isAllowed = tru
///
/// Gets or sets which vehicle should spawn.
///
- public SpawnableTeamType Team { get; set; }
+ public SpawnableWaveBase Team { get; set; }
///
- /// Gets or sets a value indicating whether or not the vehicle can be spawned.
+ /// Gets or sets a value indicating whether the vehicle can be spawned.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Map/TurningOffLightsEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/TurningOffLightsEventArgs.cs
index 54ed314bd..5294ea7ad 100644
--- a/EXILED/Exiled.Events/EventArgs/Map/TurningOffLightsEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Map/TurningOffLightsEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ActivatingGeneratorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ActivatingGeneratorEventArgs.cs
index b3ca6d9cc..33a6e87ee 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ActivatingGeneratorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ActivatingGeneratorEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -38,7 +38,7 @@ public ActivatingGeneratorEventArgs(Player player, Scp079Generator generator, bo
}
///
- /// Gets or sets a value indicating whether or not the switch can be flipped.
+ /// Gets or sets a value indicating whether the switch can be flipped.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ActivatingWarheadPanelEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ActivatingWarheadPanelEventArgs.cs
index 535dc0ad1..f31eded38 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ActivatingWarheadPanelEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ActivatingWarheadPanelEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -32,7 +32,7 @@ public ActivatingWarheadPanelEventArgs(Player player, bool isAllowed = true)
}
///
- /// Gets or sets a value indicating whether or not the warhead can be activated.
+ /// Gets or sets a value indicating whether the warhead can be activated.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ActivatingWorkstationEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ActivatingWorkstationEventArgs.cs
index db84492c0..e03555655 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ActivatingWorkstationEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ActivatingWorkstationEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -50,7 +50,7 @@ public ActivatingWorkstationEventArgs(Player player, WorkstationController contr
public WorkstationStatus NewStatus { get; set; } = WorkstationStatus.PoweringUp;
///
- /// Gets or sets a value indicating whether or not the workstation can be activated.
+ /// Gets or sets a value indicating whether the workstation can be activated.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/AimingDownSightEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/AimingDownSightEventArgs.cs
index eebbae5a3..945295631 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/AimingDownSightEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/AimingDownSightEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -12,45 +12,34 @@ namespace Exiled.Events.EventArgs.Player
using Interfaces;
+ using FirearmBase = InventorySystem.Items.Firearms.Firearm;
+
///
/// Contains all information when a player aims.
///
- // TODO: remove stupid AdsIn/AdsOut propetry, and let exists only one
public class AimingDownSightEventArgs : IPlayerEvent, IFirearmEvent
{
///
/// Initializes a new instance of the class.
///
- ///
- ///
- ///
///
///
///
///
///
///
- ///
- ///
- ///
- public AimingDownSightEventArgs(Player player, Firearm firearm, bool adsIn, bool adsOut)
+ public AimingDownSightEventArgs(FirearmBase firearm, bool adsIn)
{
- Firearm = firearm;
- Player = player;
+ Firearm = Item.Get(firearm);
+ Player = Firearm.Owner;
AdsIn = adsIn;
- AdsOut = adsOut;
}
///
- /// Gets a value indicating whether or not the player is aiming down sight in.
+ /// Gets a value indicating whether the player is aiming down sight in.
///
public bool AdsIn { get; }
- ///
- /// Gets a value indicating whether or not the player is aiming down sight out.
- ///
- public bool AdsOut { get; }
-
///
/// Gets the used to trigger the aim action.
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/BannedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/BannedEventArgs.cs
index 0d55acc86..0c060df6d 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/BannedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/BannedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -54,7 +54,7 @@ public BannedEventArgs(Player target, Player issuer, BanDetails details, BanHand
public BanHandler.BanType Type { get; }
///
- /// Gets a value indicating whether the ban is forced or not.
+ /// Gets a value indicating whether the ban is forced.
///
public bool IsForced { get; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs
index 235deea12..585e24477 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/CancelledItemUseEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/CancelledItemUseEventArgs.cs
index bd994bbca..33719e621 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/CancelledItemUseEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/CancelledItemUseEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/CancellingItemUseEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/CancellingItemUseEventArgs.cs
index f3f623f40..1caaabb0a 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/CancellingItemUseEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/CancellingItemUseEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -44,7 +44,7 @@ public CancellingItemUseEventArgs(Player player, UsableItem item)
public Player Player { get; }
///
- /// Gets or sets a value indicating whether or not the player can cancelling the use of item.
+ /// Gets or sets a value indicating whether the player can cancelling the use of item.
///
public bool IsAllowed { get; set; } = true;
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangedEmotionEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangedEmotionEventArgs.cs
new file mode 100644
index 000000000..cd5e3447a
--- /dev/null
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangedEmotionEventArgs.cs
@@ -0,0 +1,38 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.EventArgs.Player
+{
+ using Exiled.API.Features;
+ using Exiled.Events.EventArgs.Interfaces;
+ using PlayerRoles.FirstPersonControl.Thirdperson.Subcontrollers;
+
+ ///
+ /// Contains all the information after the player's emotion.
+ ///
+ public class ChangedEmotionEventArgs : IPlayerEvent
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ ///
+ public ChangedEmotionEventArgs(ReferenceHub hub, EmotionPresetType emotionPresetType)
+ {
+ Player = Player.Get(hub);
+ EmotionPresetType = emotionPresetType;
+ }
+
+ ///
+ /// Gets the player's emotion.
+ ///
+ public EmotionPresetType EmotionPresetType { get; }
+
+ ///
+ public Player Player { get; }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangedItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangedItemEventArgs.cs
index 50cd514e5..5d99086af 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangedItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangedItemEventArgs.cs
@@ -1,14 +1,12 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Player
{
- using System;
-
using API.Features;
using API.Features.Items;
@@ -42,12 +40,6 @@ public ChangedItemEventArgs(Player player, ItemBase oldItem)
///
public Item OldItem { get; }
- ///
- /// Gets the new item.
- ///
- [Obsolete("Use ev.Item instead of this")]
- public Item NewItem => Item;
-
///
/// Gets the new item.
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingDangerStateEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingDangerStateEventArgs.cs
index 8b703014e..8ee98adb0 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingDangerStateEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingDangerStateEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -23,9 +23,9 @@ public class ChangingDangerStateEventArgs : IPlayerEvent, IDeniableEvent
/// The player changing danger.
/// The .
/// The .
- /// Whether or not the danger is being activated. If false it is ending.
+ /// Whether the danger is being activated. If false it is ending.
/// The player that has been encountered if the danger is an encounter or null if it isn't.
- /// Whether or not it is allowed to activate/deactivate.
+ /// Whether it is allowed to activate/deactivate.
public ChangingDangerStateEventArgs(Player player, DangerStackBase danger, DangerType type, bool activating, Player encounteredPlayer = null, bool isAllowed = true)
{
Player = player;
@@ -50,12 +50,12 @@ public ChangingDangerStateEventArgs(Player player, DangerStackBase danger, Dange
public DangerType Type { get; }
///
- /// Gets a value indicating whether or not the danger is being activated.
+ /// Gets a value indicating whether the danger is being activated.
///
public bool IsActivating { get; }
///
- /// Gets a value indicating whether or not the danger is ending.
+ /// Gets a value indicating whether the danger is ending.
///
public bool IsEnding => !IsActivating;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingDisruptorModeEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingDisruptorModeEventArgs.cs
new file mode 100644
index 000000000..dd33c9426
--- /dev/null
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingDisruptorModeEventArgs.cs
@@ -0,0 +1,41 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.EventArgs.Player
+{
+ using Exiled.API.Enums;
+ using Exiled.API.Features.Items;
+ using Exiled.Events.EventArgs.Interfaces;
+
+ ///
+ /// Contains all information before disruptor's mode is changed.
+ ///
+ public class ChangingDisruptorModeEventArgs : IFirearmEvent
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ ///
+ public ChangingDisruptorModeEventArgs(Item firearm, bool mode)
+ {
+ Firearm = firearm.As();
+ NewMode = mode ? DisruptorMode.Disintegrator : DisruptorMode.BurstFire;
+ }
+
+ ///
+ public Item Item => Firearm;
+
+ ///
+ public Firearm Firearm { get; }
+
+ ///
+ /// Gets a new disruptor's fire mode.
+ ///
+ public DisruptorMode NewMode { get; }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingEmotionEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingEmotionEventArgs.cs
new file mode 100644
index 000000000..759f1fa9e
--- /dev/null
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingEmotionEventArgs.cs
@@ -0,0 +1,50 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.EventArgs.Player
+{
+ using Exiled.API.Features;
+ using Exiled.Events.EventArgs.Interfaces;
+ using PlayerRoles.FirstPersonControl.Thirdperson.Subcontrollers;
+
+ ///
+ /// Contains all the information before the player's emotion changes.
+ ///
+ public class ChangingEmotionEventArgs : IDeniableEvent, IPlayerEvent
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ ///
+ ///
+ ///
+ public ChangingEmotionEventArgs(ReferenceHub hub, EmotionPresetType newEmotionPresetType, EmotionPresetType oldEmotionPresetType, bool isAllowed = true)
+ {
+ Player = Player.Get(hub);
+ NewEmotionPresetType = newEmotionPresetType;
+ OldEmotionPresetType = oldEmotionPresetType;
+ IsAllowed = isAllowed;
+ }
+
+ ///
+ public bool IsAllowed { get; set; }
+
+ ///
+ /// Gets the old player's emotion.
+ ///
+ public EmotionPresetType OldEmotionPresetType { get; }
+
+ ///
+ /// Gets or sets the new player's emotion.
+ ///
+ public EmotionPresetType NewEmotionPresetType { get; set; }
+
+ ///
+ public Player Player { get; }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingGroupEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingGroupEventArgs.cs
index 13ecb5c99..feffd9882 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingGroupEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingGroupEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -41,7 +41,7 @@ public ChangingGroupEventArgs(Player player, UserGroup newGroup, bool isAllowed
public UserGroup NewGroup { get; set; }
///
- /// Gets or sets a value indicating whether or not the player can change groups.
+ /// Gets or sets a value indicating whether the player can change groups.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingIntercomMuteStatusEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingIntercomMuteStatusEventArgs.cs
index dab9f1a70..f31aa3776 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingIntercomMuteStatusEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingIntercomMuteStatusEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -45,7 +45,7 @@ public ChangingIntercomMuteStatusEventArgs(Player player, bool isMuted, bool isA
public bool IsMuted { get; }
///
- /// Gets or sets a value indicating whether or not the player can be intercom muted/unmuted.
+ /// Gets or sets a value indicating whether the player can be intercom muted/unmuted.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingItemEventArgs.cs
index 2265309e4..6978172b5 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingItemEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingMicroHIDStateEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingMicroHIDStateEventArgs.cs
index 2b9bacdbf..1274608ef 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingMicroHIDStateEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingMicroHIDStateEventArgs.cs
@@ -1,48 +1,41 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Player
{
+ using System;
+
using API.Features;
using API.Features.Items;
-
using Interfaces;
-
using InventorySystem.Items.MicroHID;
+ using InventorySystem.Items.MicroHID.Modules;
///
/// Contains all information before MicroHID state is changed.
///
- public class ChangingMicroHIDStateEventArgs : IPlayerEvent, IDeniableEvent
+ public class ChangingMicroHIDStateEventArgs : IDeniableEvent, IItemEvent
{
///
/// Initializes a new instance of the class.
///
- ///
- ///
- ///
///
///
///
- ///
- ///
- ///
- ///
- ///
+ ///
+ ///
///
///
///
///
- public ChangingMicroHIDStateEventArgs(Player player, MicroHIDItem microHID, HidState oldState, HidState newState, bool isAllowed = true)
+ public ChangingMicroHIDStateEventArgs(Item microHID, MicroHidPhase newPhase, bool isAllowed = true)
{
- Player = player;
- MicroHID = Item.Get(microHID);
- OldState = oldState;
- NewState = newState;
+ MicroHID = microHID.As();
+ NewPhase = newPhase;
IsAllowed = isAllowed;
}
@@ -51,24 +44,17 @@ public ChangingMicroHIDStateEventArgs(Player player, MicroHIDItem microHID, HidS
///
public MicroHid MicroHID { get; }
- ///
- /// Gets the old MicroHID state.
- ///
- public HidState OldState { get; }
-
///
/// Gets or sets the new MicroHID state.
///
- public HidState NewState { get; set; }
+ public MicroHidPhase NewPhase { get; set; }
///
- /// Gets or sets a value indicating whether the MicroHID state can be changed or not.
+ /// Gets or sets a value indicating whether the MicroHID state can be changed.
///
public bool IsAllowed { get; set; }
- ///
- /// Gets the player who's using the MicroHID.
- ///
- public Player Player { get; }
+ ///
+ public Item Item => MicroHID;
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingMoveStateEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingMoveStateEventArgs.cs
index 1c55aa6aa..36d524015 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingMoveStateEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingMoveStateEventArgs.cs
@@ -1,14 +1,12 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Player
{
- using System;
-
using API.Features;
using Interfaces;
@@ -18,7 +16,7 @@ namespace Exiled.Events.EventArgs.Player
///
/// Contains all information before changing movement state.
///
- public class ChangingMoveStateEventArgs : IPlayerEvent, IDeniableEvent
+ public class ChangingMoveStateEventArgs : IPlayerEvent
{
///
/// Initializes a new instance of the class.
@@ -32,16 +30,11 @@ public class ChangingMoveStateEventArgs : IPlayerEvent, IDeniableEvent
///
///
///
- ///
- ///
- ///
- public ChangingMoveStateEventArgs(Player player, PlayerMovementState oldState, PlayerMovementState newState, bool isAllowed = true)
+ public ChangingMoveStateEventArgs(Player player, PlayerMovementState oldState, PlayerMovementState newState)
{
Player = player;
OldState = oldState;
-#pragma warning disable CS0618
NewState = newState;
-#pragma warning restore CS0618
}
///
@@ -55,21 +48,8 @@ public ChangingMoveStateEventArgs(Player player, PlayerMovementState oldState, P
public PlayerMovementState OldState { get; }
///
- /// Gets or sets the new state.
- ///
- // TODO: remove setter
- public PlayerMovementState NewState
- {
- get;
- [Obsolete("Setter was removed due to desync problems.")]
- set;
- }
-
- ///
- /// Gets or sets a value indicating whether the player can change the movement state.
+ /// Gets the new state.
///
- // TODO: remove
- [Obsolete("Property was removed due to desync problems.")]
- public bool IsAllowed { get; set; } = true;
+ public PlayerMovementState NewState { get; }
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingMuteStatusEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingMuteStatusEventArgs.cs
index 11904835a..fafad8531 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingMuteStatusEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingMuteStatusEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -45,7 +45,7 @@ public ChangingMuteStatusEventArgs(Player player, bool isMuted, bool isAllowed =
public bool IsMuted { get; }
///
- /// Gets or sets a value indicating whether or not the player can be muted/unmuted.
+ /// Gets or sets a value indicating whether the player can be muted/unmuted.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingNicknameEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingNicknameEventArgs.cs
index 7b971a820..7f56e50bd 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingNicknameEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingNicknameEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingRadioPresetEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingRadioPresetEventArgs.cs
index 70af9b581..b48a8b764 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingRadioPresetEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingRadioPresetEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -62,7 +62,7 @@ public ChangingRadioPresetEventArgs(Player player, RadioItem item, RadioRangeLev
public RadioRange NewValue { get; set; }
///
- /// Gets or sets a value indicating whether the radio preset can be changed or not.
+ /// Gets or sets a value indicating whether the radio preset can be changed.
/// Client radio graphics won't sync with .
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingRoleEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingRoleEventArgs.cs
index c8ab4d9ba..898ab9fcd 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingRoleEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingRoleEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -95,12 +95,12 @@ public RoleTypeId NewRole
public Dictionary Ammo { get; } = DictionaryPool.Pool.Get();
///
- /// Gets or sets a value indicating whether the inventory will be preserved or not.
+ /// Gets or sets a value indicating whether the inventory will be preserved.
///
public bool ShouldPreserveInventory
{
get => !SpawnFlags.HasFlag(RoleSpawnFlags.AssignInventory);
- set => SpawnFlags = value ? (SpawnFlags & ~RoleSpawnFlags.AssignInventory) : (SpawnFlags | RoleSpawnFlags.AssignInventory);
+ set => SpawnFlags = SpawnFlags.ModifyFlags(!value, RoleSpawnFlags.AssignInventory);
}
///
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingSpectatedPlayerEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingSpectatedPlayerEventArgs.cs
index dce1aff91..c50f5d611 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ChangingSpectatedPlayerEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingSpectatedPlayerEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ClosingGeneratorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ClosingGeneratorEventArgs.cs
index 0adc72e3f..9218db494 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ClosingGeneratorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ClosingGeneratorEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -21,7 +21,7 @@ public class ClosingGeneratorEventArgs : IPlayerEvent, IDeniableEvent, IGenerato
///
/// The player who's closing the generator.
/// The instance.
- /// Indicates whether or not the generator can be closed.
+ /// Indicates whether the generator can be closed.
public ClosingGeneratorEventArgs(Player player, Scp079Generator generator, bool isAllowed = true)
{
Player = player;
@@ -30,7 +30,7 @@ public ClosingGeneratorEventArgs(Player player, Scp079Generator generator, bool
}
///
- /// Gets or sets a value indicating whether or not the generator door can be closed.
+ /// Gets or sets a value indicating whether the generator door can be closed.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DamagingDoorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DamagingDoorEventArgs.cs
index 50926289d..efa7229f2 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DamagingDoorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DamagingDoorEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DamagingShootingTargetEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DamagingShootingTargetEventArgs.cs
index 6bbd5cef0..3bd40f659 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DamagingShootingTargetEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DamagingShootingTargetEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -86,7 +86,7 @@ public DamagingShootingTargetEventArgs(Player player, float damage, float distan
public float Distance { get; set; }
///
- /// Gets or sets a value indicating whether or not the target can be damaged.
+ /// Gets or sets a value indicating whether the target can be damaged.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DamagingWindowEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DamagingWindowEventArgs.cs
index 48396f501..03e4aa1fa 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DamagingWindowEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DamagingWindowEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DeactivatingWorkstationEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DeactivatingWorkstationEventArgs.cs
index fd8b0a281..48b7164d8 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DeactivatingWorkstationEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DeactivatingWorkstationEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -52,7 +52,7 @@ public DeactivatingWorkstationEventArgs(WorkstationController controller, bool i
public WorkstationStatus NewStatus { get; set; } = WorkstationStatus.PoweringDown;
///
- /// Gets or sets a value indicating whether or not the workstation can be deactivated.
+ /// Gets or sets a value indicating whether the workstation can be deactivated.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DestroyingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DestroyingEventArgs.cs
index e633ab491..219838dc6 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DestroyingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DestroyingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DiedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DiedEventArgs.cs
index c6606c9b7..26b6a2631 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DiedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DiedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DroppedAmmoEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DroppedAmmoEventArgs.cs
index 68ffac174..fe2dacbd9 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DroppedAmmoEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DroppedAmmoEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DroppedItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DroppedItemEventArgs.cs
index 0109a4bba..c31555366 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DroppedItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DroppedItemEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -37,7 +37,7 @@ public DroppedItemEventArgs(Player player, ItemPickupBase pickup, bool wasThrown
}
///
- /// Gets or sets a value indicating whether or not the pickup was thrown.
+ /// Gets or sets a value indicating whether the pickup was thrown.
///
public bool WasThrown { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DroppingAmmoEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DroppingAmmoEventArgs.cs
index 3a0d0de97..cceb19e75 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DroppingAmmoEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DroppingAmmoEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -55,7 +55,7 @@ public DroppingAmmoEventArgs(Player player, AmmoType ammoType, ushort amount, bo
public ushort Amount { get; set; }
///
- /// Gets or sets a value indicating whether or not the ammo can be dropped.
+ /// Gets or sets a value indicating whether the ammo can be dropped.
///
public bool IsAllowed
{
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DroppingItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DroppingItemEventArgs.cs
index 2173163e7..4ff31bde6 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DroppingItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DroppingItemEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -47,12 +47,12 @@ public DroppingItemEventArgs(Player player, ItemBase item, bool isThrown, bool i
}
///
- /// Gets or sets a value indicating whether or not the item was thrown.
+ /// Gets or sets a value indicating whether the item was thrown.
///
public bool IsThrown { get; set; }
///
- /// Gets or sets a value indicating whether or not the item can be dropped.
+ /// Gets or sets a value indicating whether the item can be dropped.
///
public bool IsAllowed
{
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DroppingNothingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DroppingNothingEventArgs.cs
index 758e1578f..dd9c80aa3 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DroppingNothingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DroppingNothingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DryfiringWeaponEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DryfiringWeaponEventArgs.cs
index 85ba86733..2073d6267 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DryfiringWeaponEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DryfiringWeaponEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -12,6 +12,8 @@ namespace Exiled.Events.EventArgs.Player
using Interfaces;
+ using BaseFirearm = InventorySystem.Items.Firearms.Firearm;
+
///
/// Contains all information before a player's weapon is dryfired.
///
@@ -20,26 +22,19 @@ public class DryfiringWeaponEventArgs : IPlayerEvent, IFirearmEvent, IDeniableEv
///
/// Initializes a new instance of the class.
///
- ///
- ///
- ///
///
///
///
- ///
- ///
- ///
- public DryfiringWeaponEventArgs(Player player, Firearm firearm, bool isAllowed = true)
+ public DryfiringWeaponEventArgs(BaseFirearm firearm)
{
- Firearm = firearm;
- Player = player;
- IsAllowed = isAllowed;
+ Firearm = Item.Get(firearm);
+ Player = Firearm.Owner;
}
///
- /// Gets or sets a value indicating whether or not the weapon can be dryfired.
+ /// Gets or sets a value indicating whether the weapon can be dryfired.
///
- public bool IsAllowed { get; set; }
+ public bool IsAllowed { get; set; } = true;
///
/// Gets the being dryfired.
diff --git a/EXILED/Exiled.Events/EventArgs/Player/DyingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DyingEventArgs.cs
index 1a96627e7..9919ac089 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/DyingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/DyingEventArgs.cs
@@ -1,13 +1,12 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Player
{
- using System;
using System.Collections.Generic;
using System.Linq;
@@ -45,14 +44,9 @@ public DyingEventArgs(Player target, DamageHandlerBase damageHandler)
}
///
- /// Gets or sets the list of items to be dropped.
+ /// Gets the list of items to be dropped.
///
- public List ItemsToDrop
- {
- get;
- [Obsolete("This setter has been deprecated")]
- set;
- }
+ public List ItemsToDrop { get; }
///
/// Gets the dying player.
@@ -65,7 +59,7 @@ public List ItemsToDrop
public CustomDamageHandler DamageHandler { get; set; }
///
- /// Gets or sets a value indicating whether or not the player can be killed.
+ /// Gets or sets a value indicating whether the player can be killed.
///
public bool IsAllowed { get; set; } = true;
diff --git a/EXILED/Exiled.Events/EventArgs/Player/EarningAchievementEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/EarningAchievementEventArgs.cs
index d44036193..d4594b42b 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/EarningAchievementEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/EarningAchievementEventArgs.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/EnteringEnvironmentalHazardEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/EnteringEnvironmentalHazardEventArgs.cs
index bc602b1d9..dc61bef74 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/EnteringEnvironmentalHazardEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/EnteringEnvironmentalHazardEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -38,7 +38,7 @@ public EnteringEnvironmentalHazardEventArgs(API.Features.Player player, Environm
public Hazard Hazard { get; }
///
- /// Gets or sets a value indicating whether or not the player should be affected by the environmental hazard.
+ /// Gets or sets a value indicating whether the player should be affected by the environmental hazard.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/EnteringKillerCollisionEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/EnteringKillerCollisionEventArgs.cs
index fa109bf07..0d8a82d3f 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/EnteringKillerCollisionEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/EnteringKillerCollisionEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -33,7 +33,7 @@ public EnteringKillerCollisionEventArgs(Player player, bool isAllowed = true)
public Player Player { get; }
///
- /// Gets or sets a value indicating whether or not the player is killed by killer collision.
+ /// Gets or sets a value indicating whether the player is killed by killer collision.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/EnteringPocketDimensionEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/EnteringPocketDimensionEventArgs.cs
index dc9aa207b..2b66874ac 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/EnteringPocketDimensionEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/EnteringPocketDimensionEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -41,7 +41,7 @@ public EnteringPocketDimensionEventArgs(Player player, Player scp106, bool isAll
public Player Scp106 { get; }
///
- /// Gets or sets a value indicating whether or not the player can enter the pocket dimension.
+ /// Gets or sets a value indicating whether the player can enter the pocket dimension.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/EscapedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/EscapedEventArgs.cs
new file mode 100644
index 000000000..71df7a008
--- /dev/null
+++ b/EXILED/Exiled.Events/EventArgs/Player/EscapedEventArgs.cs
@@ -0,0 +1,54 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.EventArgs.Player
+{
+ using System;
+
+ using Exiled.API.Enums;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Roles;
+ using Exiled.Events.EventArgs.Interfaces;
+
+ ///
+ /// Contains all information after player has escaped.
+ ///
+ public class EscapedEventArgs : IPlayerEvent
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ ///
+ ///
+ public EscapedEventArgs(Player player, EscapeScenario escapeScenario, Role role)
+ {
+ Player = player;
+ EscapeScenario = escapeScenario;
+ OldRole = role;
+ EscapeTime = (int)Math.Ceiling(role.ActiveTime.TotalSeconds);
+ }
+
+ ///
+ public Player Player { get; }
+
+ ///
+ /// Gets the type of escape.
+ ///
+ public EscapeScenario EscapeScenario { get; }
+
+ ///
+ /// Gets the previous role for this player.
+ ///
+ public Role OldRole { get; }
+
+ ///
+ /// Gets the time in seconds since round started.
+ ///
+ public int EscapeTime { get; }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs
index 109a744b1..a10eea692 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -42,52 +42,6 @@ public EscapingEventArgs(Player player, RoleTypeId newRole, EscapeScenario escap
IsAllowed = escapeScenario is not EscapeScenario.CustomEscape;
}
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public EscapingEventArgs(Player player, RoleTypeId newRole, EscapeScenario escapeScenario, KeyValuePair respawnTickets)
- : this(player, newRole, escapeScenario)
- {
- RespawnTickets = respawnTickets;
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- /// A that will be initialized with.
- ///
- ///
- /// A that will be initialized with.
- ///
- public EscapingEventArgs(Player player, RoleTypeId newRole, EscapeScenario escapeScenario, SpawnableTeamType teamToGrantTickets, float ticketsToGrant)
- : this(player, newRole, escapeScenario)
- {
- if (teamToGrantTickets != SpawnableTeamType.None)
- RespawnTickets = new KeyValuePair(teamToGrantTickets, ticketsToGrant);
- }
-
///
/// Gets the player who's escaping.
///
@@ -104,13 +58,7 @@ public EscapingEventArgs(Player player, RoleTypeId newRole, EscapeScenario escap
public EscapeScenario EscapeScenario { get; set; }
///
- /// Gets or sets the RespawnTickets that will represent the amount of tickets granted to a specific after the player escapes.
- ///
- ///
- public KeyValuePair RespawnTickets { get; set; }
-
- ///
- /// Gets or sets a value indicating whether or not the player can escape.
+ /// Gets or sets a value indicating whether the player can escape.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/EscapingPocketDimensionEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/EscapingPocketDimensionEventArgs.cs
index 4848107a6..375eed530 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/EscapingPocketDimensionEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/EscapingPocketDimensionEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -44,7 +44,7 @@ public EscapingPocketDimensionEventArgs(Player player, Vector3 position)
public Vector3 TeleportPosition { get; set; }
///
- /// Gets or sets a value indicating whether or not the player can successfully escape the pocket dimension.
+ /// Gets or sets a value indicating whether the player can successfully escape the pocket dimension.
///
public bool IsAllowed { get; set; } = true;
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ExitingEnvironmentalHazardEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ExitingEnvironmentalHazardEventArgs.cs
index 7aecd1b3e..e0b24de29 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ExitingEnvironmentalHazardEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ExitingEnvironmentalHazardEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -38,7 +38,7 @@ public ExitingEnvironmentalHazardEventArgs(API.Features.Player player, Environme
public Hazard Hazard { get; }
///
- /// Gets or sets a value indicating whether or not the player should be affected by the environmental hazard.
+ /// Gets or sets a value indicating whether the player should be affected by the environmental hazard.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/FailingEscapePocketDimensionEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/FailingEscapePocketDimensionEventArgs.cs
index 602cf6fb6..247e62cbe 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/FailingEscapePocketDimensionEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/FailingEscapePocketDimensionEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -41,7 +41,7 @@ public FailingEscapePocketDimensionEventArgs(Player player, PocketDimensionTelep
public PocketDimensionTeleport Teleporter { get; }
///
- /// Gets or sets a value indicating whether or not the player dies by failing the pocket dimension escape.
+ /// Gets or sets a value indicating whether the player dies by failing the pocket dimension escape.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/FlippingCoinEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/FlippingCoinEventArgs.cs
index 7622d71b5..369a44386 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/FlippingCoinEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/FlippingCoinEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -45,12 +45,12 @@ public FlippingCoinEventArgs(Player player, Coin coin, bool isTails)
public Item Item { get; }
///
- /// Gets or sets a value indicating whether or not the coin is landing on tails.
+ /// Gets or sets a value indicating whether the coin is landing on tails.
///
public bool IsTails { get; set; }
///
- /// Gets or sets a value indicating whether or not the coin can be flipped.
+ /// Gets or sets a value indicating whether the coin can be flipped.
///
public bool IsAllowed { get; set; } = true;
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/HandcuffingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/HandcuffingEventArgs.cs
index 27a361cda..7f2d8c34c 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/HandcuffingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/HandcuffingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -41,7 +41,7 @@ public HandcuffingEventArgs(Player cuffer, Player target, bool isAllowed = true)
public Player Target { get; }
///
- /// Gets or sets a value indicating whether or not the player can be handcuffed.
+ /// Gets or sets a value indicating whether the player can be handcuffed.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/HealedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/HealedEventArgs.cs
index c3da0256b..9cefcba1a 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/HealedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/HealedEventArgs.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/HealingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/HealingEventArgs.cs
index 6dadc39fe..8ff773904 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/HealingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/HealingEventArgs.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/HurtEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/HurtEventArgs.cs
index 80cff1c51..1b97b4a94 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/HurtEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/HurtEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/HurtingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/HurtingEventArgs.cs
index b6b450f7b..ce3507b18 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/HurtingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/HurtingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/InteractedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/InteractedEventArgs.cs
index 327d6dd8c..f73f97451 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/InteractedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/InteractedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/InteractingDoorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/InteractingDoorEventArgs.cs
index d8ab13538..49a5f2049 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/InteractingDoorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/InteractingDoorEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -41,12 +41,12 @@ public InteractingDoorEventArgs(Player player, DoorVariant door, bool isAllowed
}
///
- /// Gets or sets a value indicating whether or not the player can interact with the door.
+ /// Gets or sets a value indicating whether the player can interact with the door.
///
public bool CanInteract { get; set; }
///
- /// Gets or sets a value indicating whether or not the player can access the door.
+ /// Gets or sets a value indicating whether the player can access the door.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/InteractingElevatorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/InteractingElevatorEventArgs.cs
index 7df9b7476..b8bda532d 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/InteractingElevatorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/InteractingElevatorEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -50,7 +50,7 @@ public InteractingElevatorEventArgs(Player player, ElevatorChamber elevator, boo
public Lift Lift { get; }
///
- /// Gets or sets a value indicating whether or not the player can interact with the elevator.
+ /// Gets or sets a value indicating whether the player can interact with the elevator.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/InteractingLockerEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/InteractingLockerEventArgs.cs
index da490ade7..b7cc7f3b5 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/InteractingLockerEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/InteractingLockerEventArgs.cs
@@ -1,14 +1,12 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Player
{
- using System;
-
using API.Features;
using Exiled.API.Features.Lockers;
using Interfaces;
@@ -36,23 +34,11 @@ public class InteractingLockerEventArgs : IPlayerEvent, IDeniableEvent
public InteractingLockerEventArgs(Player player, MapGeneration.Distributors.Locker locker, byte colliderId, bool isAllowed)
{
Player = player;
- InteractingLocker = API.Features.Lockers.Locker.Get(locker);
- InteractingChamber = API.Features.Lockers.Chamber.Get(locker.Chambers[colliderId]);
+ InteractingLocker = Locker.Get(locker);
+ InteractingChamber = Chamber.Get(locker.Chambers[colliderId]);
IsAllowed = isAllowed;
}
- ///
- /// Gets the instance.
- ///
- [Obsolete("Use InteractingLocker instead.")]
- public MapGeneration.Distributors.Locker Locker => InteractingLocker.Base;
-
- ///
- /// Gets the interacting chamber.
- ///
- [Obsolete("Use InteractingChamber instead.")]
- public MapGeneration.Distributors.LockerChamber Chamber => InteractingChamber.Base;
-
///
/// Gets the locker which is containing .
///
@@ -64,13 +50,7 @@ public InteractingLockerEventArgs(Player player, MapGeneration.Distributors.Lock
public Chamber InteractingChamber { get; }
///
- /// Gets the chamber id.
- ///
- [Obsolete("Use Chamber::Id instead.")]
- public byte ChamberId => InteractingChamber.Id;
-
- ///
- /// Gets or sets a value indicating whether or not the player can interact with the locker.
+ /// Gets or sets a value indicating whether the player can interact with the locker.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/InteractingShootingTargetEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/InteractingShootingTargetEventArgs.cs
index 6f42b451e..086dd409b 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/InteractingShootingTargetEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/InteractingShootingTargetEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -97,7 +97,7 @@ public int NewAutoResetTime
}
///
- /// Gets or sets a value indicating whether or not the interaction is allowed.
+ /// Gets or sets a value indicating whether the interaction is allowed.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/IntercomSpeakingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/IntercomSpeakingEventArgs.cs
index 49b605ac0..d17296909 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/IntercomSpeakingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/IntercomSpeakingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -37,7 +37,7 @@ public IntercomSpeakingEventArgs(Player player, bool isAllowed = true)
public Player Player { get; }
///
- /// Gets or sets a value indicating whether or not the player can speak on the intercom.
+ /// Gets or sets a value indicating whether the player can speak on the intercom.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/IssuingMuteEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/IssuingMuteEventArgs.cs
index 19cf623e1..71c4cef39 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/IssuingMuteEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/IssuingMuteEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -41,12 +41,12 @@ public IssuingMuteEventArgs(Player player, bool isIntercom, bool isAllowed = tru
public Player Player { get; }
///
- /// Gets or sets a value indicating whether the player is being intercom muted or not.
+ /// Gets or sets a value indicating whether the player is being intercom muted.
///
public bool IsIntercom { get; set; }
///
- /// Gets or sets a value indicating whether or not the player can be muted.
+ /// Gets or sets a value indicating whether the player can be muted.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ItemAddedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ItemAddedEventArgs.cs
index 857afc87d..68c5aca0d 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ItemAddedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ItemAddedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ItemRemovedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ItemRemovedEventArgs.cs
index 0ae4c68b9..ef0dc9a53 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ItemRemovedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ItemRemovedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/JoinedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/JoinedEventArgs.cs
index 03782dfd4..64b15a688 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/JoinedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/JoinedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/JumpingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/JumpingEventArgs.cs
index 7717acc0b..0a1c34b63 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/JumpingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/JumpingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/KickedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/KickedEventArgs.cs
index bf7f0c3be..b99b6051b 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/KickedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/KickedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs
index 595ae1694..036b2aa4c 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs
@@ -1,14 +1,12 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Player
{
- using System;
- using System.Linq;
using System.Reflection;
using API.Features;
@@ -76,17 +74,12 @@ public Player Target
public string Reason { get; set; }
///
- /// Gets or sets the full kick message.
+ /// Gets the full kick message.
///
- public string FullMessage
- {
- get => startkickmessage + Reason;
- [Obsolete("this will be remove use Reason instead of FullMessage")]
- set => Reason = value.StartsWith(startkickmessage) ? value.Remove(0, startkickmessage.Count()) : value;
- }
+ public string FullMessage => startkickmessage + Reason;
///
- /// Gets or sets a value indicating whether or not action is taken against the target.
+ /// Gets or sets a value indicating whether action is taken against the target.
///
public bool IsAllowed
{
diff --git a/EXILED/Exiled.Events/EventArgs/Player/KillingPlayerEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/KillingPlayerEventArgs.cs
deleted file mode 100644
index 44aba0c4e..000000000
--- a/EXILED/Exiled.Events/EventArgs/Player/KillingPlayerEventArgs.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
-// Licensed under the CC BY-SA 3.0 license.
-//
-// -----------------------------------------------------------------------
-
-namespace Exiled.Events.EventArgs.Player
-{
- using System;
-
- using Interfaces;
- using PlayerStatsSystem;
-
- ///
- /// Contains all information before player data to kill player is sent.
- ///
- [Obsolete]
- public class KillingPlayerEventArgs : IPlayerEvent
- {
- ///
- /// Initializes a new instance of the class.
- ///
- /// Current player.
- /// DamageHandler instance.
- public KillingPlayerEventArgs(API.Features.Player player, ref DamageHandlerBase handler)
- {
- Player = player;
- Handler = handler;
- }
-
- ///
- /// Gets or sets current player.
- ///
- public API.Features.Player Player { get; set; }
-
- ///
- /// Gets or sets current Damage Handler.
- ///
- public DamageHandlerBase Handler { get; set; }
- }
-}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/LandingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/LandingEventArgs.cs
index 6c980591b..1ef0bac61 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/LandingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/LandingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/LeftEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/LeftEventArgs.cs
index 05fde1f1c..419a18571 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/LeftEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/LeftEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/MakingNoiseEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/MakingNoiseEventArgs.cs
index eb7809255..e0522ed31 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/MakingNoiseEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/MakingNoiseEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/OpeningGeneratorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/OpeningGeneratorEventArgs.cs
index d20813242..f69507e35 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/OpeningGeneratorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/OpeningGeneratorEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -38,7 +38,7 @@ public OpeningGeneratorEventArgs(Player player, Scp079Generator generator, bool
}
///
- /// Gets or sets a value indicating whether or not the generator can be opened.
+ /// Gets or sets a value indicating whether the generator can be opened.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/PickingUpItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/PickingUpItemEventArgs.cs
index 200536dd4..90493c03c 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/PickingUpItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/PickingUpItemEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/PlayingAudioLogEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/PlayingAudioLogEventArgs.cs
index cad328ea2..41574b280 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/PlayingAudioLogEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/PlayingAudioLogEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -32,7 +32,7 @@ public PlayingAudioLogEventArgs(Player player, bool isAllowed = true)
}
///
- /// Gets or sets a value indicating whether or not the audio will start.
+ /// Gets or sets a value indicating whether the audio will start.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/PreAuthenticatingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/PreAuthenticatingEventArgs.cs
index 0b10296f2..9e5ed782e 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/PreAuthenticatingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/PreAuthenticatingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -101,7 +101,7 @@ public PreAuthenticatingEventArgs(
public ConnectionRequest Request { get; }
///
- /// Gets a value indicating whether the player can be authenticated or not.
+ /// Gets a value indicating whether the player can be authenticated.
///
public bool IsAllowed { get; private set; } = true;
@@ -122,7 +122,7 @@ internal PreauthCancellationData CachedPreauthData
/// Delays a pre-authentincating player.
///
/// The seconds of delay.
- /// Indicates whether the delay is forced or not.
+ /// Indicates whether the delay is forced.
public void Delay(byte seconds, bool isForced) =>
CachedPreauthData = PreauthCancellationData.RejectDelay(seconds, isForced);
@@ -130,7 +130,7 @@ public void Delay(byte seconds, bool isForced) =>
/// Redirects a pre-authentincating player.
///
/// The redirection port.
- /// Indicates whether the redirection is forced or not.
+ /// Indicates whether the redirection is forced.
public void Redirect(ushort port, bool isForced) =>
CachedPreauthData = PreauthCancellationData.RejectRedirect(port, isForced);
@@ -139,7 +139,7 @@ public void Redirect(ushort port, bool isForced) =>
///
/// The ban reason.>
/// The ban expiration.
- /// Indicates whether the rejection is forced or not.
+ /// Indicates whether the rejection is forced.
public void RejectBanned(string banReason, DateTime expiration, bool isForced) =>
CachedPreauthData = PreauthCancellationData.RejectBanned(banReason, expiration, isForced);
@@ -148,7 +148,7 @@ public void RejectBanned(string banReason, DateTime expiration, bool isForced) =
///
/// The ban reason.
/// The ban expiration.
- /// Indicates whether the rejection is forced or not.
+ /// Indicates whether the rejection is forced.
public void RejectBanned(string banReason, long expiration, bool isForced) =>
CachedPreauthData = PreauthCancellationData.RejectBanned(banReason, expiration, isForced);
@@ -156,7 +156,7 @@ public void RejectBanned(string banReason, long expiration, bool isForced) =>
/// Rejects a pre-authentincating player.
///
/// The rejection custom reason.
- /// Indicates whether the rejection is forced or not.
+ /// Indicates whether the rejection is forced.
public void Reject(string customReason, bool isForced) =>
CachedPreauthData = PreauthCancellationData.Reject(customReason, isForced);
@@ -164,7 +164,7 @@ public void Reject(string customReason, bool isForced) =>
/// Rejects a pre-authentincating player.
///
/// The .
- /// Indicates whether the rejection is forced or not.
+ /// Indicates whether the rejection is forced.
public void Reject(RejectionReason reason, bool isForced) =>
CachedPreauthData = PreauthCancellationData.Reject(reason, isForced);
@@ -173,7 +173,7 @@ public void Reject(RejectionReason reason, bool isForced) =>
/// Delays the connection.
///
/// The delay in seconds.
- /// Indicates whether the player has to be rejected forcefully or not.
+ /// Indicates whether the player has to be rejected forcefully.
public void Delay(byte seconds, bool isForced)
{
if (seconds is < 1 or > 25)
@@ -186,7 +186,7 @@ public void Delay(byte seconds, bool isForced)
/// Rejects the player and redirects them to another server port.
///
/// The new server port.
- /// Indicates whether the player has to be rejected forcefully or not.
+ /// Indicates whether the player has to be rejected forcefully.
public void Redirect(ushort port, bool isForced) => Reject(RejectionReason.Redirect, isForced, null, 0, 0, port);
///
@@ -194,7 +194,7 @@ public void Delay(byte seconds, bool isForced)
///
/// The ban reason.
/// The ban expiration time.
- /// Indicates whether the player has to be rejected forcefully or not.
+ /// Indicates whether the player has to be rejected forcefully.
public void RejectBanned(string banReason, DateTime expiration, bool isForced) => Reject(RejectionReason.Banned, isForced, banReason, expiration.Ticks);
///
@@ -202,14 +202,14 @@ public void Delay(byte seconds, bool isForced)
///
/// The ban reason.
/// The ban expiration time in .NET Ticks.
- /// Indicates whether the player has to be rejected forcefully or not.
+ /// Indicates whether the player has to be rejected forcefully.
public void RejectBanned(string banReason, long expiration, bool isForced) => Reject(RejectionReason.Banned, isForced, banReason, expiration);
///
/// Rejects a player who's trying to authenticate.
///
/// The instance.
- /// Indicates whether the player has to be rejected forcefully or not.
+ /// Indicates whether the player has to be rejected forcefully.
public void Reject(NetDataWriter writer, bool isForced)
{
if (!IsAllowed)
@@ -227,14 +227,14 @@ public void Reject(NetDataWriter writer, bool isForced)
/// Rejects a player who's trying to authenticate.
///
/// The custom rejection reason.
- /// Indicates whether the player has to be rejected forcefully or not.
+ /// Indicates whether the player has to be rejected forcefully.
public void Reject(string rejectionReason, bool isForced) => Reject(RejectionReason.Custom, isForced, rejectionReason);
///
/// Rejects a player who's trying to authenticate.
///
/// The rejection reason.
- /// Indicates whether the player has to be rejected forcefully or not.
+ /// Indicates whether the player has to be rejected forcefully.
/// The custom rejection reason (Banned and Custom reasons only).
/// The ban expiration ticks (Banned reason only).
/// The delay in seconds (Delay reason only).
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ReceivingEffectEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ReceivingEffectEventArgs.cs
index 696f4ff0c..168a0f578 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ReceivingEffectEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ReceivingEffectEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -74,7 +74,7 @@ public byte Intensity
public byte CurrentIntensity { get; }
///
- /// Gets or sets a value indicating whether or not the effect will be applied.
+ /// Gets or sets a value indicating whether the effect will be applied.
///
public bool IsAllowed { get; set; } = true;
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ReloadingWeaponEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ReloadingWeaponEventArgs.cs
index 3fa8ba3ec..0dde302a9 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ReloadingWeaponEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ReloadingWeaponEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -37,7 +37,7 @@ public ReloadingWeaponEventArgs(Player player, Firearm firearm, bool isAllowed =
}
///
- /// Gets or sets a value indicating whether or not the weapon can be reloaded.
+ /// Gets or sets a value indicating whether the weapon can be reloaded.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/RemovedHandcuffsEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/RemovedHandcuffsEventArgs.cs
index ee152fb34..cef326e42 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/RemovedHandcuffsEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/RemovedHandcuffsEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/RemovingHandcuffsEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/RemovingHandcuffsEventArgs.cs
index c375bb4b7..782d77f0f 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/RemovingHandcuffsEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/RemovingHandcuffsEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -22,7 +22,7 @@ public class RemovingHandcuffsEventArgs : IPlayerEvent, IDeniableEvent
/// The cuffer player.
/// The target player to be uncuffed.
/// The reason of removing handcuffs.
- /// Indicates whether the event can be executed or not.
+ /// Indicates whether the event can be executed.
public RemovingHandcuffsEventArgs(Player cuffer, Player target, UncuffReason uncuffReason, bool isAllowed = true)
{
Player = cuffer;
@@ -37,7 +37,7 @@ public RemovingHandcuffsEventArgs(Player cuffer, Player target, UncuffReason unc
public Player Target { get; }
///
- /// Gets or sets a value indicating whether or not the player can be handcuffed. Denying the event will only have an effect when is until next major update.
+ /// Gets or sets a value indicating whether the player can be handcuffed. Denying the event will only have an effect when is until next major update.
///
/// TODO: Update docs and patches
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ReservedSlotsCheckEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ReservedSlotsCheckEventArgs.cs
index db722959b..47861a038 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ReservedSlotsCheckEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ReservedSlotsCheckEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/RevokingMuteEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/RevokingMuteEventArgs.cs
index 52dd71aef..eb3251599 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/RevokingMuteEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/RevokingMuteEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -21,10 +21,10 @@ public class RevokingMuteEventArgs : IssuingMuteEventArgs
/// The player who's being unmuted.
///
///
- /// Indicates whether the player is being intercom unmuted or not.
+ /// Indicates whether the player is being intercom unmuted.
///
///
- /// Indicates whether or not the player can be unmuted.
+ /// Indicates whether the player can be unmuted.
///
public RevokingMuteEventArgs(Player player, bool isIntercom, bool isAllowed = true)
: base(player, isIntercom, isAllowed)
diff --git a/EXILED/Exiled.Events/EventArgs/Player/SearchingPickupEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/SearchingPickupEventArgs.cs
index 58e9f4762..c714df950 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/SearchingPickupEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/SearchingPickupEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/SendingAdminChatMessageEventsArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/SendingAdminChatMessageEventsArgs.cs
index ba65b6d79..6096eb5dd 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/SendingAdminChatMessageEventsArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/SendingAdminChatMessageEventsArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ShootingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ShootingEventArgs.cs
index 9802b8330..3c2f9d12b 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ShootingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ShootingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -8,106 +8,72 @@
namespace Exiled.Events.EventArgs.Player
{
using API.Features;
-
using Exiled.API.Features.Items;
-
using Interfaces;
-
- using InventorySystem.Items.Firearms.BasicMessages;
-
- using RelativePositioning;
-
+ using InventorySystem.Items.Firearms.Modules.Misc;
using UnityEngine;
using BaseFirearm = InventorySystem.Items.Firearms.Firearm;
///
/// Contains all information before a player fires a weapon.
+ /// ClaimedTarget and Player transform values are modified by according to sent by the Player and do not match the actual values.
///
public class ShootingEventArgs : IPlayerEvent, IDeniableEvent, IFirearmEvent
{
///
/// Initializes a new instance of the class.
///
- ///
- ///
- ///
///
- ///
+ /// The that is being fired.
///
- ///
- ///
+ ///
+ /// sent by the client.
///
- public ShootingEventArgs(Player shooter, BaseFirearm firearm, ShotMessage msg)
+ public ShootingEventArgs(BaseFirearm firearm, ref ShotBacktrackData shotBacktrackData)
{
- Player = shooter;
- Firearm = Item.Get(firearm).As();
- ShotMessage = msg;
+ Firearm = (Firearm)Item.Get(firearm);
+ Player = Firearm.Owner;
+ ShotBacktrackData = shotBacktrackData;
}
///
- /// Gets the player who's shooting.
+ /// Gets the player who is shooting.
///
public Player Player { get; }
///
- /// Gets the target .
+ /// Gets the target that client claims it hit.
///
- public Firearm Firearm { get; }
-
- ///
- public Item Item => Firearm;
+ /// This value is controlled by the shooting player and should not be trusted. Can be null.
+ public Player ClaimedTarget => ShotBacktrackData.HasPrimaryTarget ? Player.Get(ShotBacktrackData.PrimaryTargetHub) : null;
///
- /// Gets or sets the for the event.
+ /// Gets the . This object contains the data sent by the client to the server.
///
- public ShotMessage ShotMessage { get; set; }
+ /// Values are controlled by the shooting player and should not be trusted.
+ public ShotBacktrackData ShotBacktrackData { get; }
///
- /// Gets or sets the position of the shot.
+ /// Gets or sets the exact direction of the shot before the bullet spread is applied.
///
- public Vector3 ShotPosition
+ public Vector3 Direction
{
- get => ShotMessage.TargetPosition.Position;
- set
- {
- ShotMessage msg = ShotMessage;
- ShotMessage = new ShotMessage
- {
- ShooterPosition = msg.ShooterPosition,
- ShooterCameraRotation = msg.ShooterCameraRotation,
- ShooterWeaponSerial = msg.ShooterWeaponSerial,
- TargetPosition = new RelativePosition(value),
- TargetRotation = msg.TargetRotation,
- TargetNetId = msg.TargetNetId,
- };
- }
+ get => Player.CameraTransform.forward;
+ set => Player.CameraTransform.forward = value; // It is going to be reset by FpcBacktracker the same frame, so why we can set it freely.
}
///
- /// Gets or sets the netId of the target of the shot.
+ /// Gets the firearm that is being fired.
///
- public uint TargetNetId
- {
- get => ShotMessage.TargetNetId;
- set
- {
- ShotMessage msg = ShotMessage;
- ShotMessage = new ShotMessage
- {
- ShooterPosition = msg.ShooterPosition,
- ShooterCameraRotation = msg.ShooterCameraRotation,
- ShooterWeaponSerial = msg.ShooterWeaponSerial,
- TargetPosition = msg.TargetPosition,
- TargetRotation = msg.TargetRotation,
- TargetNetId = value,
- };
- }
- }
+ public Firearm Firearm { get; }
+
+ ///
+ public Item Item => Firearm;
///
- /// Gets or sets a value indicating whether or not the shot can be fired.
+ /// Gets or sets a value indicating whether the shot can be fired.
///
public bool IsAllowed { get; set; } = true;
}
-}
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ShotEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ShotEventArgs.cs
index 288d3c3f7..0eb6a5c69 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ShotEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ShotEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -10,7 +10,7 @@ namespace Exiled.Events.EventArgs.Player
using API.Features;
using Exiled.API.Features.Items;
using Interfaces;
-
+ using InventorySystem.Items.Firearms.Modules;
using UnityEngine;
///
@@ -19,44 +19,36 @@ namespace Exiled.Events.EventArgs.Player
public class ShotEventArgs : IPlayerEvent, IFirearmEvent
{
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
- ///
- ///
- ///
- ///
- ///
- ///
- /// The hit.
- ///
- ///
- ///
- ///
- ///
- ///
- public ShotEventArgs(Player shooter, Firearm firearm, RaycastHit hit, IDestructible destructible, float damage)
+ /// Hitreg module that calculated the shot.
+ /// Raycast hit info.
+ /// The firearm used.
+ /// The IDestructible that was hit. Can be null.
+ public ShotEventArgs(HitscanHitregModuleBase hitregModule, RaycastHit hitInfo, InventorySystem.Items.Firearms.Firearm firearm, IDestructible destructible)
{
- Player = shooter;
- Firearm = firearm;
- Damage = damage;
- Distance = hit.distance;
- Position = hit.point;
- RaycastHit = hit;
-
- if (destructible is HitboxIdentity identity)
+ HitregModule = hitregModule;
+ RaycastHit = hitInfo;
+ Destructible = destructible;
+ Firearm = Item.Get(firearm);
+
+ Player = Firearm.Owner;
+ Damage = Destructible is not null ? HitregModule.DamageAtDistance(hitInfo.distance) : 0f;
+
+ if (Destructible is HitboxIdentity hitboxIdentity)
{
- Hitbox = identity;
+ Hitbox = hitboxIdentity;
Target = Player.Get(Hitbox.TargetHub);
}
}
///
- /// Gets the player who shot.
+ /// Gets the player who fired the shot.
///
public Player Player { get; }
///
- /// Gets the firearm used to shoot.
+ /// Gets the firearm used to fire the shot.
///
public Firearm Firearm { get; }
@@ -64,38 +56,53 @@ public ShotEventArgs(Player shooter, Firearm firearm, RaycastHit hit, IDestructi
public Item Item => Firearm;
///
- /// Gets the hitbox type of the shot. Can be !.
+ /// Gets the firearm hitreg module responsible for the shot.
///
- public HitboxIdentity Hitbox { get; }
+ public HitscanHitregModuleBase HitregModule { get; }
///
- /// Gets or sets the inflicted damage.
+ /// Gets the raycast info.
///
- public float Damage { get; set; }
+ public RaycastHit RaycastHit { get; }
///
- /// Gets the shot distance.
+ /// Gets the bullet travel distance.
///
- public float Distance { get; }
+ public float Distance => RaycastHit.distance;
///
- /// Gets the shot position.
+ /// Gets the position of the hit.
///
- public Vector3 Position { get; }
+ public Vector3 Position => RaycastHit.point;
///
- /// Gets the raycast result.
+ /// Gets the firearm base damage at the hit distance. Actual inflicted damage may vary.
///
- public RaycastHit RaycastHit { get; }
+ public float Damage { get; }
///
- /// Gets the target of the shot. Can be !.
+ /// Gets the target player. Can be null.
///
public Player Target { get; }
///
- /// Gets or sets a value indicating whether or not the shot can hurt the target.
+ /// Gets the component of the target player that was hit. Can be null.
+ ///
+ public HitboxIdentity Hitbox { get; }
+
+ ///
+ /// Gets the component of the hit collider. Can be null.
+ ///
+ public IDestructible Destructible { get; }
+
+ ///
+ /// Gets or sets a value indicating whether the shot can deal damage.
///
public bool CanHurt { get; set; } = true;
+
+ ///
+ /// Gets or sets a value indicating whether the shot can produce impact effects (e.g. bullet holes).
+ ///
+ public bool CanSpawnImpactEffects { get; set; } = true;
}
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/SpawnedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/SpawnedEventArgs.cs
index 094b5406a..aa231bce4 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/SpawnedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/SpawnedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/SpawnedRagdollEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/SpawnedRagdollEventArgs.cs
index 497d25e9e..b2020678c 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/SpawnedRagdollEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/SpawnedRagdollEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/SpawningEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/SpawningEventArgs.cs
index ab972e705..bc543dc58 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/SpawningEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/SpawningEventArgs.cs
@@ -1,17 +1,18 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Player
{
+ using System;
+
using Exiled.API.Features;
using Exiled.API.Features.Roles;
using Exiled.Events.EventArgs.Interfaces;
using PlayerRoles;
-
using UnityEngine;
///
@@ -31,15 +32,15 @@ public class SpawningEventArgs : IPlayerEvent
///
///
///
- ///
- /// the spawned player's old role.
+ ///
+ /// the spawned player's new role.
///
- public SpawningEventArgs(Player player, Vector3 position, float rotation, PlayerRoleBase oldRole)
+ public SpawningEventArgs(Player player, Vector3 position, float rotation, PlayerRoleBase newRole)
{
Player = player;
Position = position;
HorizontalRotation = rotation;
- OldRole = Role.Create(oldRole);
+ NewRole = Role.Create(newRole);
}
///
@@ -66,6 +67,12 @@ public SpawningEventArgs(Player player, Vector3 position, float rotation, Player
///
/// Gets the player's old role.
///
+ [Obsolete("Removed because the method is no longer provide OldRole since version 14.0. Use Player.Role instead")]
public Role OldRole { get; }
+
+ ///
+ /// Gets the player's new role.
+ ///
+ public Role NewRole { get; }
}
-}
\ No newline at end of file
+}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/SpawningRagdollEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/SpawningRagdollEventArgs.cs
index b486a892f..e12dc914a 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/SpawningRagdollEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/SpawningRagdollEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -100,7 +100,7 @@ public DamageHandlerBase DamageHandlerBase
}
///
- /// Gets or sets a value indicating whether or not the ragdoll can be spawned.
+ /// Gets or sets a value indicating whether the ragdoll can be spawned.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/StayingOnEnvironmentalHazardEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/StayingOnEnvironmentalHazardEventArgs.cs
index 1694461db..002e6a9b8 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/StayingOnEnvironmentalHazardEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/StayingOnEnvironmentalHazardEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/StoppingGeneratorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/StoppingGeneratorEventArgs.cs
index addeb79ad..53f0d9ecf 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/StoppingGeneratorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/StoppingGeneratorEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -21,7 +21,7 @@ public class StoppingGeneratorEventArgs : IPlayerEvent, IGeneratorEvent, IDeniab
///
/// The player who's flipping the switch.
/// The instance.
- /// Indicates whether or not the switch of the generator can be flipped.
+ /// Indicates whether the switch of the generator can be flipped.
public StoppingGeneratorEventArgs(Player player, Scp079Generator generator, bool isAllowed = true)
{
Player = player;
@@ -30,7 +30,7 @@ public StoppingGeneratorEventArgs(Player player, Scp079Generator generator, bool
}
///
- /// Gets or sets a value indicating whether or not the switch can be flipped.
+ /// Gets or sets a value indicating whether the switch can be flipped.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ThrowingRequestEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ThrowingRequestEventArgs.cs
index 089695333..586cc15f5 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ThrowingRequestEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ThrowingRequestEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/ThrownProjectileEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ThrownProjectileEventArgs.cs
index 26984b839..7da1528af 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/ThrownProjectileEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/ThrownProjectileEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/TogglingFlashlightEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/TogglingFlashlightEventArgs.cs
index 3a87a66a1..183476b48 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/TogglingFlashlightEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/TogglingFlashlightEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -49,12 +49,12 @@ public TogglingFlashlightEventArgs(ReferenceHub hub, ToggleableLightItemBase fla
public Item Item => Flashlight;
///
- /// Gets or sets a value indicating whether or not the flashlight should be on.
+ /// Gets or sets a value indicating whether the flashlight should be on.
///
public bool NewState { get; set; }
///
- /// Gets or sets a value indicating whether or not the player can toggle the flashlight.
+ /// Gets or sets a value indicating whether the player can toggle the flashlight.
///
public bool IsAllowed
{
diff --git a/EXILED/Exiled.Events/EventArgs/Player/TogglingNoClipEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/TogglingNoClipEventArgs.cs
index ee1b858d8..78144567e 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/TogglingNoClipEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/TogglingNoClipEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -41,12 +41,12 @@ public TogglingNoClipEventArgs(Player player, bool newValue, bool isAllowed = tr
public Player Player { get; }
///
- /// Gets or sets a value indicating whether or not the noclip mode will be enabled or not.
+ /// Gets or sets a value indicating whether the noclip mode will be enabled.
///
public bool IsEnabled { get; set; }
///
- /// Gets or sets a value indicating whether or not the player can toggle noclip.
+ /// Gets or sets a value indicating whether the player can toggle noclip.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/TogglingOverwatchEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/TogglingOverwatchEventArgs.cs
index 2b3dfc54d..0db7c7f95 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/TogglingOverwatchEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/TogglingOverwatchEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -43,12 +43,12 @@ public TogglingOverwatchEventArgs(API.Features.Player player, byte newValue)
public API.Features.Player Player { get; }
///
- /// Gets or sets a value indicating whether overwatch will be enabled or not.
+ /// Gets or sets a value indicating whether overwatch will be enabled.
///
public bool IsEnabled { get; set; }
///
- /// Gets or sets a value indicating whether the event is allowed or not.
+ /// Gets or sets a value indicating whether the event is allowed.
///
public bool IsAllowed { get; set; } = true;
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/TogglingRadioEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/TogglingRadioEventArgs.cs
index 38d0fe09b..7b0c68d7a 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/TogglingRadioEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/TogglingRadioEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/TogglingWeaponFlashlightEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/TogglingWeaponFlashlightEventArgs.cs
index 1335fe0bb..3c6f2f788 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/TogglingWeaponFlashlightEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/TogglingWeaponFlashlightEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -12,6 +12,8 @@ namespace Exiled.Events.EventArgs.Player
using Interfaces;
+ using BaseFirearm = InventorySystem.Items.Firearms.Firearm;
+
///
/// Contains all information before a player toggles the weapon's flashlight.
///
@@ -20,24 +22,17 @@ public class TogglingWeaponFlashlightEventArgs : IPlayerEvent, IFirearmEvent, ID
///
/// Initializes a new instance of the class.
///
- ///
- ///
- ///
///
///
///
- ///
+ ///
///
///
- ///
- ///
- ///
- public TogglingWeaponFlashlightEventArgs(Player player, Firearm firearm, bool newState, bool isAllowed = true)
+ public TogglingWeaponFlashlightEventArgs(BaseFirearm firearm, bool oldState)
{
- Firearm = firearm;
- Player = player;
- NewState = newState;
- IsAllowed = isAllowed;
+ Firearm = Item.Get(firearm);
+ Player = Firearm.Owner;
+ NewState = !oldState;
}
///
@@ -46,9 +41,9 @@ public TogglingWeaponFlashlightEventArgs(Player player, Firearm firearm, bool ne
public bool NewState { get; set; }
///
- /// Gets or sets a value indicating whether or not the weapon's flashlight can be toggled.
+ /// Gets or sets a value indicating whether the weapon's flashlight can be toggled.
///
- public bool IsAllowed { get; set; }
+ public bool IsAllowed { get; set; } = true;
///
/// Gets the being held.
diff --git a/EXILED/Exiled.Events/EventArgs/Player/TransmittingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/TransmittingEventArgs.cs
index 3a1b3617c..96e1ffde4 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/TransmittingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/TransmittingEventArgs.cs
@@ -1,14 +1,12 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Player
{
- using System;
-
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
@@ -49,13 +47,7 @@ public TransmittingEventArgs(Player player, VoiceModuleBase voiceModule, bool is
public VoiceModuleBase VoiceModule { get; }
///
- /// Gets a value indicating whether or not the player is transmitting.
- ///
- [Obsolete("IsTransmitting is always true.")]
- public bool IsTransmitting => true;
-
- ///
- /// Gets or sets a value indicating whether or not the player can transmit.
+ /// Gets or sets a value indicating whether the player can transmit.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/TriggeringTeslaEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/TriggeringTeslaEventArgs.cs
index ad71df8d1..6c897ba95 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/TriggeringTeslaEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/TriggeringTeslaEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -34,17 +34,17 @@ public TriggeringTeslaEventArgs(Player player, TeslaGate teslaGate)
}
///
- /// Gets or sets a value indicating whether or not the player is in hurting range.
+ /// Gets or sets a value indicating whether the player is in hurting range.
///
public bool IsInHurtingRange { get; set; }
///
- /// Gets or sets a value indicating whether or not the player will cause the tesla going to be idle.
+ /// Gets or sets a value indicating whether the player will cause the tesla going to be idle.
///
public bool IsInIdleRange { get; set; } = true;
///
- /// Gets or sets a value indicating whether or not the player will cause the tesla going to be activated.
+ /// Gets or sets a value indicating whether the player will cause the tesla going to be activated.
///
public bool IsTriggerable { get; set; }
@@ -59,12 +59,12 @@ public TriggeringTeslaEventArgs(Player player, TeslaGate teslaGate)
public TeslaGate Tesla { get; }
///
- /// Gets or sets a value indicating whether or not the player will be detected by the tesla.
+ /// Gets or sets a value indicating whether the player will be detected by the tesla.
///
public bool IsAllowed { get; set; } = true;
///
- /// Gets or sets a value indicating whether or not the tesla will be deactivated.
+ /// Gets or sets a value indicating whether the tesla will be deactivated.
///
public bool DisableTesla { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/UnloadingWeaponEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/UnloadingWeaponEventArgs.cs
index c16b1131f..a5c8df5f0 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/UnloadingWeaponEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/UnloadingWeaponEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -37,7 +37,7 @@ public UnloadingWeaponEventArgs(Player player, Firearm firearm, bool isAllowed =
}
///
- /// Gets or sets a value indicating whether or not the weapon can be unloaded.
+ /// Gets or sets a value indicating whether the weapon can be unloaded.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/UnlockingGeneratorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/UnlockingGeneratorEventArgs.cs
index 5a42e3014..422def506 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/UnlockingGeneratorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/UnlockingGeneratorEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -38,7 +38,7 @@ public UnlockingGeneratorEventArgs(Player player, Scp079Generator generator, boo
}
///
- /// Gets or sets a value indicating whether or not the generator can be unlocked.
+ /// Gets or sets a value indicating whether the generator can be unlocked.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/UsedItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/UsedItemEventArgs.cs
index 2618d4a5d..e25e9fd72 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/UsedItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/UsedItemEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/UsingItemCompletedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/UsingItemCompletedEventArgs.cs
index a0f86dd04..027d0a36c 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/UsingItemCompletedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/UsingItemCompletedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -45,7 +45,7 @@ public UsingItemCompletedEventArgs(Player player, UsableItem item)
public Player Player { get; }
///
- /// Gets or sets a value indicating whether or not the player can use the item.
+ /// Gets or sets a value indicating whether the player can use the item.
///
public bool IsAllowed { get; set; } = true;
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/UsingItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/UsingItemEventArgs.cs
index 708a58f8a..6165eb35c 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/UsingItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/UsingItemEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -54,7 +54,7 @@ public UsingItemEventArgs(Player player, UsableItem item, float cooldown)
public float Cooldown { get; set; }
///
- /// Gets or sets a value indicating whether or not the player can use the item.
+ /// Gets or sets a value indicating whether the player can use the item.
///
public bool IsAllowed { get; set; } = true;
}
diff --git a/EXILED/Exiled.Events/EventArgs/Player/UsingMicroHIDEnergyEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/UsingMicroHIDEnergyEventArgs.cs
index 402d20e1b..86e76a2e7 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/UsingMicroHIDEnergyEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/UsingMicroHIDEnergyEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -17,32 +17,24 @@ namespace Exiled.Events.EventArgs.Player
///
/// Contains all information before MicroHID energy is changed.
///
- public class UsingMicroHIDEnergyEventArgs : IPlayerEvent, IDeniableEvent, IItemEvent
+ public class UsingMicroHIDEnergyEventArgs : IDeniableEvent, IItemEvent
{
///
/// Initializes a new instance of the class.
///
- ///
- ///
- ///
///
///
///
- ///
- ///
- ///
- ///
+ ///
///
///
///
///
///
- public UsingMicroHIDEnergyEventArgs(Player player, MicroHIDItem microHIDitem, HidState currentState, float drain, bool isAllowed = true)
+ public UsingMicroHIDEnergyEventArgs(MicroHIDItem microHIDitem, float newEnergy, bool isAllowed = true)
{
- Player = player;
MicroHID = Item.Get(microHIDitem);
- CurrentState = currentState;
- Drain = drain;
+ Drain = MicroHID.Energy - newEnergy;
IsAllowed = isAllowed;
}
@@ -54,24 +46,14 @@ public UsingMicroHIDEnergyEventArgs(Player player, MicroHIDItem microHIDitem, Hi
///
public Item Item => MicroHID;
- ///
- /// Gets the current state of the MicroHID.
- ///
- public HidState CurrentState { get; }
-
///
/// Gets or sets the MicroHID energy drain.
///
public float Drain { get; set; }
///
- /// Gets or sets a value indicating whether the MicroHID energy can be changed or not.
+ /// Gets or sets a value indicating whether the MicroHID energy can be changed.
///
public bool IsAllowed { get; set; }
-
- ///
- /// Gets the player who's using the MicroHID.
- ///
- public Player Player { get; }
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/UsingRadioBatteryEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/UsingRadioBatteryEventArgs.cs
index 1f07dadde..ae1995da4 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/UsingRadioBatteryEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/UsingRadioBatteryEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -56,7 +56,7 @@ public UsingRadioBatteryEventArgs(RadioItem radio, Player player, float drain, b
public float Drain { get; set; }
///
- /// Gets or sets a value indicating whether the radio battery charge can be changed or not.
+ /// Gets or sets a value indicating whether the radio battery charge can be changed.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Player/VerifiedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/VerifiedEventArgs.cs
index 28ae41d50..ec1d84136 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/VerifiedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/VerifiedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Player/VoiceChattingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/VoiceChattingEventArgs.cs
index 3b0e90bb8..c67e7bb72 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/VoiceChattingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Player/VoiceChattingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -58,7 +58,7 @@ public VoiceChattingEventArgs(Player player, VoiceMessage voiceMessage, VoiceMod
public VoiceModuleBase VoiceModule { get; }
///
- /// Gets or sets a value indicating whether or not the player can voicechat.
+ /// Gets or sets a value indicating whether the player can voicechat.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp049/ActivatingSenseEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp049/ActivatingSenseEventArgs.cs
index 8a8b719be..c8ae4fdae 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp049/ActivatingSenseEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp049/ActivatingSenseEventArgs.cs
@@ -1,16 +1,13 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Scp049
{
- using System;
-
using API.Features;
- using Exiled.API.Features.Roles;
using Exiled.Events.EventArgs.Interfaces;
using Scp049Role = API.Features.Roles.Scp049Role;
@@ -54,19 +51,13 @@ public ActivatingSenseEventArgs(Player player, Player target, bool isAllowed = t
///
public float FailedCooldown { get; set; }
- ///
- /// Gets or sets the cooldown of the ability.
- ///
- [Obsolete("Use FailedCooldown instead of this")]
- public float Cooldown { get => FailedCooldown; set => FailedCooldown = value; }
-
///
/// Gets or sets the duration of the Effect.
///
public float Duration { get; set; }
///
- /// Gets or sets a value indicating whether or not the server will send 049 information on the recall.
+ /// Gets or sets a value indicating whether the server will send 049 information on the recall.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp049/AttackingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp049/AttackingEventArgs.cs
index b7ed8dde0..4a374e725 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp049/AttackingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp049/AttackingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -44,7 +44,7 @@ public AttackingEventArgs(Player player, Player target, bool isAllowed = true)
public Player Target { get; }
///
- /// Gets or sets a value indicating whether or not target can be attacked.
+ /// Gets or sets a value indicating whether target can be attacked.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp049/FinishingRecallEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp049/FinishingRecallEventArgs.cs
index e897dbb04..fc773a7fc 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp049/FinishingRecallEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp049/FinishingRecallEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -60,7 +60,7 @@ public FinishingRecallEventArgs(Player target, Player scp049, BasicRagdoll ragdo
public Ragdoll Ragdoll { get; }
///
- /// Gets or sets a value indicating whether or not the player can be revived.
+ /// Gets or sets a value indicating whether the player can be revived.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp049/SendingCallEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp049/SendingCallEventArgs.cs
index cd882d151..2d302846c 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp049/SendingCallEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp049/SendingCallEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -43,7 +43,7 @@ public SendingCallEventArgs(Player player, bool isAllowed = true)
public float Duration { get; set; }
///
- /// Gets or sets a value indicating whether or not the server will send 049 information on the call.
+ /// Gets or sets a value indicating whether the server will send 049 information on the call.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp049/StartingRecallEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp049/StartingRecallEventArgs.cs
index 66fad5dc3..93757c990 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp049/StartingRecallEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp049/StartingRecallEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp0492/ConsumedCorpseEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp0492/ConsumedCorpseEventArgs.cs
index c3d33374c..56aff95ac 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp0492/ConsumedCorpseEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp0492/ConsumedCorpseEventArgs.cs
@@ -1,14 +1,12 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Scp0492
{
- using System;
-
using API.Features;
using Exiled.API.Features.Roles;
using Interfaces;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp0492/ConsumingCorpseEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp0492/ConsumingCorpseEventArgs.cs
index d398e147a..008ef8359 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp0492/ConsumingCorpseEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp0492/ConsumingCorpseEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp0492/TriggeringBloodlustEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp0492/TriggeringBloodlustEventArgs.cs
index 8ce235fbd..e0e57eccd 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp0492/TriggeringBloodlustEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp0492/TriggeringBloodlustEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/ChangingCameraEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/ChangingCameraEventArgs.cs
index 88e154243..aedf2662d 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/ChangingCameraEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/ChangingCameraEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -58,8 +58,8 @@ public ChangingCameraEventArgs(Player player, Scp079Camera camera, float auxilia
public Camera Camera { get; set; }
///
- /// Gets or sets a value indicating whether or not SCP-079 can switch cameras.
- /// Defaults to a value describing whether or not SCP-079 has enough auxiliary power to switch.
+ /// Gets or sets a value indicating whether SCP-079 can switch cameras.
+ /// Defaults to a value describing whether SCP-079 has enough auxiliary power to switch.
/// Can be set to to allow a switch regardless of SCP-079's auxiliary power amount.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/ChangingSpeakerStatusEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/ChangingSpeakerStatusEventArgs.cs
index 5b4002366..d827bbd25 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/ChangingSpeakerStatusEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/ChangingSpeakerStatusEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/ElevatorTeleportingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/ElevatorTeleportingEventArgs.cs
index 55ad118fa..85907c0db 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/ElevatorTeleportingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/ElevatorTeleportingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -29,18 +29,18 @@ public class ElevatorTeleportingEventArgs : IScp079Event, IRoomEvent, IDeniableE
///
///
///
- ///
+ ///
///
///
///
///
///
- public ElevatorTeleportingEventArgs(Player player, RoomIdentifier room, ElevatorDoor elevatorDoor, float auxiliaryPowerCost)
+ public ElevatorTeleportingEventArgs(Player player, RoomIdentifier room, ElevatorChamber elevatorChamber, float auxiliaryPowerCost)
{
Player = player;
Scp079 = player.Role.As();
Room = Room.Get(room);
- Lift = Lift.Get(elevatorDoor.TargetPanel.AssignedChamber);
+ Lift = Lift.Get(elevatorChamber);
AuxiliaryPowerCost = auxiliaryPowerCost;
IsAllowed = auxiliaryPowerCost <= Scp079.Energy;
}
@@ -69,8 +69,8 @@ public ElevatorTeleportingEventArgs(Player player, RoomIdentifier room, Elevator
public Lift Lift { get; }
///
- /// Gets or sets a value indicating whether or not SCP-079 can teleport.
- /// Defaults to a describing whether or not SCP-079 has enough auxiliary power to teleport.
+ /// Gets or sets a value indicating whether SCP-079 can teleport.
+ /// Defaults to a describing whether SCP-079 has enough auxiliary power to teleport.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/GainingExperienceEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/GainingExperienceEventArgs.cs
index dfeae7760..973cbfe84 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/GainingExperienceEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/GainingExperienceEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -64,7 +64,7 @@ public GainingExperienceEventArgs(Player player, Scp079HudTranslation gainType,
public int Amount { get; set; }
///
- /// Gets or sets a value indicating whether or not the experience is successfully granted.
+ /// Gets or sets a value indicating whether the experience is successfully granted.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/GainingLevelEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/GainingLevelEventArgs.cs
index 8548052b8..57eeae5de 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/GainingLevelEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/GainingLevelEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -42,7 +42,7 @@ public GainingLevelEventArgs(Player player, int newLevel, bool isAllowed = true)
public int NewLevel { get; set; }
///
- /// Gets or sets a value indicating whether or not the level is successfully granted.
+ /// Gets or sets a value indicating whether the level is successfully granted.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/InteractingTeslaEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/InteractingTeslaEventArgs.cs
index a22f2d04a..94e98dd6c 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/InteractingTeslaEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/InteractingTeslaEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -58,7 +58,7 @@ public InteractingTeslaEventArgs(Player player, TeslaGate teslaGate, float auxil
public float AuxiliaryPowerCost { get; set; }
///
- /// Gets or sets a value indicating whether or not SCP-079 can interact with the tesla gate.
+ /// Gets or sets a value indicating whether SCP-079 can interact with the tesla gate.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/LockingDownEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/LockingDownEventArgs.cs
index 151b3fd46..88717b58c 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/LockingDownEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/LockingDownEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -58,7 +58,7 @@ public LockingDownEventArgs(Player player, RoomIdentifier roomIdentifier, float
public float AuxiliaryPowerCost { get; set; }
///
- /// Gets or sets a value indicating whether or not SCP-079 can lockdown a room.
+ /// Gets or sets a value indicating whether SCP-079 can lockdown a room.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/PingingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/PingingEventArgs.cs
index 50b4b3935..811dca197 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/PingingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/PingingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -61,7 +61,7 @@ public PingingEventArgs(ReferenceHub hub, RelativePosition position, int powerCo
public Vector3 SyncNormal { get; }
///
- /// Gets or sets a value indicating whether or not the event is allowed to continue.
+ /// Gets or sets a value indicating whether the event is allowed to continue.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/RecontainedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/RecontainedEventArgs.cs
index 49b5dbebd..c897dd1a5 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/RecontainedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/RecontainedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/RecontainingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/RecontainingEventArgs.cs
index 11d88c3f1..5bde59481 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/RecontainingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/RecontainingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -35,7 +35,7 @@ public RecontainingEventArgs(BreakableWindow recontainer)
public bool IsAllowed { get; set; } = true;
///
- /// Gets a value indicating whether or not the recontained has been made automatically or by triggering the proccess.
+ /// Gets a value indicating whether the recontained has been made automatically or by triggering the proccess.
///
public bool IsAutomatic { get; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/RoomBlackoutEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/RoomBlackoutEventArgs.cs
index f1f6c85d5..513a7d266 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/RoomBlackoutEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/RoomBlackoutEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -79,7 +79,7 @@ public RoomBlackoutEventArgs(ReferenceHub player, RoomIdentifier roomIdentifier,
public double Cooldown { get; set; }
///
- /// Gets or sets a value indicating whether or not SCP-079 can black out the room.
+ /// Gets or sets a value indicating whether SCP-079 can black out the room.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/StartingSpeakerEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/StartingSpeakerEventArgs.cs
index b671e4da1..fe160a28a 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/StartingSpeakerEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/StartingSpeakerEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -59,7 +59,7 @@ public StartingSpeakerEventArgs(Player player, Room room, float auxiliaryPowerCo
public float AuxiliaryPowerCost { get; set; }
///
- /// Gets or sets a value indicating whether or not SCP-079 can use the speaker.
+ /// Gets or sets a value indicating whether SCP-079 can use the speaker.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/StoppingSpeakerEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/StoppingSpeakerEventArgs.cs
index 2c69fbc16..9191c4cc0 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/StoppingSpeakerEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/StoppingSpeakerEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -50,7 +50,7 @@ public StoppingSpeakerEventArgs(Player player, Room room, bool isAllowed = true)
public Room Room { get; }
///
- /// Gets or sets a value indicating whether or not SCP-079 can stop using the speaker.
+ /// Gets or sets a value indicating whether SCP-079 can stop using the speaker.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/TriggeringDoorEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/TriggeringDoorEventArgs.cs
index 83d9d4849..e93c97772 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/TriggeringDoorEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/TriggeringDoorEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -41,7 +41,7 @@ public TriggeringDoorEventArgs(Player player, DoorVariant door, float auxiliaryP
}
///
- /// Gets or sets a value indicating whether or not the player can interact with the door.
+ /// Gets or sets a value indicating whether the player can interact with the door.
///
public bool IsAllowed { get; set; } = true;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/ZoneBlackoutEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/ZoneBlackoutEventArgs.cs
index 99adf04f5..6f23053ee 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp079/ZoneBlackoutEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp079/ZoneBlackoutEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -85,7 +85,7 @@ public ZoneBlackoutEventArgs(ReferenceHub player, FacilityZone zone, float auxil
public float Cooldown { get; set; }
///
- /// Gets or sets a value indicating whether or not SCP-079 can lockdown a room.
+ /// Gets or sets a value indicating whether SCP-079 can lockdown a room.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp096/AddingTargetEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp096/AddingTargetEventArgs.cs
index 7a21f77f0..13e0660a7 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp096/AddingTargetEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp096/AddingTargetEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -56,12 +56,12 @@ public AddingTargetEventArgs(Player scp096, Player target, bool isLooking, bool
public Player Target { get; }
///
- /// Gets a value indicating whether or not the target was being target cause of looking it's face.
+ /// Gets a value indicating whether the target was being target cause of looking it's face.
///
public bool IsLooking { get; }
///
- /// Gets or sets a value indicating whether or not the target is allowed to be added.
+ /// Gets or sets a value indicating whether the target is allowed to be added.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp096/CalmingDownEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp096/CalmingDownEventArgs.cs
index 1a6647c68..c025e712c 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp096/CalmingDownEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp096/CalmingDownEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -21,7 +21,7 @@ public class CalmingDownEventArgs : IScp096Event, IDeniableEvent
///
/// The player who's controlling SCP-096.
///
- /// Indicates whether or not SCP-096 can calm down.
+ /// Indicates whether SCP-096 can calm down.
public CalmingDownEventArgs(Player player, bool shouldClearEnragedTimeLeft, bool isAllowed = true)
{
Player = player;
@@ -39,12 +39,12 @@ public CalmingDownEventArgs(Player player, bool shouldClearEnragedTimeLeft, bool
public Player Player { get; }
///
- /// Gets or sets a value indicating whether SCP-096 enrage time left should be cleared or not.
+ /// Gets or sets a value indicating whether SCP-096 enrage time left should be cleared.
///
public bool ShouldClearEnragedTimeLeft { get; set; }
///
- /// Gets or sets a value indicating whether or not SCP-096 can be enraged.
+ /// Gets or sets a value indicating whether SCP-096 can be enraged.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp096/ChargingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp096/ChargingEventArgs.cs
index be040740a..299ce5867 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp096/ChargingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp096/ChargingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -41,7 +41,7 @@ public ChargingEventArgs(Player player, bool isAllowed = true)
public Player Player { get; }
///
- /// Gets or sets a value indicating whether or not SCP-096 can charge.
+ /// Gets or sets a value indicating whether SCP-096 can charge.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp096/EnragingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp096/EnragingEventArgs.cs
index 001a67cec..67ce2db69 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp096/EnragingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp096/EnragingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -50,7 +50,7 @@ public EnragingEventArgs(Player player, float initialDuration, bool isAllowed =
public float InitialDuration { get; set; }
///
- /// Gets or sets a value indicating whether or not SCP-096 can be enraged.
+ /// Gets or sets a value indicating whether SCP-096 can be enraged.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp096/StartPryingGateEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp096/StartPryingGateEventArgs.cs
index be8cef0ce..22052c035 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp096/StartPryingGateEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp096/StartPryingGateEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -44,7 +44,7 @@ public StartPryingGateEventArgs(Player player, PryableDoor gate, bool isAllowed
public Scp096Role Scp096 { get; }
///
- /// Gets or Sets a value indicating whether or not the gate can be pried open by SCP-096.
+ /// Gets or Sets a value indicating whether the gate can be pried open by SCP-096.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp096/TryingNotToCryEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp096/TryingNotToCryEventArgs.cs
index 693bbb377..803d7ddbc 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp096/TryingNotToCryEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp096/TryingNotToCryEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -58,7 +58,7 @@ public TryingNotToCryEventArgs(Player player, bool isAllowed = true)
public GameObject GameObject { get; }
///
- /// Gets or sets a value indicating whether or not SCP-096 can try not to cry.
+ /// Gets or sets a value indicating whether SCP-096 can try not to cry.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp106/AttackingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp106/AttackingEventArgs.cs
index f3bd01151..6c8212004 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp106/AttackingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp106/AttackingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -44,7 +44,7 @@ public AttackingEventArgs(Player player, Player target, bool isAllowed = true)
public Player Target { get; }
///
- /// Gets or sets a value indicating whether or not target can be attacked.
+ /// Gets or sets a value indicating whether target can be attacked.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp106/ExitStalkingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp106/ExitStalkingEventArgs.cs
index c6b44dbf7..b501c112c 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp106/ExitStalkingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp106/ExitStalkingEventArgs.cs
@@ -1,17 +1,14 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Scp106
{
- using System;
-
using API.Features;
using Interfaces;
- using PlayerRoles.PlayableScps.Scp106;
using Scp106Role = API.Features.Roles.Scp106Role;
@@ -41,7 +38,7 @@ public ExitStalkingEventArgs(Player player, bool isAllowed = true)
public Scp106Role Scp106 { get; }
///
- /// Gets or sets a value indicating whether or not SCP-106 can stalk.
+ /// Gets or sets a value indicating whether SCP-106 can stalk.
///
public bool IsAllowed { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp106/StalkingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp106/StalkingEventArgs.cs
index 16c94d235..b94a3db6f 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp106/StalkingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp106/StalkingEventArgs.cs
@@ -1,14 +1,12 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Scp106
{
- using System;
-
using API.Features;
using Interfaces;
using PlayerRoles.PlayableScps.Scp106;
@@ -24,32 +22,14 @@ public class StalkingEventArgs : IScp106Event, IDeniableEvent
/// Initializes a new instance of the class.
///
///
- ///
- public StalkingEventArgs(Player player, bool isAllowed = true)
+ public StalkingEventArgs(Player player)
{
Player = player;
Scp106 = player.Role.As();
- IsAllowed = isAllowed;
+ IsAllowed = true;
MinimumVigor = Scp106StalkAbility.MinVigorToSubmerge;
}
- ///
- /// Gets the .
- ///
- [Obsolete("Use Scp106.StalkAbility instead of this")]
- public Scp106StalkAbility Scp106StalkAbility => Scp106.StalkAbility;
-
- ///
- /// Gets or sets the current vigor when SCP-106 starts to stalk.
- ///
- public float Vigor
- {
- [Obsolete("Use Scp106.Vigor instead of this")]
- get => Scp106.Vigor;
- [Obsolete("Use Scp106.Vigor instead of this")]
- set => Scp106.Vigor = value;
- }
-
///
/// Gets or sets the required minimum vigor to stalk.
///
@@ -64,8 +44,9 @@ public float Vigor
public Scp106Role Scp106 { get; }
///
- /// Gets or sets a value indicating whether or not SCP-106 can stalk.
+ /// Gets or sets a value indicating whether SCP-106 can stalk.
///
+ /// IsAllowed doesn't indicate whether vigor is sufficient for Stalking. needs to be changed to override the base game check.
public bool IsAllowed { get; set; }
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp106/TeleportingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp106/TeleportingEventArgs.cs
index ffc5a10de..52f503cf6 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp106/TeleportingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp106/TeleportingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -44,7 +44,7 @@ public TeleportingEventArgs(Player player, Vector3 position, bool isAllowed = tr
public Vector3 Position { get; set; }
///
- /// Gets or sets a value indicating whether or not SCP-106 can teleport using a portal.
+ /// Gets or sets a value indicating whether SCP-106 can teleport using a portal.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp1344/ChangedStatusEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp1344/ChangedStatusEventArgs.cs
new file mode 100644
index 000000000..11afddf79
--- /dev/null
+++ b/EXILED/Exiled.Events/EventArgs/Scp1344/ChangedStatusEventArgs.cs
@@ -0,0 +1,55 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.EventArgs.Scp1344
+{
+ using Exiled.API.Features.Items;
+ using Exiled.Events.EventArgs.Interfaces;
+ using InventorySystem.Items.Usables.Scp1344;
+
+ ///
+ /// Contains all information after SCP-1344 status changing.
+ ///
+ public class ChangedStatusEventArgs : IScp1344Event, IPlayerEvent, IDeniableEvent
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ ///
+ public ChangedStatusEventArgs(Item item, Scp1344Status scp1344Status)
+ {
+ Item = item;
+ Scp1344 = item as Scp1344;
+ Player = item.Owner;
+ Scp1344Status = scp1344Status;
+ }
+
+ ///
+ /// Gets the new state.
+ ///
+ public Scp1344Status Scp1344Status { get; }
+
+ ///
+ /// Gets the item.
+ ///
+ public Item Item { get; }
+
+ ///
+ /// Gets the player in owner of the item.
+ ///
+ public Exiled.API.Features.Player Player { get; }
+
+ ///
+ /// Gets Scp1344 item.
+ ///
+ public Scp1344 Scp1344 { get; }
+
+ ///
+ public bool IsAllowed { get; set; }
+ }
+}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp1344/ChangingStatusEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp1344/ChangingStatusEventArgs.cs
new file mode 100644
index 000000000..89329e073
--- /dev/null
+++ b/EXILED/Exiled.Events/EventArgs/Scp1344/ChangingStatusEventArgs.cs
@@ -0,0 +1,64 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.EventArgs.Scp1344
+{
+ using Exiled.API.Features.Items;
+ using Exiled.Events.EventArgs.Interfaces;
+ using InventorySystem.Items.Usables.Scp1344;
+
+ ///
+ /// Contains all information before SCP-1344 status changing.
+ ///
+ public class ChangingStatusEventArgs : IPlayerEvent, IScp1344Event, IDeniableEvent
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ ///
+ ///
+ ///
+ public ChangingStatusEventArgs(Item item, Scp1344Status scp1344StatusNew, Scp1344Status scp1344StatusOld, bool isAllowed = true)
+ {
+ Item = item;
+ Scp1344 = item as Scp1344;
+ Player = item.Owner;
+ Scp1344StatusNew = scp1344StatusNew;
+ Scp1344StatusOld = scp1344StatusOld;
+ IsAllowed = isAllowed;
+ }
+
+ ///
+ /// Gets the current status.
+ ///
+ public Scp1344Status Scp1344StatusOld { get; }
+
+ ///
+ /// Gets or sets the new state.
+ ///
+ public Scp1344Status Scp1344StatusNew { get; set; }
+
+ ///
+ /// Gets the item.
+ ///
+ public Item Item { get; }
+
+ ///
+ /// Gets the player in owner of the item.
+ ///
+ public Exiled.API.Features.Player Player { get; }
+
+ ///
+ /// Gets Scp1344 item.
+ ///
+ public Scp1344 Scp1344 { get; }
+
+ ///
+ public bool IsAllowed { get; set; }
+ }
+}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp1344/DeactivatedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp1344/DeactivatedEventArgs.cs
new file mode 100644
index 000000000..79ec6925e
--- /dev/null
+++ b/EXILED/Exiled.Events/EventArgs/Scp1344/DeactivatedEventArgs.cs
@@ -0,0 +1,44 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.EventArgs.Scp1344
+{
+ using Exiled.API.Features.Items;
+ using Exiled.Events.EventArgs.Interfaces;
+
+ ///
+ /// Contains all information after deactivating.
+ ///
+ public class DeactivatedEventArgs : IPlayerEvent, IScp1344Event
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ public DeactivatedEventArgs(Item item)
+ {
+ Item = item;
+ Scp1344 = item as Scp1344;
+ Player = item.Owner;
+ }
+
+ ///
+ /// Gets the item.
+ ///
+ public Item Item { get; }
+
+ ///
+ /// Gets the player in owner of the item.
+ ///
+ public Exiled.API.Features.Player Player { get; }
+
+ ///
+ /// Gets Scp1344 item.
+ ///
+ public Scp1344 Scp1344 { get; }
+ }
+}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp1344/DeactivatingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp1344/DeactivatingEventArgs.cs
new file mode 100644
index 000000000..96bcbc211
--- /dev/null
+++ b/EXILED/Exiled.Events/EventArgs/Scp1344/DeactivatingEventArgs.cs
@@ -0,0 +1,49 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.EventArgs.Scp1344
+{
+ using Exiled.API.Features.Items;
+ using Exiled.Events.EventArgs.Interfaces;
+
+ ///
+ /// Contains all information before deactivating.
+ ///
+ public class DeactivatingEventArgs : IPlayerEvent, IScp1344Event, IDeniableEvent
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ ///
+ public DeactivatingEventArgs(Item item, bool isAllowed = true)
+ {
+ Item = item;
+ Scp1344 = item as Scp1344;
+ Player = item.Owner;
+ IsAllowed = isAllowed;
+ }
+
+ ///
+ /// Gets the item.
+ ///
+ public Item Item { get; }
+
+ ///
+ /// Gets the player in owner of the item.
+ ///
+ public Exiled.API.Features.Player Player { get; }
+
+ ///
+ /// Gets Scp1344 item.
+ ///
+ public Scp1344 Scp1344 { get; }
+
+ ///
+ public bool IsAllowed { get; set; }
+ }
+}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp1344/TryingDeactivatingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp1344/TryingDeactivatingEventArgs.cs
new file mode 100644
index 000000000..f236851f1
--- /dev/null
+++ b/EXILED/Exiled.Events/EventArgs/Scp1344/TryingDeactivatingEventArgs.cs
@@ -0,0 +1,49 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.EventArgs.Scp1344
+{
+ using Exiled.API.Features.Items;
+ using Exiled.Events.EventArgs.Interfaces;
+
+ ///
+ /// Contains all information before trying deactivating.
+ ///
+ public class TryingDeactivatingEventArgs : IPlayerEvent, IScp1344Event, IDeniableEvent
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ ///
+ public TryingDeactivatingEventArgs(Item item, bool isAllowed = true)
+ {
+ Item = item;
+ Scp1344 = item as Scp1344;
+ Player = item.Owner;
+ IsAllowed = isAllowed;
+ }
+
+ ///
+ /// Gets the item.
+ ///
+ public Item Item { get; }
+
+ ///
+ /// Gets the player in owner of the item.
+ ///
+ public Exiled.API.Features.Player Player { get; }
+
+ ///
+ /// Gets Scp1344 item.
+ ///
+ public Scp1344 Scp1344 { get; }
+
+ ///
+ public bool IsAllowed { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Scp173/BeingObservedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp173/BeingObservedEventArgs.cs
new file mode 100755
index 000000000..d1ee0750b
--- /dev/null
+++ b/EXILED/Exiled.Events/EventArgs/Scp173/BeingObservedEventArgs.cs
@@ -0,0 +1,57 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.EventArgs.Scp173
+{
+ using Exiled.API.Features;
+ using Exiled.API.Features.Roles;
+ using Exiled.Events.EventArgs.Interfaces;
+
+ ///
+ /// Contains all the information before SCP-173 is observed.
+ ///
+ public class BeingObservedEventArgs : IScp173Event, IDeniableEvent
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The instance of the target.
+ ///
+ ///
+ /// The instance of the SCP-173.
+ ///
+ ///
+ /// Whether the target will be counted as observing the SCP-173.
+ ///
+ public BeingObservedEventArgs(API.Features.Player target, API.Features.Player scp173, bool isAllowed = true)
+ {
+ Target = target;
+ Player = scp173;
+ Scp173 = scp173.Role.As();
+ IsAllowed = isAllowed;
+ }
+
+ ///
+ /// Gets the player who's observing the SCP-173.
+ ///
+ public Player Target { get; }
+
+ ///
+ /// Gets the player who's being observed.
+ ///
+ public Player Player { get; }
+
+ ///
+ public Scp173Role Scp173 { get; }
+
+ ///
+ /// Gets or sets a value indicating whether the player can be counted as observing.
+ ///
+ public bool IsAllowed { get; set; }
+ }
+}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp173/BlinkingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp173/BlinkingEventArgs.cs
index 5ef166038..95f3e2a08 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp173/BlinkingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp173/BlinkingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -58,11 +58,10 @@ public BlinkingEventArgs(Player player, List targets, Vector3 blinkPos)
///
/// Gets a of players who have triggered SCP-173.
///
- // TODO: convert to ReadOnlyCollection
- public List Targets { get; }
+ public IReadOnlyCollection Targets { get; }
///
- /// Gets or sets a value indicating whether or not the player is allowed to blink.
+ /// Gets or sets a value indicating whether the player is allowed to blink.
///
public bool IsAllowed { get; set; } = true;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp173/BlinkingRequestEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp173/BlinkingRequestEventArgs.cs
index cf05b21dd..f526d55c3 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp173/BlinkingRequestEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp173/BlinkingRequestEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -42,7 +42,7 @@ public BlinkingRequestEventArgs(Player player, HashSet targets)
public IReadOnlyCollection Targets { get; }
///
- /// Gets or sets a value indicating whether or not the player is allowed to blink.
+ /// Gets or sets a value indicating whether the player is allowed to blink.
///
public bool IsAllowed { get; set; } = true;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp173/PlacingTantrumEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp173/PlacingTantrumEventArgs.cs
index d63231048..459befc3b 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp173/PlacingTantrumEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp173/PlacingTantrumEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -60,7 +60,7 @@ public PlacingTantrumEventArgs(Player player, TantrumEnvironmentalHazard tantrum
public AbilityCooldown Cooldown { get; }
///
- /// Gets or sets a value indicating whether or not the tantrum can be placed.
+ /// Gets or sets a value indicating whether the tantrum can be placed.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp173/UsingBreakneckSpeedsEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp173/UsingBreakneckSpeedsEventArgs.cs
index d8cad06ec..8b380e738 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp173/UsingBreakneckSpeedsEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp173/UsingBreakneckSpeedsEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -33,7 +33,7 @@ public UsingBreakneckSpeedsEventArgs(Player player, bool isAllowed = true)
}
///
- /// Gets or sets a value indicating whether or not the player can use breakneck speeds.
+ /// Gets or sets a value indicating whether the player can use breakneck speeds.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp244/DamagingScp244EventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp244/DamagingScp244EventArgs.cs
index 88d67262d..5f666dea5 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp244/DamagingScp244EventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp244/DamagingScp244EventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp244/OpeningScp244EventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp244/OpeningScp244EventArgs.cs
index 45e354b0c..d8550dd4e 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp244/OpeningScp244EventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp244/OpeningScp244EventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -34,7 +34,7 @@ public OpeningScp244EventArgs(Scp244DeployablePickup pickup)
public Scp244Pickup Pickup { get; }
///
- /// Gets or sets a value indicating whether or not the player can open SCP-244.
+ /// Gets or sets a value indicating whether the player can open SCP-244.
///
public bool IsAllowed { get; set; } = true;
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp244/UsingScp244EventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp244/UsingScp244EventArgs.cs
index 5dca87a99..ab00eaab1 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp244/UsingScp244EventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp244/UsingScp244EventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/DancingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/DancingEventArgs.cs
index ecb4cf893..12d1701c4 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/DancingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/DancingEventArgs.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -37,7 +37,7 @@ public DancingEventArgs(bool newState, Player player, bool isAllowed = true)
public bool IsAllowed { get; set; }
///
- /// Gets a value indicating whether or not SCP-3114 is dancing.
+ /// Gets a value indicating whether SCP-3114 is dancing.
///
public bool IsDancing { get; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/DisguisedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/DisguisedEventArgs.cs
index 743246f8a..b7c7d4bf6 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/DisguisedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/DisguisedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/DisguisingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/DisguisingEventArgs.cs
index c21878c14..050b4beb5 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/DisguisingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/DisguisingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/RevealedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/RevealedEventArgs.cs
index 74866b193..cab47ebc9 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/RevealedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/RevealedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -39,7 +39,7 @@ public RevealedEventArgs(Player player, bool isManualReveal)
public Scp3114Role Scp3114 { get; }
///
- /// Gets a value indicating whether the reveal is manual or not.
+ /// Gets a value indicating whether the reveal is manual.
///
public bool IsManualReveal { get; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/RevealingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/RevealingEventArgs.cs
index 755ae8c0f..215ffd177 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/RevealingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/RevealingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -46,7 +46,7 @@ public RevealingEventArgs(Player player, bool isManualReveal, bool isAllowed = t
public Scp3114Role Scp3114 { get; }
///
- /// Gets a value indicating whether the reveal is manual or not.
+ /// Gets a value indicating whether the reveal is manual.
///
public bool IsManualReveal { get; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/SlappedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/SlappedEventArgs.cs
index d6d47e1a9..41a01cdce 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/SlappedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/SlappedEventArgs.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/StranglingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/StranglingEventArgs.cs
index da790afc6..94b45227c 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/StranglingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/StranglingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/TryUseBodyEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/TryUseBodyEventArgs.cs
index 997f7b22b..f63aaba95 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/TryUseBodyEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/TryUseBodyEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp3114/VoiceLinesEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp3114/VoiceLinesEventArgs.cs
index 5871aa947..7fa402479 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp3114/VoiceLinesEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp3114/VoiceLinesEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp330/DroppingScp330EventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp330/DroppingScp330EventArgs.cs
index 985e90337..0ead45776 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp330/DroppingScp330EventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp330/DroppingScp330EventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -39,20 +39,20 @@ public DroppingScp330EventArgs(Player player, Scp330Bag scp330, CandyKindID cand
}
///
- /// Gets or sets a value representing the being picked up.
+ /// Gets a value representing the being picked up.
///
- public Scp330 Scp330 { get; set; } // Todo Remove set
+ public Scp330 Scp330 { get; }
///
public Item Item => Scp330;
///
- /// Gets or sets a value indicating whether or not the type of candy drop.
+ /// Gets or sets a value indicating whether the type of candy drop.
///
public CandyKindID Candy { get; set; }
///
- /// Gets or sets a value indicating whether or not the player can interact with SCP-330.
+ /// Gets or sets a value indicating whether the player can interact with SCP-330.
///
public bool IsAllowed { get; set; } = true;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp330/EatenScp330EventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp330/EatenScp330EventArgs.cs
index 29beac357..74633d8c6 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp330/EatenScp330EventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp330/EatenScp330EventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp330/EatingScp330EventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp330/EatingScp330EventArgs.cs
index 825f8424b..ab15aa1d6 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp330/EatingScp330EventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp330/EatingScp330EventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -39,7 +39,7 @@ public EatingScp330EventArgs(Player player, Scp330Bag scp330, ICandy candy, bool
public ICandy Candy { get; }
///
- /// Gets or sets a value indicating whether or not the player can eat SCP-330.
+ /// Gets or sets a value indicating whether the player can eat SCP-330.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp330/InteractingScp330EventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp330/InteractingScp330EventArgs.cs
index cd4d4922f..dc39d420c 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp330/InteractingScp330EventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp330/InteractingScp330EventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -12,7 +12,6 @@ namespace Exiled.Events.EventArgs.Scp330
using Interfaces;
using InventorySystem.Items.Usables.Scp330;
- using YamlDotNet.Core.Tokens;
///
/// Contains all information before a player interacts with SCP-330.
@@ -35,6 +34,7 @@ public InteractingScp330EventArgs(Player player, int usage)
ShouldSever = usage >= 2;
ShouldPlaySound = true;
IsAllowed = Player.IsHuman;
+ Candy = Scp330Candies.GetRandom();
if (Scp330Bag.TryGetBag(player.ReferenceHub, out Scp330Bag scp330Bag))
{
@@ -46,8 +46,6 @@ public InteractingScp330EventArgs(Player player, int usage)
Scp330.RemoveAllCandy();
player.AddItem(Scp330);
}
-
- Scp330.CandyToAdd = Scp330Candies.GetRandom();
}
///
@@ -55,15 +53,6 @@ public InteractingScp330EventArgs(Player player, int usage)
///
public int UsageCount { get; }
- ///
- /// Gets or sets a value indicating the type of candy that will be received from this interaction.
- ///
- public CandyKindID Candy
- {
- get => Scp330.CandyToAdd;
- set => Scp330.CandyToAdd = value;
- }
-
///
/// Gets or sets a value indicating whether the player's hands should get severed.
///
@@ -75,6 +64,11 @@ public CandyKindID Candy
/// It won't work if = .
public bool ShouldPlaySound { get; set; }
+ ///
+ /// Gets or sets a value indicating the type of candy that will be received from this interaction.
+ ///
+ public CandyKindID Candy { get; set; }
+
///
/// Gets or sets a value indicating whether the player is allowed to interact with SCP-330.
///
diff --git a/EXILED/Exiled.Events/EventArgs/Scp914/ActivatingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp914/ActivatingEventArgs.cs
index 6d229acf7..cbb006386 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp914/ActivatingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp914/ActivatingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -32,7 +32,7 @@ public ActivatingEventArgs(Player player, bool isAllowed = true)
}
///
- /// Gets or sets a value indicating whether or not SCP-914 can be activated.
+ /// Gets or sets a value indicating whether SCP-914 can be activated.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp914/ChangingKnobSettingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp914/ChangingKnobSettingEventArgs.cs
index ae9a25042..b7af91e65 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp914/ChangingKnobSettingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp914/ChangingKnobSettingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -49,7 +49,7 @@ public Scp914KnobSetting KnobSetting
}
///
- /// Gets or sets a value indicating whether or not SCP-914's knob setting can be changed.
+ /// Gets or sets a value indicating whether SCP-914's knob setting can be changed.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingInventoryItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingInventoryItemEventArgs.cs
index 8dd471a7f..b4f27aa5f 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingInventoryItemEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingInventoryItemEventArgs.cs
@@ -1,14 +1,12 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Scp914
{
- using System;
-
using API.Features;
using API.Features.Items;
using global::Scp914;
@@ -43,19 +41,13 @@ public UpgradingInventoryItemEventArgs(Player player, ItemBase item, Scp914KnobS
IsAllowed = isAllowed;
}
- ///
- /// Gets the instance.
- ///
- [Obsolete("Use Scp914::Scp914Controller instead.")]
- public Scp914Controller Scp914 => API.Features.Scp914.Scp914Controller;
-
///
/// Gets or sets SCP-914 working knob setting.
///
public Scp914KnobSetting KnobSetting { get; set; }
///
- /// Gets or sets a value indicating whether or not the upgrade is successful.
+ /// Gets or sets a value indicating whether the upgrade is successful.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingPickupEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingPickupEventArgs.cs
index 22744d588..691db20a1 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingPickupEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingPickupEventArgs.cs
@@ -1,14 +1,12 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Scp914
{
- using System;
-
using Exiled.API.Features.Pickups;
using Exiled.Events.EventArgs.Interfaces;
using global::Scp914;
@@ -44,12 +42,6 @@ public UpgradingPickupEventArgs(ItemPickupBase item, Vector3 newPos, Scp914KnobS
///
public Pickup Pickup { get; }
- ///
- /// Gets the instance.
- ///
- [Obsolete("Use Scp914::Scp914Controller instead.")]
- public Scp914Controller Scp914 => API.Features.Scp914.Scp914Controller;
-
///
/// Gets or sets the position the item will be output to.
///
@@ -61,7 +53,7 @@ public UpgradingPickupEventArgs(ItemPickupBase item, Vector3 newPos, Scp914KnobS
public Scp914KnobSetting KnobSetting { get; set; }
///
- /// Gets or sets a value indicating whether or not the upgrade is successful.
+ /// Gets or sets a value indicating whether the upgrade is successful.
///
public bool IsAllowed { get; set; } = true;
}
diff --git a/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingPlayerEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingPlayerEventArgs.cs
index 41ef53347..cf4487ecc 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingPlayerEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp914/UpgradingPlayerEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -31,16 +31,16 @@ public class UpgradingPlayerEventArgs : IPlayerEvent, IDeniableEvent
///
///
///
- ///
- ///
+ ///
+ ///
///
- public UpgradingPlayerEventArgs(Player player, bool upgradeItems, bool heldOnly, Scp914KnobSetting setting, Vector3 moveVector)
+ public UpgradingPlayerEventArgs(Player player, bool upgradeItems, bool heldOnly, Scp914KnobSetting setting, Vector3 outputPos)
{
Player = player;
UpgradeItems = upgradeItems;
HeldOnly = heldOnly;
KnobSetting = setting;
- OutputPosition = player.Position + moveVector;
+ OutputPosition = outputPos;
}
///
@@ -49,12 +49,12 @@ public UpgradingPlayerEventArgs(Player player, bool upgradeItems, bool heldOnly,
public Vector3 OutputPosition { get; set; }
///
- /// Gets or sets a value indicating whether or not items will be upgraded.
+ /// Gets or sets a value indicating whether items will be upgraded.
///
public bool UpgradeItems { get; set; }
///
- /// Gets or sets a value indicating whether or not only held items are upgraded.
+ /// Gets or sets a value indicating whether only held items are upgraded.
///
public bool HeldOnly { get; set; }
@@ -64,7 +64,7 @@ public UpgradingPlayerEventArgs(Player player, bool upgradeItems, bool heldOnly,
public Scp914KnobSetting KnobSetting { get; set; }
///
- /// Gets or sets a value indicating whether or not the event can continue.
+ /// Gets or sets a value indicating whether the event can continue.
///
public bool IsAllowed { get; set; } = true;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/ChangingFocusEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/ChangingFocusEventArgs.cs
index ec3c29433..982fbd09f 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/ChangingFocusEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/ChangingFocusEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -37,12 +37,12 @@ public ChangingFocusEventArgs(ReferenceHub player, bool state, bool isAllowed =
}
///
- /// Gets or sets a value indicating whether or not SCP-939 can focus.
+ /// Gets or sets a value indicating whether SCP-939 can focus.
///
public bool IsAllowed { get; set; }
///
- /// Gets a value indicating whether or not SCP-939 is currently focusing or un-focusing.
+ /// Gets a value indicating whether SCP-939 is currently focusing or un-focusing.
///
public bool State { get; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/ClawedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/ClawedEventArgs.cs
index 9430a1c7d..8ce4a1f1a 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/ClawedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/ClawedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/LungingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/LungingEventArgs.cs
index 954005140..387f0467c 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/LungingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/LungingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/PlacedAmnesticCloudEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/PlacedAmnesticCloudEventArgs.cs
index 107a7c869..d49aee7fa 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/PlacedAmnesticCloudEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/PlacedAmnesticCloudEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/PlacingAmnesticCloudEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/PlacingAmnesticCloudEventArgs.cs
index e8b2c72f5..3d77ff708 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/PlacingAmnesticCloudEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/PlacingAmnesticCloudEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -23,10 +23,10 @@ public class PlacingAmnesticCloudEventArgs : IScp939Event, IDeniableEvent
///
///
///
- /// Whether or not SCP-939 is attempting to place an amnestic cloud.
+ /// Whether SCP-939 is attempting to place an amnestic cloud.
///
///
- /// Whether or not the cooldown is ready.
+ /// Whether the cooldown is ready.
///
///
/// SCP-939's amnestic cloud cooldown.
@@ -45,17 +45,17 @@ public PlacingAmnesticCloudEventArgs(Player player, bool state, bool isReady, fl
}
///
- /// Gets or sets a value indicating whether or not SCP-939 can place an amnestic cloud.
+ /// Gets or sets a value indicating whether SCP-939 can place an amnestic cloud.
///
public bool IsAllowed { get; set; }
///
- /// Gets a value indicating whether or not SCP-939 is ready to place its amnestic cloud.
+ /// Gets a value indicating whether SCP-939 is ready to place its amnestic cloud.
///
public bool State { get; }
///
- /// Gets or sets a value indicating whether or not SCP-939's amnestic cloud cooldown is ready.
+ /// Gets or sets a value indicating whether SCP-939's amnestic cloud cooldown is ready.
///
public bool IsReady { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/PlayingFootstepEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/PlayingFootstepEventArgs.cs
index bf0ed25c6..269bb3ea3 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/PlayingFootstepEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/PlayingFootstepEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/PlayingSoundEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/PlayingSoundEventArgs.cs
index 7502be5fb..675884707 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/PlayingSoundEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/PlayingSoundEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -27,7 +27,7 @@ public class PlayingSoundEventArgs : IScp939Event, IDeniableEvent
/// The sound that is being played.
///
///
- /// Whether or not SCP-939's environmental mimicry cooldown is ready.
+ /// Whether SCP-939's environmental mimicry cooldown is ready.
///
///
/// The cooldown of the environmental mimicry.
@@ -46,7 +46,7 @@ public PlayingSoundEventArgs(Player player, EnvMimicrySequence sound, bool isRea
}
///
- /// Gets or sets a value indicating whether or not SCP-939 can play the sound.
+ /// Gets or sets a value indicating whether SCP-939 can play the sound.
///
/// This will default to if is . In this case, setting it to will override the cooldown.
public bool IsAllowed { get; set; }
@@ -57,7 +57,7 @@ public PlayingSoundEventArgs(Player player, EnvMimicrySequence sound, bool isRea
public EnvMimicrySequence Sound { get; }
///
- /// Gets a value indicating whether or not SCP-939's environmental mimicry cooldown is ready.
+ /// Gets a value indicating whether SCP-939's environmental mimicry cooldown is ready.
///
public bool IsReady { get; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/PlayingVoiceEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/PlayingVoiceEventArgs.cs
index 5b8dfdd37..b744934b8 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/PlayingVoiceEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/PlayingVoiceEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -33,7 +33,7 @@ public PlayingVoiceEventArgs(ReferenceHub player, ReferenceHub stolen)
}
///
- /// Gets or sets a value indicating whether or not SCP-939 can play the stolen voice.
+ /// Gets or sets a value indicating whether SCP-939 can play the stolen voice.
///
public bool IsAllowed { get; set; } = true;
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/SavingVoiceEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/SavingVoiceEventArgs.cs
index 6f6381430..60133cc19 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/SavingVoiceEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/SavingVoiceEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -37,7 +37,7 @@ public SavingVoiceEventArgs(ReferenceHub player, ReferenceHub stolen, bool isAll
}
///
- /// Gets or sets a value indicating whether or not SCP-939 can play the stolen voice.
+ /// Gets or sets a value indicating whether SCP-939 can play the stolen voice.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Scp939/ValidatingVisibilityEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp939/ValidatingVisibilityEventArgs.cs
index 3a2bd2a0b..a14873c9a 100644
--- a/EXILED/Exiled.Events/EventArgs/Scp939/ValidatingVisibilityEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Scp939/ValidatingVisibilityEventArgs.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -26,7 +26,7 @@ public class ValidatingVisibilityEventArgs : IScp939Event, IDeniableEvent
/// The target being shown to SCP-939.
///
///
- /// Whether or not SCP-939 is allowed to view the player.
+ /// Whether SCP-939 is allowed to view the player.
///
public ValidatingVisibilityEventArgs(ReferenceHub player, ReferenceHub target, bool isAllowed)
{
diff --git a/EXILED/Exiled.Events/EventArgs/Server/AddingUnitNameEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/AddingUnitNameEventArgs.cs
index 7af2fff05..3d52b3d9b 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/AddingUnitNameEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/AddingUnitNameEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -20,7 +20,7 @@ public class AddingUnitNameEventArgs : IDeniableEvent
/// Initializes a new instance of the class.
///
/// The generated unit name.
- /// The value indicating whether or not the unit name can be added.
+ /// The value indicating whether the unit name can be added.
public AddingUnitNameEventArgs(UnitNamingRule unitNamingRule, bool isAllowed = true)
{
UnitNamingRule = unitNamingRule;
diff --git a/EXILED/Exiled.Events/EventArgs/Server/ChoosingStartTeamQueueEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/ChoosingStartTeamQueueEventArgs.cs
index 47d0180c8..84c445797 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/ChoosingStartTeamQueueEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/ChoosingStartTeamQueueEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Server/EndingRoundEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/EndingRoundEventArgs.cs
index d84ecaf7a..216676772 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/EndingRoundEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/EndingRoundEventArgs.cs
@@ -1,14 +1,12 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Server
{
- using System;
-
using API.Enums;
using Interfaces;
@@ -20,24 +18,24 @@ public class EndingRoundEventArgs : IDeniableEvent
///
/// Initializes a new instance of the class.
///
- ///
- ///
- ///
///
///
///
- ///
- ///
+ ///
+ ///
///
///
///
///
- public EndingRoundEventArgs(RoundSummary.LeadingTeam leadingTeam, RoundSummary.SumInfo_ClassList classList, bool isAllowed, bool isForceEnded)
+ ///
+ ///
+ ///
+ public EndingRoundEventArgs(LeadingTeam leadingTeam, RoundSummary.SumInfo_ClassList classList, bool isForceEnded, bool isAllowed)
{
+ LeadingTeam = leadingTeam;
ClassList = classList;
- LeadingTeam = (LeadingTeam)leadingTeam;
- IsRoundEnded = isAllowed;
IsForceEnded = isForceEnded;
+ IsAllowed = isAllowed;
}
///
@@ -51,22 +49,13 @@ public EndingRoundEventArgs(RoundSummary.LeadingTeam leadingTeam, RoundSummary.S
public LeadingTeam LeadingTeam { get; set; }
///
- /// Gets or sets a value indicating whether the round is going to finish or not.
- ///
- public bool IsRoundEnded { get; set; } // TODO: Obsolete this in Exiled 10
-
- ///
- /// Gets or Sets a value indicating whether the round is ended by API call.
+ /// Gets or sets a value indicating whether the round is ended by API call.
///
public bool IsForceEnded { get; set; }
///
- /// Gets or sets a value indicating whether the event can be executed or not.
+ /// Gets or sets a value indicating whether the round is going to finish or not.
///
- public bool IsAllowed
- {
- get => IsRoundEnded;
- set => IsRoundEnded = value;
- }
-}
+ public bool IsAllowed { get; set; }
+ }
}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Player/LocalReportingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/LocalReportingEventArgs.cs
similarity index 88%
rename from EXILED/Exiled.Events/EventArgs/Player/LocalReportingEventArgs.cs
rename to EXILED/Exiled.Events/EventArgs/Server/LocalReportingEventArgs.cs
index 97a443ea7..02d1d6b98 100644
--- a/EXILED/Exiled.Events/EventArgs/Player/LocalReportingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/LocalReportingEventArgs.cs
@@ -1,11 +1,11 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
-namespace Exiled.Events.EventArgs.Player // TODO: Wrong namespace should be Server
+namespace Exiled.Events.EventArgs.Server
{
using API.Features;
@@ -50,7 +50,7 @@ public LocalReportingEventArgs(Player issuer, Player target, string reason, bool
public string Reason { get; set; }
///
- /// Gets or sets a value indicating whether the report can be processed or not.
+ /// Gets or sets a value indicating whether the report can be processed.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Server/ReportingCheaterEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/ReportingCheaterEventArgs.cs
index 9bed3417e..b102bdb37 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/ReportingCheaterEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/ReportingCheaterEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -59,7 +59,7 @@ public ReportingCheaterEventArgs(Player issuer, Player target, int serverPort, s
public string Reason { get; set; }
///
- /// Gets or sets a value indicating whether or not the report will be sent.
+ /// Gets or sets a value indicating whether the report will be sent.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Server/RespawnedTeamEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/RespawnedTeamEventArgs.cs
index 4aaa2b363..d3d62667a 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/RespawnedTeamEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/RespawnedTeamEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -13,6 +13,7 @@ namespace Exiled.Events.EventArgs.Server
using Exiled.API.Features;
using Exiled.Events.EventArgs.Interfaces;
using Respawning;
+ using Respawning.Waves;
///
/// Contains all information after team spawns.
@@ -23,11 +24,11 @@ public class RespawnedTeamEventArgs : IExiledEvent
/// Initializes a new instance of the class.
///
///
- ///
- public RespawnedTeamEventArgs(SpawnableTeamType team, IEnumerable hubs)
+ ///
+ public RespawnedTeamEventArgs(SpawnableWaveBase wave, IEnumerable hubs)
{
Players = hubs.Select(Player.Get);
- Team = team;
+ Wave = wave;
}
///
@@ -38,6 +39,6 @@ public RespawnedTeamEventArgs(SpawnableTeamType team, IEnumerable
///
/// Gets the spawned team.
///
- public SpawnableTeamType Team { get; }
+ public SpawnableWaveBase Wave { get; }
}
}
diff --git a/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs
index 0ea3641b5..e65bdbf03 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -10,19 +10,17 @@ namespace Exiled.Events.EventArgs.Server
using System.Collections.Generic;
using Exiled.API.Features;
+ using Exiled.API.Features.Waves;
using Exiled.Events.EventArgs.Interfaces;
-
using PlayerRoles;
-
using Respawning;
+ using Respawning.Waves;
///
- /// Contains all information before spawning a wave of or
- /// .
+ /// Contains all information before spawning a wave.
///
public class RespawningTeamEventArgs : IDeniableEvent
{
- private SpawnableTeamType nextKnownTeam;
private int maximumRespawnAmount;
///
@@ -34,21 +32,16 @@ public class RespawningTeamEventArgs : IDeniableEvent
///
///
///
- ///
+ ///
///
///
- ///
- ///
- ///
- public RespawningTeamEventArgs(List players, int maxRespawn, SpawnableTeamType nextKnownTeam, bool isAllowed = true)
+ public RespawningTeamEventArgs(List players, int maxRespawn, SpawnableWaveBase wave)
{
Players = players;
MaximumRespawnAmount = maxRespawn;
-
- this.nextKnownTeam = nextKnownTeam;
- SpawnQueue = new();
- SpawnableTeam.GenerateQueue(SpawnQueue, players.Count);
- IsAllowed = isAllowed;
+ SpawnQueue = WaveSpawner.SpawnQueue;
+ Wave = new TimedWave((TimeBasedWave)wave);
+ IsAllowed = true;
}
///
@@ -75,35 +68,17 @@ public int MaximumRespawnAmount
}
///
- /// Gets or sets a value indicating what the next respawnable team is.
+ /// Gets or sets a value indicating what the next wave is.
///
- public SpawnableTeamType NextKnownTeam
- {
- get => nextKnownTeam;
- set
- {
- nextKnownTeam = value;
-
- if (!RespawnManager.SpawnableTeams.TryGetValue(value, out SpawnableTeamHandlerBase spawnableTeam))
- {
- MaximumRespawnAmount = 0;
- return;
- }
-
- MaximumRespawnAmount = spawnableTeam.MaxWaveSize;
- if (RespawnManager.SpawnableTeams.TryGetValue(nextKnownTeam, out SpawnableTeamHandlerBase @base))
- @base.GenerateQueue(SpawnQueue, Players.Count);
- }
- }
+ public TimedWave Wave { get; set; }
///
- /// Gets the current spawnable team.
+ /// Gets a value indicating what the next respawnable team is.
///
- public SpawnableTeamHandlerBase SpawnableTeam
- => RespawnManager.SpawnableTeams.TryGetValue(NextKnownTeam, out SpawnableTeamHandlerBase @base) ? @base : null;
+ public Faction NextKnownTeam => Wave.Faction;
///
- /// Gets or sets a value indicating whether or not the spawn can occur.
+ /// Gets or sets a value indicating whether the spawn can occur.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Server/RoundEndedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/RoundEndedEventArgs.cs
index c48103683..0e614d8a6 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/RoundEndedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/RoundEndedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Server/SelectingRespawnTeamEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/SelectingRespawnTeamEventArgs.cs
index 3c3b87de5..dd6294777 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/SelectingRespawnTeamEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/SelectingRespawnTeamEventArgs.cs
@@ -1,35 +1,42 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.EventArgs.Server
{
- using System;
-
- using Exiled.API.Features;
+ using Exiled.API.Enums;
+ using Exiled.API.Features.Waves;
using Exiled.Events.EventArgs.Interfaces;
- using Respawning;
+ using Respawning.Waves;
///
/// Contains all information before selecting the team to respawn next.
///
- public class SelectingRespawnTeamEventArgs : IExiledEvent
+ public class SelectingRespawnTeamEventArgs : IDeniableEvent
{
///
/// Initializes a new instance of the class.
///
- /// The used as the starting value for this event.
- public SelectingRespawnTeamEventArgs(SpawnableTeamType type)
+ /// .
+ public SelectingRespawnTeamEventArgs(SpawnableWaveBase wave)
{
- Team = type;
+ Wave = new TimedWave((TimeBasedWave)wave);
}
///
- /// Gets or sets that represents the team chosen to spawn.
+ /// Gets that represents the team chosen to spawn.
///
- public SpawnableTeamType Team { get; set; }
+ public SpawnableFaction Team => Wave.SpawnableFaction;
+
+ ///
+ /// Gets or sets that is selected.
+ ///
+ public TimedWave Wave { get; set; }
+
+ ///
+ public bool IsAllowed { get; set; } = true;
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/EventArgs/Server/UnbannedEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/UnbannedEventArgs.cs
index 595d0551b..72e938c05 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/UnbannedEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/UnbannedEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Server/UnbanningEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/UnbanningEventArgs.cs
index 9822622cd..7c2a3e1e0 100644
--- a/EXILED/Exiled.Events/EventArgs/Server/UnbanningEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Server/UnbanningEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Warhead/ChangingLeverStatusEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Warhead/ChangingLeverStatusEventArgs.cs
index 1caac039f..407cdfd76 100644
--- a/EXILED/Exiled.Events/EventArgs/Warhead/ChangingLeverStatusEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Warhead/ChangingLeverStatusEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -41,7 +41,7 @@ public ChangingLeverStatusEventArgs(Player player, bool curState, bool isAllowed
public bool CurrentState { get; }
///
- /// Gets or sets a value indicating whether or not the lever status will change.
+ /// Gets or sets a value indicating whether the lever status will change.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/EventArgs/Warhead/DetonatingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Warhead/DetonatingEventArgs.cs
index b6b25bf28..d9c00e9da 100644
--- a/EXILED/Exiled.Events/EventArgs/Warhead/DetonatingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Warhead/DetonatingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/EventArgs/Warhead/StartingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Warhead/StartingEventArgs.cs
index be6f6f2fd..6f006c529 100644
--- a/EXILED/Exiled.Events/EventArgs/Warhead/StartingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Warhead/StartingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -18,8 +18,8 @@ public class StartingEventArgs : StoppingEventArgs
/// Initializes a new instance of the class.
///
/// The player who's going to start the warhead.
- /// Indicating whether or not the nuke was set off automatically.
- /// Indicating whether the event can be executed or not.
+ /// Indicating whether the nuke was set off automatically.
+ /// Indicating whether the event can be executed.
public StartingEventArgs(Player player, bool isAuto, bool isAllowed = true)
: base(player, isAllowed)
{
@@ -27,7 +27,7 @@ public StartingEventArgs(Player player, bool isAuto, bool isAllowed = true)
}
///
- /// Gets or sets a value indicating whether or not the nuke was set off automatically.
+ /// Gets or sets a value indicating whether the nuke was set off automatically.
///
public bool IsAuto { get; set; }
}
diff --git a/EXILED/Exiled.Events/EventArgs/Warhead/StoppingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Warhead/StoppingEventArgs.cs
index 57d1dd1bb..403380511 100644
--- a/EXILED/Exiled.Events/EventArgs/Warhead/StoppingEventArgs.cs
+++ b/EXILED/Exiled.Events/EventArgs/Warhead/StoppingEventArgs.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -32,7 +32,7 @@ public StoppingEventArgs(Player player, bool isAllowed = true)
}
///
- /// Gets or sets a value indicating whether or not the warhead can be stopped.
+ /// Gets or sets a value indicating whether the warhead can be stopped.
///
public bool IsAllowed { get; set; }
diff --git a/EXILED/Exiled.Events/Events.cs b/EXILED/Exiled.Events/Events.cs
index 4c5fcabc5..ac37f5528 100644
--- a/EXILED/Exiled.Events/Events.cs
+++ b/EXILED/Exiled.Events/Events.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -13,16 +13,17 @@ namespace Exiled.Events
using API.Enums;
using API.Features;
using CentralAuth;
+ using Exiled.API.Features.Core.UserSettings;
using Exiled.Events.Features;
using HarmonyLib;
using InventorySystem.Items.Pickups;
using InventorySystem.Items.Usables;
-
using PlayerRoles.Ragdolls;
using PlayerRoles.RoleAssign;
using PluginAPI.Events;
using Respawning;
using UnityEngine.SceneManagement;
+ using UserSettings.ServerSpecific;
///
/// Patch and unpatch events into the game.
@@ -59,8 +60,9 @@ public override void OnEnabled()
Log.Info($"{(Config.UseDynamicPatching ? "Non-event" : "All")} patches completed in {watch.Elapsed}");
PlayerAuthenticationManager.OnInstanceModeChanged -= RoleAssigner.CheckLateJoin;
+ CustomNetworkManager.OnClientStarted += Handlers.Internal.ClientStarted.OnClientStarted;
SceneManager.sceneUnloaded += Handlers.Internal.SceneUnloaded.OnSceneUnloaded;
- MapGeneration.SeedSynchronizer.OnMapGenerated += Handlers.Internal.MapGenerated.OnMapGenerated;
+ MapGeneration.SeedSynchronizer.OnGenerationFinished += Handlers.Internal.MapGenerated.OnMapGenerated;
UsableItemsController.ServerOnUsingCompleted += Handlers.Internal.Round.OnServerOnUsingCompleted;
Handlers.Server.WaitingForPlayers += Handlers.Internal.Round.OnWaitingForPlayers;
Handlers.Server.RestartingRound += Handlers.Internal.Round.OnRestartingRound;
@@ -71,7 +73,7 @@ public override void OnEnabled()
Handlers.Map.ChangedIntoGrenade += Handlers.Internal.ExplodingGrenade.OnChangedIntoGrenade;
CharacterClassManager.OnRoundStarted += Handlers.Server.OnRoundStarted;
- RespawnManager.ServerOnRespawned += Handlers.Server.OnRespawnedTeam;
+ WaveManager.OnWaveSpawned += Handlers.Server.OnRespawnedTeam;
InventorySystem.InventoryExtensions.OnItemAdded += Handlers.Player.OnItemAdded;
InventorySystem.InventoryExtensions.OnItemRemoved += Handlers.Player.OnItemRemoved;
@@ -81,6 +83,8 @@ public override void OnEnabled()
ItemPickupBase.OnPickupDestroyed += Handlers.Internal.PickupEvent.OnRemovedPickup;
ServerConsole.ReloadServerName();
+ ServerSpecificSettingsSync.ServerOnSettingValueReceived += SettingBase.OnSettingUpdated;
+
EventManager.RegisterEvents(this);
}
@@ -91,8 +95,9 @@ public override void OnDisabled()
Unpatch();
+ CustomNetworkManager.OnClientStarted -= Handlers.Internal.ClientStarted.OnClientStarted;
SceneManager.sceneUnloaded -= Handlers.Internal.SceneUnloaded.OnSceneUnloaded;
- MapGeneration.SeedSynchronizer.OnMapGenerated -= Handlers.Internal.MapGenerated.OnMapGenerated;
+ MapGeneration.SeedSynchronizer.OnGenerationFinished -= Handlers.Internal.MapGenerated.OnMapGenerated;
UsableItemsController.ServerOnUsingCompleted -= Handlers.Internal.Round.OnServerOnUsingCompleted;
Handlers.Server.WaitingForPlayers -= Handlers.Internal.Round.OnWaitingForPlayers;
Handlers.Server.RestartingRound -= Handlers.Internal.Round.OnRestartingRound;
@@ -106,12 +111,14 @@ public override void OnDisabled()
InventorySystem.InventoryExtensions.OnItemAdded -= Handlers.Player.OnItemAdded;
InventorySystem.InventoryExtensions.OnItemRemoved -= Handlers.Player.OnItemRemoved;
- RespawnManager.ServerOnRespawned -= Handlers.Server.OnRespawnedTeam;
+ WaveManager.OnWaveSpawned -= Handlers.Server.OnRespawnedTeam;
RagdollManager.OnRagdollSpawned -= Handlers.Internal.RagdollList.OnSpawnedRagdoll;
RagdollManager.OnRagdollRemoved -= Handlers.Internal.RagdollList.OnRemovedRagdoll;
ItemPickupBase.OnPickupAdded -= Handlers.Internal.PickupEvent.OnSpawnedPickup;
ItemPickupBase.OnPickupDestroyed -= Handlers.Internal.PickupEvent.OnRemovedPickup;
+ ServerSpecificSettingsSync.ServerOnSettingValueReceived -= SettingBase.OnSettingUpdated;
+
EventManager.UnregisterEvents(this);
}
diff --git a/EXILED/Exiled.Events/Features/Event.cs b/EXILED/Exiled.Events/Features/Event.cs
index c27c65703..9885747c7 100644
--- a/EXILED/Exiled.Events/Features/Event.cs
+++ b/EXILED/Exiled.Events/Features/Event.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Features/Event{T}.cs b/EXILED/Exiled.Events/Features/Event{T}.cs
index 8cbd18054..e9b6e546b 100644
--- a/EXILED/Exiled.Events/Features/Event{T}.cs
+++ b/EXILED/Exiled.Events/Features/Event{T}.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Features/Patcher.cs b/EXILED/Exiled.Events/Features/Patcher.cs
index d22c29c7c..cbc739fb3 100644
--- a/EXILED/Exiled.Events/Features/Patcher.cs
+++ b/EXILED/Exiled.Events/Features/Patcher.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Handlers/Cassie.cs b/EXILED/Exiled.Events/Handlers/Cassie.cs
index 9d2ca857f..de6ef95f6 100644
--- a/EXILED/Exiled.Events/Handlers/Cassie.cs
+++ b/EXILED/Exiled.Events/Handlers/Cassie.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Handlers/Internal/ClientStarted.cs b/EXILED/Exiled.Events/Handlers/Internal/ClientStarted.cs
new file mode 100644
index 000000000..a260cf495
--- /dev/null
+++ b/EXILED/Exiled.Events/Handlers/Internal/ClientStarted.cs
@@ -0,0 +1,53 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.Handlers.Internal
+{
+ using System.Collections.Generic;
+ using System.Linq;
+
+ using Exiled.API.Enums;
+ using Exiled.API.Features;
+ using Exiled.API.Features.Attributes;
+ using Mirror;
+ using PlayerRoles.Ragdolls;
+ using UnityEngine;
+
+ ///
+ /// Handles on client started event.
+ ///
+ internal static class ClientStarted
+ {
+ ///
+ /// Called once when the client is started.
+ ///
+ public static void OnClientStarted()
+ {
+ PrefabHelper.Prefabs.Clear();
+
+ Dictionary prefabs = new();
+
+ foreach (KeyValuePair prefab in NetworkClient.prefabs)
+ {
+ if(!prefabs.ContainsKey(prefab.Key))
+ prefabs.Add(prefab.Key, prefab.Value);
+ }
+
+ foreach (NetworkIdentity ragdollPrefab in RagdollManager.AllRagdollPrefabs)
+ {
+ if(!prefabs.ContainsKey(ragdollPrefab.assetId))
+ prefabs.Add(ragdollPrefab.assetId, ragdollPrefab.gameObject);
+ }
+
+ foreach (PrefabType prefabType in EnumUtils.Values)
+ {
+ PrefabAttribute attribute = prefabType.GetPrefabAttribute();
+ PrefabHelper.Prefabs.Add(prefabType, prefabs.FirstOrDefault(prefab => prefab.Key == attribute.AssetId || prefab.Value.name.Contains(attribute.Name)).Value);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/Handlers/Internal/ExplodingGrenade.cs b/EXILED/Exiled.Events/Handlers/Internal/ExplodingGrenade.cs
index 02eb4e1ce..c7f0a3669 100644
--- a/EXILED/Exiled.Events/Handlers/Internal/ExplodingGrenade.cs
+++ b/EXILED/Exiled.Events/Handlers/Internal/ExplodingGrenade.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Handlers/Internal/MapGenerated.cs b/EXILED/Exiled.Events/Handlers/Internal/MapGenerated.cs
index 30ad47c9f..1320ad76a 100644
--- a/EXILED/Exiled.Events/Handlers/Internal/MapGenerated.cs
+++ b/EXILED/Exiled.Events/Handlers/Internal/MapGenerated.cs
@@ -1,31 +1,20 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.Handlers.Internal
{
- using System;
using System.Collections.Generic;
using System.Linq;
using API.Features;
- using API.Features.Items;
- using API.Features.Pools;
- using API.Structs;
-
- using Exiled.API.Enums;
- using Exiled.API.Extensions;
using Exiled.API.Features.Lockers;
- using InventorySystem.Items.Firearms.Attachments;
- using InventorySystem.Items.Firearms.Attachments.Components;
using MEC;
- using Utils.NonAllocLINQ;
-
///
/// Handles event.
///
@@ -46,7 +35,6 @@ internal static class MapGenerated
public static void OnMapGenerated()
{
Map.ClearCache();
- PrefabHelper.LoadPrefabs();
Locker.ClearCache();
// TODO: Fix For (https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/377)
@@ -54,54 +42,7 @@ public static void OnMapGenerated()
PlayerRoles.RoleAssign.HumanSpawner.Handlers[PlayerRoles.Team.OtherAlive] = new PlayerRoles.RoleAssign.OneRoleHumanSpawner(PlayerRoles.RoleTypeId.Tutorial);
PlayerRoles.RoleAssign.HumanSpawner.Handlers[PlayerRoles.Team.Dead] = new PlayerRoles.RoleAssign.OneRoleHumanSpawner(PlayerRoles.RoleTypeId.Spectator);
- GenerateAttachments();
- Timing.CallDelayed(1, GenerateCache);
- }
-
- private static void GenerateCache()
- {
- Handlers.Map.OnGenerated();
-
- Timing.CallDelayed(0.1f, Handlers.Server.OnWaitingForPlayers);
- }
-
- private static void GenerateAttachments()
- {
- foreach (FirearmType firearmType in EnumUtils.Values)
- {
- if (firearmType == FirearmType.None)
- continue;
-
- if (Item.Create(firearmType.GetItemType()) is not Firearm firearm)
- continue;
-
- Firearm.ItemTypeToFirearmInstance.Add(firearmType, firearm);
-
- List attachmentIdentifiers = ListPool.Pool.Get();
- HashSet attachmentsSlots = HashSetPool.Pool.Get();
-
- uint code = 1;
-
- foreach (Attachment attachment in firearm.Attachments)
- {
- attachmentsSlots.Add(attachment.Slot);
- attachmentIdentifiers.Add(new(code, attachment.Name, attachment.Slot));
- code *= 2U;
- }
-
- uint baseCode = 0;
-
- attachmentsSlots
- .ForEach(slot => baseCode += attachmentIdentifiers
- .Where(attachment => attachment.Slot == slot)
- .Min(slot => slot.Code));
-
- Firearm.BaseCodesValue.Add(firearmType, baseCode);
- Firearm.AvailableAttachmentsValue.Add(firearmType, attachmentIdentifiers.ToArray());
-
- ListPool.Pool.Return(attachmentIdentifiers);
- HashSetPool.Pool.Return(attachmentsSlots);
- }
+ Timing.CallDelayed(1, Handlers.Map.OnGenerated);
}
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/Handlers/Internal/PickupEvent.cs b/EXILED/Exiled.Events/Handlers/Internal/PickupEvent.cs
index f1a151246..88c6aa43c 100644
--- a/EXILED/Exiled.Events/Handlers/Internal/PickupEvent.cs
+++ b/EXILED/Exiled.Events/Handlers/Internal/PickupEvent.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Handlers/Internal/RagdollList.cs b/EXILED/Exiled.Events/Handlers/Internal/RagdollList.cs
index 758a8b21c..4c2b95563 100644
--- a/EXILED/Exiled.Events/Handlers/Internal/RagdollList.cs
+++ b/EXILED/Exiled.Events/Handlers/Internal/RagdollList.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Handlers/Internal/Round.cs b/EXILED/Exiled.Events/Handlers/Internal/Round.cs
index 8f9bd58b2..9d04e5c4c 100644
--- a/EXILED/Exiled.Events/Handlers/Internal/Round.cs
+++ b/EXILED/Exiled.Events/Handlers/Internal/Round.cs
@@ -1,26 +1,35 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
namespace Exiled.Events.Handlers.Internal
{
+ using System.Collections.Generic;
using System.Linq;
using CentralAuth;
+ using Exiled.API.Enums;
using Exiled.API.Extensions;
using Exiled.API.Features;
+ using Exiled.API.Features.Core.UserSettings;
+ using Exiled.API.Features.Items;
+ using Exiled.API.Features.Pools;
using Exiled.API.Features.Roles;
+ using Exiled.API.Structs;
using Exiled.Events.EventArgs.Player;
using Exiled.Events.EventArgs.Scp049;
using Exiled.Loader;
using Exiled.Loader.Features;
using InventorySystem;
+ using InventorySystem.Items.Firearms.Attachments;
+ using InventorySystem.Items.Firearms.Attachments.Components;
using InventorySystem.Items.Usables;
using PlayerRoles;
using PlayerRoles.RoleAssign;
+ using Utils.NonAllocLINQ;
///
/// Handles some round clean-up events and some others related to players.
@@ -33,6 +42,7 @@ internal static class Round
///
public static void OnWaitingForPlayers()
{
+ GenerateAttachments();
MultiAdminFeatures.CallEvent(MultiAdminFeatures.EventType.WAITING_FOR_PLAYERS);
if (Events.Instance.Config.ShouldReloadConfigsAtRoundRestart)
@@ -86,6 +96,9 @@ public static void OnVerified(VerifiedEventArgs ev)
{
RoleAssigner.CheckLateJoin(ev.Player.ReferenceHub, ClientInstanceMode.ReadyClient);
+ if (SettingBase.SyncOnJoin != null && SettingBase.SyncOnJoin(ev.Player))
+ SettingBase.SendToPlayer(ev.Player);
+
// TODO: Remove if this has been fixed for https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/52
foreach (Room room in Room.List.Where(current => current.AreLightsOff))
{
@@ -93,5 +106,42 @@ public static void OnVerified(VerifiedEventArgs ev)
ev.Player.SendFakeSyncVar(room.RoomLightControllerNetIdentity, typeof(RoomLightController), nameof(RoomLightController.NetworkLightsEnabled), false);
}
}
+
+ private static void GenerateAttachments()
+ {
+ foreach (FirearmType firearmType in EnumUtils.Values)
+ {
+ if (firearmType == FirearmType.None)
+ continue;
+
+ if (Item.Create(firearmType.GetItemType()) is not Firearm firearm)
+ continue;
+
+ Firearm.ItemTypeToFirearmInstance.Add(firearmType, firearm);
+
+ List attachmentIdentifiers = ListPool.Pool.Get();
+ HashSet attachmentsSlots = HashSetPool.Pool.Get();
+
+ uint code = 1;
+
+ foreach (Attachment attachment in firearm.Attachments)
+ {
+ attachmentsSlots.Add(attachment.Slot);
+ attachmentIdentifiers.Add(new(code, attachment.Name, attachment.Slot));
+ code *= 2U;
+ }
+
+ uint baseCode = 0;
+ attachmentsSlots.ForEach(slot => baseCode += attachmentIdentifiers
+ .Where(attachment => attachment.Slot == slot)
+ .Min(slot => slot.Code));
+
+ Firearm.BaseCodesValue.Add(firearmType, baseCode);
+ Firearm.AvailableAttachmentsValue.Add(firearmType, attachmentIdentifiers.ToArray());
+
+ ListPool.Pool.Return(attachmentIdentifiers);
+ HashSetPool.Pool.Return(attachmentsSlots);
+ }
+ }
}
}
diff --git a/EXILED/Exiled.Events/Handlers/Internal/SceneUnloaded.cs b/EXILED/Exiled.Events/Handlers/Internal/SceneUnloaded.cs
index 4ecdc5f93..63bb70267 100644
--- a/EXILED/Exiled.Events/Handlers/Internal/SceneUnloaded.cs
+++ b/EXILED/Exiled.Events/Handlers/Internal/SceneUnloaded.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Handlers/Item.cs b/EXILED/Exiled.Events/Handlers/Item.cs
index 540c49022..22c8907a2 100644
--- a/EXILED/Exiled.Events/Handlers/Item.cs
+++ b/EXILED/Exiled.Events/Handlers/Item.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Handlers/Map.cs b/EXILED/Exiled.Events/Handlers/Map.cs
index 41f1978ae..3036d4ede 100644
--- a/EXILED/Exiled.Events/Handlers/Map.cs
+++ b/EXILED/Exiled.Events/Handlers/Map.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -25,11 +25,6 @@ public static class Map
///
public static Event PlacingBulletHole { get; set; } = new();
- ///
- /// Invoked before placing blood.
- ///
- public static Event PlacingBlood { get; set; } = new();
-
///
/// Invoked before announcing the light containment zone decontamination.
///
@@ -45,6 +40,11 @@ public static class Map
///
public static Event AnnouncingNtfEntrance { get; set; } = new();
+ ///
+ /// Invoked before announcing the Chaos entrance.
+ ///
+ public static Event AnnouncingChaosEntrance { get; set; } = new();
+
///
/// Invoked before a has been activated.
///
@@ -121,12 +121,6 @@ public static class Map
/// The instance.
public static void OnPlacingBulletHole(PlacingBulletHoleEventArgs ev) => PlacingBulletHole.InvokeSafely(ev);
- ///
- /// Called before placing bloods.
- ///
- /// The instance.
- public static void OnPlacingBlood(PlacingBloodEventArgs ev) => PlacingBlood.InvokeSafely(ev);
-
///
/// Called before announcing the light containment zone decontamination.
///
@@ -145,6 +139,12 @@ public static class Map
/// The instance.
public static void OnAnnouncingNtfEntrance(AnnouncingNtfEntranceEventArgs ev) => AnnouncingNtfEntrance.InvokeSafely(ev);
+ ///
+ /// Called before announcing the Chaos entrance.
+ ///
+ /// The instance.
+ public static void OnAnnouncingChaosEntrance(AnnouncingChaosEntranceEventArgs ev) => AnnouncingChaosEntrance.InvokeSafely(ev);
+
///
/// Called before a has been activated.
///
diff --git a/EXILED/Exiled.Events/Handlers/Player.cs b/EXILED/Exiled.Events/Handlers/Player.cs
index 2e6209741..42dcf7efa 100644
--- a/EXILED/Exiled.Events/Handlers/Player.cs
+++ b/EXILED/Exiled.Events/Handlers/Player.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -70,12 +70,16 @@ public class Player
public static Event EarningAchievement { get; set; } = new();
///
- /// Invoked before using an .
+ /// Invoked before the player starts to use an . In other words, it is invoked just before the animation starts.
///
+ ///
+ /// Will be invoked even if the is on cooldown.
+ /// Candies are the only that do not invoke this event.
+ ///
public static Event UsingItem { get; set; } = new();
///
- /// Invoked after a uses an .
+ /// Invoked before a finishes using a . In other words, it is invoked after the animation finishes but before the is actually used.
///
public static Event UsingItemCompleted { get; set; } = new ();
@@ -239,6 +243,11 @@ public class Player
///
public static Event Escaping { get; set; } = new();
+ ///
+ /// Invoked after a escapes.
+ ///
+ public static Event Escaped { get; set; } = new();
+
///
/// Invoked before a begins speaking to the intercom.
///
@@ -496,8 +505,8 @@ public class Player
///
/// Invoked before a damage a Window.
- /// // TODO: DamagingWindow instead of PlayerDamageWindow
- public static Event PlayerDamageWindow { get; set; } = new();
+ ///
+ public static Event DamagingWindow { get; set; } = new();
///
/// Invoked before a damage a Door.
@@ -514,12 +523,6 @@ public class Player
///
public static Event ItemRemoved { get; set; } = new();
- ///
- /// Invoked before KillPlayer is called.
- ///
- [Obsolete("Use DyingEventArgs")]
- public static Event KillingPlayer { get; set; } = new();
-
///
/// Invoked before a enters in an environmental hazard.
///
@@ -540,6 +543,33 @@ public class Player
///
public static Event ChangingNickname { get; set; } = new();
+ ///
+ /// Invoked before a player's emotion changed.
+ ///
+ public static Event ChangingEmotion { get; set; } = new();
+
+ ///
+ /// Invoked after a player's emotion changed.
+ ///
+ public static Event ChangedEmotion { get; set; } = new();
+
+ ///
+ /// Invoked before disruptor's mode is changed.
+ ///
+ public static Event ChangingDisruptorMode { get; set; } = new();
+
+ ///
+ /// Called before a player's emotion changed.
+ ///
+ /// The instance.
+ public static void OnChangingEmotion(ChangingEmotionEventArgs ev) => ChangingEmotion.InvokeSafely(ev);
+
+ ///
+ /// Called after a player's emotion changed.
+ ///
+ /// The instance.
+ public static void OnChangedEmotion(ChangedEmotionEventArgs ev) => ChangedEmotion.InvokeSafely(ev);
+
///
/// Called before reserved slot is resolved for a .
///
@@ -671,8 +701,7 @@ public class Player
/// Called before throwing a grenade.
///
/// The instance.
- // TODO: rename that to OnThrownProjectile
- public static void OnThrowingProjectile(ThrownProjectileEventArgs ev) => ThrownProjectile.InvokeSafely(ev);
+ public static void OnThrownProjectile(ThrownProjectileEventArgs ev) => ThrownProjectile.InvokeSafely(ev);
///
/// Called before receving a throwing request.
@@ -734,6 +763,12 @@ public class Player
/// The instance.
public static void OnEscaping(EscapingEventArgs ev) => Escaping.InvokeSafely(ev);
+ ///
+ /// Called after a escapes.
+ ///
+ /// The instance.
+ public static void OnEscaped(EscapedEventArgs ev) => Escaped.InvokeSafely(ev);
+
///
/// Called before a begins speaking to the intercom.
///
@@ -974,13 +1009,6 @@ public class Player
/// The instance.
public static void OnSendingAdminChatMessage(SendingAdminChatMessageEventsArgs ev) => SendingAdminChatMessage.InvokeSafely(ev);
- ///
- /// Called before KillPlayer is called.
- ///
- /// The event handler.
- [Obsolete("Use DyingEventArgs")]
- public static void OnKillPlayer(KillingPlayerEventArgs ev) => KillingPlayer.InvokeSafely(ev);
-
///
/// Called after a has an item added to their inventory.
///
@@ -1007,11 +1035,12 @@ public static void OnItemAdded(ReferenceHub referenceHub, InventorySystem.Items.
public static void OnItemRemoved(ReferenceHub referenceHub, InventorySystem.Items.ItemBase itemBase, InventorySystem.Items.Pickups.ItemPickupBase pickupBase)
{
ItemRemovedEventArgs ev = new(referenceHub, itemBase, pickupBase);
- ItemRemoved.InvokeSafely(ev);
ev.Player.ItemsValue.Remove(ev.Item);
API.Features.Items.Item.BaseToItem.Remove(itemBase);
+
+ ItemRemoved.InvokeSafely(ev);
}
///
@@ -1036,7 +1065,7 @@ public static void OnItemRemoved(ReferenceHub referenceHub, InventorySystem.Item
/// Called before a damage a window.
///
/// The instance.
- public static void OnPlayerDamageWindow(DamagingWindowEventArgs ev) => PlayerDamageWindow.InvokeSafely(ev);
+ public static void OnDamagingWindow(DamagingWindowEventArgs ev) => DamagingWindow.InvokeSafely(ev);
///
/// Called before a damage a window.
@@ -1164,6 +1193,12 @@ public static void OnItemRemoved(ReferenceHub referenceHub, InventorySystem.Item
/// The instance.
public static void OnChangingNickname(ChangingNicknameEventArgs ev) => ChangingNickname.InvokeSafely(ev);
+ ///
+ /// Called before disruptor's mode is changed.
+ ///
+ /// The instance.
+ public static void OnChangingDisruptorMode(ChangingDisruptorModeEventArgs ev) => ChangingDisruptorMode.InvokeSafely(ev);
+
///
/// Called before pre-authenticating a .
///
diff --git a/EXILED/Exiled.Events/Handlers/Scp049.cs b/EXILED/Exiled.Events/Handlers/Scp049.cs
index 62f4766dc..94bb96574 100644
--- a/EXILED/Exiled.Events/Handlers/Scp049.cs
+++ b/EXILED/Exiled.Events/Handlers/Scp049.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Handlers/Scp0492.cs b/EXILED/Exiled.Events/Handlers/Scp0492.cs
index 82ee09d8d..0d03a3727 100644
--- a/EXILED/Exiled.Events/Handlers/Scp0492.cs
+++ b/EXILED/Exiled.Events/Handlers/Scp0492.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Handlers/Scp079.cs b/EXILED/Exiled.Events/Handlers/Scp079.cs
index b272defea..dab2d32c9 100644
--- a/EXILED/Exiled.Events/Handlers/Scp079.cs
+++ b/EXILED/Exiled.Events/Handlers/Scp079.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Handlers/Scp096.cs b/EXILED/Exiled.Events/Handlers/Scp096.cs
index 60a01b367..76a6052fb 100644
--- a/EXILED/Exiled.Events/Handlers/Scp096.cs
+++ b/EXILED/Exiled.Events/Handlers/Scp096.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Handlers/Scp106.cs b/EXILED/Exiled.Events/Handlers/Scp106.cs
index da2645466..ca6a21561 100644
--- a/EXILED/Exiled.Events/Handlers/Scp106.cs
+++ b/EXILED/Exiled.Events/Handlers/Scp106.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Handlers/Scp1344.cs b/EXILED/Exiled.Events/Handlers/Scp1344.cs
new file mode 100644
index 000000000..e3cd688c7
--- /dev/null
+++ b/EXILED/Exiled.Events/Handlers/Scp1344.cs
@@ -0,0 +1,75 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.Handlers
+{
+#pragma warning disable SA1623 // Property summary documentation should match accessors
+
+ using Exiled.Events.EventArgs.Scp1344;
+ using Exiled.Events.Features;
+
+ ///
+ /// SCP-1344 related events.
+ ///
+ public static class Scp1344
+ {
+ ///
+ /// Invoked before SCP-1344 status changing.
+ ///
+ public static Event ChangingStatus { get; set; } = new();
+
+ ///
+ /// Invoked after SCP-1344 status changing.
+ ///
+ public static Event ChangedStatus { get; set; } = new();
+
+ ///
+ /// Invoked after trying deactivating SCP-1344.
+ ///
+ public static Event TryingDeactivating { get; set; } = new();
+
+ ///
+ /// Invoked before deactivating SCP-1344.
+ ///
+ public static Event Deactivating { get; set; } = new();
+
+ ///
+ /// Invoked after deactivating SCP-1344.
+ ///
+ public static Event Deactivated { get; set; } = new();
+
+ ///
+ /// Called after deactivating SCP-1344.
+ ///
+ /// The instance.
+ public static void OnDeactivated(DeactivatedEventArgs ev) => Deactivated.InvokeSafely(ev);
+
+ ///
+ /// Called before deactivating SCP-1344.
+ ///
+ /// The instance.
+ public static void OnDeactivating(DeactivatingEventArgs ev) => Deactivating.InvokeSafely(ev);
+
+ ///
+ /// Called after trying deactivating SCP-1344.
+ ///
+ /// The instance.
+ public static void OnTryingDeactivating(TryingDeactivatingEventArgs ev) => TryingDeactivating.InvokeSafely(ev);
+
+ ///
+ /// Called before SCP-1344 status changing.
+ ///
+ /// The instance.
+ public static void OnChangingStatus(ChangingStatusEventArgs ev) => ChangingStatus.InvokeSafely(ev);
+
+ ///
+ /// Called after SCP-1344 status changing.
+ ///
+ /// The instance.
+ public static void OnChangedStatus(ChangedStatusEventArgs ev) => ChangedStatus.InvokeSafely(ev);
+ }
+}
diff --git a/EXILED/Exiled.Events/Handlers/Scp173.cs b/EXILED/Exiled.Events/Handlers/Scp173.cs
index bf844714b..ea6e0311e 100644
--- a/EXILED/Exiled.Events/Handlers/Scp173.cs
+++ b/EXILED/Exiled.Events/Handlers/Scp173.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -37,6 +37,11 @@ public static class Scp173
///
public static Event UsingBreakneckSpeeds { get; set; } = new();
+ ///
+ /// Invoked before SCP-173 is observed.
+ ///
+ public static Event BeingObserved { get; set; } = new();
+
///
/// Called before players near SCP-173 blink.
///
@@ -60,5 +65,11 @@ public static class Scp173
///
/// The instance.
public static void OnUsingBreakneckSpeeds(UsingBreakneckSpeedsEventArgs ev) => UsingBreakneckSpeeds.InvokeSafely(ev);
+
+ ///
+ /// Called before Scp 173 is observed.
+ ///
+ /// The instance.
+ public static void OnBeingObserved(BeingObservedEventArgs ev) => BeingObserved.InvokeSafely(ev);
}
-}
\ No newline at end of file
+}
diff --git a/EXILED/Exiled.Events/Handlers/Scp244.cs b/EXILED/Exiled.Events/Handlers/Scp244.cs
index f986ba032..4145f57e8 100644
--- a/EXILED/Exiled.Events/Handlers/Scp244.cs
+++ b/EXILED/Exiled.Events/Handlers/Scp244.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Handlers/Scp3114.cs b/EXILED/Exiled.Events/Handlers/Scp3114.cs
index 4c62fcfba..2e76d90d5 100644
--- a/EXILED/Exiled.Events/Handlers/Scp3114.cs
+++ b/EXILED/Exiled.Events/Handlers/Scp3114.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Handlers/Scp330.cs b/EXILED/Exiled.Events/Handlers/Scp330.cs
index a5dcd44c9..d1ef07eba 100644
--- a/EXILED/Exiled.Events/Handlers/Scp330.cs
+++ b/EXILED/Exiled.Events/Handlers/Scp330.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Handlers/Scp914.cs b/EXILED/Exiled.Events/Handlers/Scp914.cs
index 77157ef90..a9efe220a 100644
--- a/EXILED/Exiled.Events/Handlers/Scp914.cs
+++ b/EXILED/Exiled.Events/Handlers/Scp914.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Handlers/Scp939.cs b/EXILED/Exiled.Events/Handlers/Scp939.cs
index e82e94a80..04e4997dd 100644
--- a/EXILED/Exiled.Events/Handlers/Scp939.cs
+++ b/EXILED/Exiled.Events/Handlers/Scp939.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Handlers/Server.cs b/EXILED/Exiled.Events/Handlers/Server.cs
index 3f5b71e63..c86a8adee 100644
--- a/EXILED/Exiled.Events/Handlers/Server.cs
+++ b/EXILED/Exiled.Events/Handlers/Server.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -10,9 +10,10 @@ namespace Exiled.Events.Handlers
using System.Collections.Generic;
using Respawning;
+ using Respawning.Waves;
+
#pragma warning disable SA1623 // Property summary documentation should match accessors
- using Exiled.Events.EventArgs.Player;
using Exiled.Events.EventArgs.Server;
using Exiled.Events.Features;
@@ -163,9 +164,9 @@ public static class Server
///
/// Called after team spawns.
///
- ///
+ ///
///
- public static void OnRespawnedTeam(SpawnableTeamType teamType, List hubs) => RespawnedTeam.InvokeSafely(new RespawnedTeamEventArgs(teamType, hubs));
+ public static void OnRespawnedTeam(SpawnableWaveBase teamType, List hubs) => RespawnedTeam.InvokeSafely(new RespawnedTeamEventArgs(teamType, hubs));
///
/// Called before adding an unit name.
diff --git a/EXILED/Exiled.Events/Handlers/Warhead.cs b/EXILED/Exiled.Events/Handlers/Warhead.cs
index 8c2406197..0d253e121 100644
--- a/EXILED/Exiled.Events/Handlers/Warhead.cs
+++ b/EXILED/Exiled.Events/Handlers/Warhead.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Cassie/SendingCassieMessage.cs b/EXILED/Exiled.Events/Patches/Events/Cassie/SendingCassieMessage.cs
index 9c49d4497..1bdacfd8f 100644
--- a/EXILED/Exiled.Events/Patches/Events/Cassie/SendingCassieMessage.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Cassie/SendingCassieMessage.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Item/ChangingAmmo.cs b/EXILED/Exiled.Events/Patches/Events/Item/ChangingAmmo.cs
index e90d812c2..7ef8824da 100644
--- a/EXILED/Exiled.Events/Patches/Events/Item/ChangingAmmo.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Item/ChangingAmmo.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -23,13 +23,15 @@ namespace Exiled.Events.Patches.Events.Item
using static HarmonyLib.AccessTools;
///
- /// Patches .
+ /// Patches .
/// Adds the event.
///
[EventPatch(typeof(Item), nameof(Item.ChangingAmmo))]
- [HarmonyPatch(typeof(Firearm), nameof(Firearm.Status), MethodType.Setter)]
+
+ // [HarmonyPatch(typeof(Firearm), nameof(Firearm.Status), MethodType.Setter)]
internal static class ChangingAmmo
{
+ /*
private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator)
{
List newInstructions = ListPool.Pool.Get(instructions);
@@ -137,5 +139,6 @@ private static IEnumerable Transpiler(IEnumerable.Pool.Return(newInstructions);
}
+ */
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/Patches/Events/Item/ChangingAttachments.cs b/EXILED/Exiled.Events/Patches/Events/Item/ChangingAttachments.cs
index 17394e444..c820ab438 100644
--- a/EXILED/Exiled.Events/Patches/Events/Item/ChangingAttachments.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Item/ChangingAttachments.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Item/JailbirdPatch.cs b/EXILED/Exiled.Events/Patches/Events/Item/JailbirdPatch.cs
index 1f8489fd3..af13bdffc 100644
--- a/EXILED/Exiled.Events/Patches/Events/Item/JailbirdPatch.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Item/JailbirdPatch.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Item/KeycardInteracting.cs b/EXILED/Exiled.Events/Patches/Events/Item/KeycardInteracting.cs
index 2797da097..bf3e54472 100644
--- a/EXILED/Exiled.Events/Patches/Events/Item/KeycardInteracting.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Item/KeycardInteracting.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Item/ReceivingPreference.cs b/EXILED/Exiled.Events/Patches/Events/Item/ReceivingPreference.cs
index 6d845fffa..96b9907b3 100644
--- a/EXILED/Exiled.Events/Patches/Events/Item/ReceivingPreference.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Item/ReceivingPreference.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -39,7 +39,8 @@ private static IEnumerable Transpiler(IEnumerable newInstructions = ListPool.Pool.Get(instructions);
- int index = newInstructions.FindLastIndex(instruction => instruction.opcode == OpCodes.Ldloc_1);
+ int offset = 1;
+ int index = newInstructions.FindIndex(instruction => instruction.opcode == OpCodes.Ret) + offset;
LocalBuilder ev = generator.DeclareLocal(typeof(ReceivingPreferenceEventArgs));
LocalBuilder curCode = generator.DeclareLocal(typeof(uint));
diff --git a/EXILED/Exiled.Events/Patches/Events/Item/UsingRadioPickupBattery.cs b/EXILED/Exiled.Events/Patches/Events/Item/UsingRadioPickupBattery.cs
index d257ff973..7d54efe70 100644
--- a/EXILED/Exiled.Events/Patches/Events/Item/UsingRadioPickupBattery.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Item/UsingRadioPickupBattery.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Map/AnnouncingChaosEntrance.cs b/EXILED/Exiled.Events/Patches/Events/Map/AnnouncingChaosEntrance.cs
new file mode 100644
index 000000000..1bf2c9c02
--- /dev/null
+++ b/EXILED/Exiled.Events/Patches/Events/Map/AnnouncingChaosEntrance.cs
@@ -0,0 +1,84 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.Patches.Events.Map
+{
+ using System.Collections.Generic;
+ using System.Reflection;
+ using System.Reflection.Emit;
+ using System.Text;
+
+ using Exiled.API.Features.Pools;
+ using Exiled.Events.Attributes;
+ using Exiled.Events.EventArgs.Map;
+ using HarmonyLib;
+ using Respawning.Announcements;
+
+ using static HarmonyLib.AccessTools;
+
+ ///
+ /// Patches and
+ /// to add event.
+ ///
+ [EventPatch(typeof(Handlers.Map), nameof(Handlers.Map.AnnouncingChaosEntrance))]
+ [HarmonyPatch]
+ internal static class AnnouncingChaosEntrance
+ {
+ private static IEnumerable TargetMethods()
+ {
+ yield return Method(typeof(ChaosWaveAnnouncement), nameof(ChaosWaveAnnouncement.CreateAnnouncementString));
+ yield return Method(typeof(ChaosMiniwaveAnnouncement), nameof(ChaosMiniwaveAnnouncement.CreateAnnouncementString));
+ }
+
+ private static IEnumerable Transpiler(IEnumerable instruction, ILGenerator generator)
+ {
+ List newInstructions = ListPool.Pool.Get(instruction);
+
+ Label continueLabel = generator.DefineLabel();
+
+ LocalBuilder ev = generator.DeclareLocal(typeof(AnnouncingChaosEntranceEventArgs));
+
+ int index = newInstructions.FindIndex(i => i.opcode == OpCodes.Ldloca_S);
+
+ newInstructions.InsertRange(index, new[]
+ {
+ // WaveAnnouncementBase
+ new(OpCodes.Ldarg_0),
+
+ // builder
+ new(OpCodes.Ldarg_1),
+
+ // new AnnouncingChaosEntranceEventArgs(WaveAnnouncementBase, StringBuilder)
+ new(OpCodes.Newobj, GetDeclaredConstructors(typeof(AnnouncingChaosEntranceEventArgs))[0]),
+ new(OpCodes.Dup),
+ new(OpCodes.Dup),
+ new(OpCodes.Stloc_S, ev.LocalIndex),
+
+ // Map.OnAnnouncingChaosEntrance(ev)
+ new(OpCodes.Call, Method(typeof(Handlers.Map), nameof(Handlers.Map.OnAnnouncingChaosEntrance))),
+
+ // if (!ev.IsAllowed)
+ // builder.Clear();
+ // return;
+ new(OpCodes.Callvirt, PropertyGetter(typeof(AnnouncingChaosEntranceEventArgs), nameof(AnnouncingChaosEntranceEventArgs.IsAllowed))),
+ new(OpCodes.Brtrue_S, continueLabel),
+
+ new(OpCodes.Ldarg_1),
+ new(OpCodes.Callvirt, Method(typeof(StringBuilder), nameof(StringBuilder.Clear))),
+ new(OpCodes.Pop),
+ new(OpCodes.Ret),
+
+ new CodeInstruction(OpCodes.Nop).WithLabels(continueLabel),
+ });
+
+ for (int z = 0; z < newInstructions.Count; z++)
+ yield return newInstructions[z];
+
+ ListPool.Pool.Return(newInstructions);
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/Patches/Events/Map/AnnouncingDecontamination.cs b/EXILED/Exiled.Events/Patches/Events/Map/AnnouncingDecontamination.cs
index 14a78a767..23882fa6c 100644
--- a/EXILED/Exiled.Events/Patches/Events/Map/AnnouncingDecontamination.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Map/AnnouncingDecontamination.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Map/AnnouncingNtfEntrance.cs b/EXILED/Exiled.Events/Patches/Events/Map/AnnouncingNtfEntrance.cs
index 484516c7f..f9663ecc7 100644
--- a/EXILED/Exiled.Events/Patches/Events/Map/AnnouncingNtfEntrance.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Map/AnnouncingNtfEntrance.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -8,29 +8,34 @@
namespace Exiled.Events.Patches.Events.Map
{
using System.Collections.Generic;
+ using System.Reflection;
using System.Reflection.Emit;
using System.Text.RegularExpressions;
using API.Features.Pools;
using Exiled.Events.Attributes;
using Exiled.Events.EventArgs.Map;
-
using Handlers;
-
using HarmonyLib;
-
+ using Respawning.Announcements;
using Respawning.NamingRules;
using static HarmonyLib.AccessTools;
///
- /// Patch the .
+ /// Patch the and .
/// Adds the event.
///
[EventPatch(typeof(Map), nameof(Map.AnnouncingNtfEntrance))]
- [HarmonyPatch(typeof(NineTailedFoxNamingRule), nameof(NineTailedFoxNamingRule.PlayEntranceAnnouncement))]
+ [HarmonyPatch]
internal static class AnnouncingNtfEntrance
{
+ private static IEnumerable TargetMethods()
+ {
+ yield return Method(typeof(NtfWaveAnnouncement), nameof(NtfWaveAnnouncement.CreateAnnouncementString));
+ yield return Method(typeof(NtfMiniwaveAnnouncement), nameof(NtfMiniwaveAnnouncement.CreateAnnouncementString));
+ }
+
private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator)
{
List newInstructions = ListPool.Pool.Get(instructions);
@@ -40,31 +45,21 @@ private static IEnumerable Transpiler(IEnumerable instruction.opcode == OpCodes.Stloc_1) + offset;
-
- // int scpsLeft = ReferenceHub.GetAllHubs().Values.Count(x => x.characterClassManager.CurRole.team == Team.SCP && x.characterClassManager.CurClass != RoleTypeId.Scp0492);
- // string unitNameClear = Regex.Replace(unitName, "<[^>]*?>", string.Empty);
- // string[] unitInformation = unitNameClear.Split('-');
- //
- // AnnouncingNtfEntranceEventArgs ev = new(scpsLeft, unitInformation[0], int.Parse(unitInformation[1]));
- // Map.OnAnnouncingNtfEntrance(ev);
- //
- // if (!ev.IsAllowed)
- // return;
- //
- // unitName = $"{ev.UnitName}-{ev.UnitNumber};
- // cassieUnitName = this.GetCassieUnitName(unitName);
- // scpsLeft = ev.ScpsLeft;
+ int offset = 1;
+ int index = newInstructions.FindIndex(instruction => instruction.opcode == OpCodes.Stloc_3) + offset;
+
newInstructions.InsertRange(
index,
- new[]
+ new CodeInstruction[]
{
+ // WaveAnnouncementBase
+ new(OpCodes.Ldarg_0),
+
// int scpsLeft = ReferenceHub.GetAllHubs().Values.Count(x => x.characterClassManager.CurRole.team == Team.SCP && x.characterClassManager.CurClass != RoleTypeId.Scp0492);
- new CodeInstruction(OpCodes.Ldloc_1),
+ new(OpCodes.Ldloc_3),
// string[] unitInformation = unitNameClear.Split('-');
- new(OpCodes.Ldarg_1),
+ new(OpCodes.Ldloc_1),
new(OpCodes.Ldstr, "<[^>]*?>"),
new(OpCodes.Ldsfld, Field(typeof(string), nameof(string.Empty))),
new(OpCodes.Call, Method(typeof(Regex), nameof(Regex.Replace), new System.Type[] { typeof(string), typeof(string), typeof(string) })),
@@ -87,7 +82,6 @@ private static IEnumerable Transpiler(IEnumerable Transpiler(IEnumerable Transpiler(IEnumerable
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Map/AnnouncingTeamEntrance.cs b/EXILED/Exiled.Events/Patches/Events/Map/AnnouncingTeamEntrance.cs
new file mode 100644
index 000000000..a4707c72e
--- /dev/null
+++ b/EXILED/Exiled.Events/Patches/Events/Map/AnnouncingTeamEntrance.cs
@@ -0,0 +1,57 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.Patches.Events.Map
+{
+ using System.Collections.Generic;
+ using System.Reflection;
+ using System.Reflection.Emit;
+ using System.Text;
+
+ using Exiled.API.Features.Pools;
+ using Exiled.Events.Attributes;
+ using Exiled.Events.EventArgs.Map;
+ using HarmonyLib;
+ using Respawning.Announcements;
+
+ using static HarmonyLib.AccessTools;
+
+ ///
+ /// Patches to prevent cassie from playing empty string.
+ ///
+ [EventPatch(typeof(Handlers.Map), nameof(Handlers.Map.AnnouncingNtfEntrance))]
+ [EventPatch(typeof(Handlers.Map), nameof(Handlers.Map.AnnouncingChaosEntrance))]
+ [HarmonyPatch(typeof(WaveAnnouncementBase), nameof(WaveAnnouncementBase.PlayAnnouncement))]
+ internal static class AnnouncingTeamEntrance
+ {
+ private static IEnumerable Transpiler(IEnumerable instruction, ILGenerator generator)
+ {
+ List newInstructions = ListPool.Pool.Get(instruction);
+
+ Label returnLabel = generator.DefineLabel();
+
+ int index = newInstructions.FindLastIndex(i => i.opcode == OpCodes.Ldsfld);
+
+ newInstructions.InsertRange(index, new CodeInstruction[]
+ {
+ // if (stringReturn == "")
+ // return;
+ new(OpCodes.Ldloc_S, 4),
+ new(OpCodes.Ldstr, string.Empty),
+ new(OpCodes.Ceq),
+ new(OpCodes.Brtrue_S, returnLabel),
+ });
+
+ newInstructions[newInstructions.Count - 1].labels.Add(returnLabel);
+
+ for (int z = 0; z < newInstructions.Count; z++)
+ yield return newInstructions[z];
+
+ ListPool.Pool.Return(newInstructions);
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/Patches/Events/Map/BreakingScp2176.cs b/EXILED/Exiled.Events/Patches/Events/Map/BreakingScp2176.cs
index 53f8f97e4..8236e2c48 100644
--- a/EXILED/Exiled.Events/Patches/Events/Map/BreakingScp2176.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Map/BreakingScp2176.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -56,8 +56,8 @@ private static IEnumerable Transpiler(IEnumerable, bool)
- new(OpCodes.Newobj, DeclaredConstructor(typeof(ExplodingGrenadeEventArgs), new[] { typeof(Player), typeof(EffectGrenade), typeof(List), typeof(bool) })),
+ // new ExplodingGrenadeEventArgs(Player, EffectGrenade, HashSet, bool)
+ new(OpCodes.Newobj, DeclaredConstructor(typeof(ExplodingGrenadeEventArgs), new[] { typeof(Player), typeof(EffectGrenade), typeof(HashSet), typeof(bool) })),
new(OpCodes.Dup),
// Handlers.Map.OnExplodingGrenade(ev);
diff --git a/EXILED/Exiled.Events/Patches/Events/Map/ChangingIntoGrenade.cs b/EXILED/Exiled.Events/Patches/Events/Map/ChangingIntoGrenade.cs
index 397fbe7db..30ec11522 100644
--- a/EXILED/Exiled.Events/Patches/Events/Map/ChangingIntoGrenade.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Map/ChangingIntoGrenade.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Map/Decontaminating.cs b/EXILED/Exiled.Events/Patches/Events/Map/Decontaminating.cs
index ccea1a251..6c8ad469a 100644
--- a/EXILED/Exiled.Events/Patches/Events/Map/Decontaminating.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Map/Decontaminating.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Map/ExplodingFlashGrenade.cs b/EXILED/Exiled.Events/Patches/Events/Map/ExplodingFlashGrenade.cs
index 804234685..4413d1829 100644
--- a/EXILED/Exiled.Events/Patches/Events/Map/ExplodingFlashGrenade.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Map/ExplodingFlashGrenade.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -12,8 +12,10 @@ namespace Exiled.Events.Patches.Events.Map
using API.Features;
using API.Features.Pools;
+ using Exiled.API.Extensions;
using Exiled.Events.EventArgs.Map;
using Exiled.Events.Patches.Generic;
+ using Footprinting;
using HarmonyLib;
using InventorySystem.Items.ThrowableProjectiles;
using UnityEngine;
@@ -61,15 +63,14 @@ private static IEnumerable Transpiler(IEnumerable targetToAffect = ListPool.Pool.Get();
- foreach (ReferenceHub referenceHub in ReferenceHub.AllHubs)
+ HashSet targetToAffect = HashSetPool.Pool.Get();
+ foreach (Player player in Player.List)
{
- Player player = Player.Get(referenceHub);
- if ((instance.transform.position - referenceHub.transform.position).sqrMagnitude >= distance)
+ if ((instance.transform.position - player.Position).sqrMagnitude >= distance)
continue;
- if (!ExiledEvents.Instance.Config.CanFlashbangsAffectThrower && instance.PreviousOwner.SameLife(new(referenceHub)))
+ if (!ExiledEvents.Instance.Config.CanFlashbangsAffectThrower && instance.PreviousOwner.CompareLife(player.ReferenceHub))
continue;
- if (!IndividualFriendlyFire.CheckFriendlyFirePlayer(instance.PreviousOwner, player.ReferenceHub) && !instance.PreviousOwner.SameLife(new(referenceHub)))
+ if (!IndividualFriendlyFire.CheckFriendlyFirePlayer(instance.PreviousOwner, player.ReferenceHub) && !instance.PreviousOwner.CompareLife(player.ReferenceHub))
continue;
if (Physics.Linecast(instance.transform.position, player.CameraTransform.position, instance._blindingMask))
continue;
@@ -79,7 +80,7 @@ private static void ProcessEvent(FlashbangGrenade instance, float distance)
ExplodingGrenadeEventArgs explodingGrenadeEvent = new(Player.Get(instance.PreviousOwner.Hub), instance, targetToAffect);
- ListPool.Pool.Return(targetToAffect);
+ HashSetPool.Pool.Return(targetToAffect);
Handlers.Map.OnExplodingGrenade(explodingGrenadeEvent);
diff --git a/EXILED/Exiled.Events/Patches/Events/Map/ExplodingFragGrenade.cs b/EXILED/Exiled.Events/Patches/Events/Map/ExplodingFragGrenade.cs
index c4df40bc2..37a8bef64 100644
--- a/EXILED/Exiled.Events/Patches/Events/Map/ExplodingFragGrenade.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Map/ExplodingFragGrenade.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -26,7 +26,7 @@ namespace Exiled.Events.Patches.Events.Map
using static HarmonyLib.AccessTools;
///
- /// Patches .
+ /// Patches .
/// Adds the event.
///
[EventPatch(typeof(Handlers.Map), nameof(Handlers.Map.ExplodingGrenade))]
diff --git a/EXILED/Exiled.Events/Patches/Events/Map/FillingLocker.cs b/EXILED/Exiled.Events/Patches/Events/Map/FillingLocker.cs
index 8d3a53ace..0816e0934 100644
--- a/EXILED/Exiled.Events/Patches/Events/Map/FillingLocker.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Map/FillingLocker.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -37,14 +37,14 @@ private static IEnumerable Transpiler(IEnumerable instruction.Calls(Method(typeof(HashSet), nameof(HashSet.Add), new[] { typeof(ItemPickupBase) }))) + offset;
+ int index = newInstructions.FindIndex(instruction => instruction.Calls(Method(typeof(List), nameof(List.Add), new[] { typeof(ItemPickupBase) }))) + offset;
newInstructions.InsertRange(
index,
new[]
{
// FillingLockerEventArgs ev = new(ItemPickupBase, loockerChamber)
- new(OpCodes.Ldloc_S, 4),
+ new(OpCodes.Ldloc_S, 5),
new(OpCodes.Ldarg_0),
new CodeInstruction(OpCodes.Newobj, GetDeclaredConstructors(typeof(FillingLockerEventArgs))[0]),
new(OpCodes.Dup),
diff --git a/EXILED/Exiled.Events/Patches/Events/Map/GeneratorActivating.cs b/EXILED/Exiled.Events/Patches/Events/Map/GeneratorActivating.cs
index e483353ad..dad771417 100644
--- a/EXILED/Exiled.Events/Patches/Events/Map/GeneratorActivating.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Map/GeneratorActivating.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Map/PlacingBlood.cs b/EXILED/Exiled.Events/Patches/Events/Map/PlacingBlood.cs
deleted file mode 100644
index 2c492ed38..000000000
--- a/EXILED/Exiled.Events/Patches/Events/Map/PlacingBlood.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
-// Licensed under the CC BY-SA 3.0 license.
-//
-// -----------------------------------------------------------------------
-
-namespace Exiled.Events.Patches.Events.Map
-{
- using System.Collections.Generic;
- using System.Reflection.Emit;
-
- using API.Features.Pools;
- using Exiled.Events.Attributes;
- using Exiled.Events.EventArgs.Map;
-
- using HarmonyLib;
-
- using InventorySystem.Items.Firearms.Modules;
-
- using UnityEngine;
-
- using static HarmonyLib.AccessTools;
-
- using ExiledEvents = Exiled.Events.Events;
-
- ///
- /// Patches .
- /// Adds the event.
- ///
- [EventPatch(typeof(Handlers.Map), nameof(Handlers.Map.PlacingBlood))]
- [HarmonyPatch(typeof(StandardHitregBase), nameof(StandardHitregBase.PlaceBloodDecal))]
- internal static class PlacingBlood
- {
- private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator)
- {
- List newInstructions = ListPool.Pool.Get(instructions);
-
- Label returnLabel = generator.DefineLabel();
-
- LocalBuilder ev = generator.DeclareLocal(typeof(PlacingBloodEventArgs));
-
- // if (!ExiledEvents.Instance.Config.CanSpawnBlood)
- // return;
- //
- // PlacingBloodEventArgs ev = new(Player.Get(this.Hub), Player.Get(target.NetworkId), hit, true);
- //
- // Handlers.Map.OnPlacingBlood(ev);
- //
- // if (!ev.IsAllowed)
- // return;
- //
- // hit.point = ev.Position;
- newInstructions.InsertRange(
- 0,
- new[]
- {
- // if (!ExiledEvents.Instance.Config.CanSpawnBlood)
- // return;
- new CodeInstruction(OpCodes.Call, PropertyGetter(typeof(ExiledEvents), nameof(ExiledEvents.Instance))),
- new(OpCodes.Callvirt, PropertyGetter(typeof(ExiledEvents), nameof(ExiledEvents.Config))),
- new(OpCodes.Callvirt, PropertyGetter(typeof(Config), nameof(Config.CanSpawnBlood))),
- new(OpCodes.Brfalse_S, returnLabel),
-
- // Player.Get(this.Hub)
- new(OpCodes.Ldarg_0),
- new(OpCodes.Callvirt, PropertyGetter(typeof(StandardHitregBase), nameof(StandardHitregBase.Hub))),
- new(OpCodes.Call, Method(typeof(API.Features.Player), nameof(API.Features.Player.Get), new[] { typeof(ReferenceHub) })),
-
- // Player.Get(target.NetworkId)
- new(OpCodes.Ldarg_3),
- new(OpCodes.Callvirt, PropertyGetter(typeof(IDestructible), nameof(IDestructible.NetworkId))),
- new(OpCodes.Call, Method(typeof(API.Features.Player), nameof(API.Features.Player.Get), new[] { typeof(uint) })),
-
- // hit
- new(OpCodes.Ldarg_2),
-
- // true
- new(OpCodes.Ldc_I4_1),
-
- // PlacingBloodEventArgs ev = new(Player, Player, RaycastHit, bool)
- new(OpCodes.Newobj, GetDeclaredConstructors(typeof(PlacingBloodEventArgs))[0]),
- new(OpCodes.Dup),
- new(OpCodes.Dup),
- new(OpCodes.Stloc_S, ev.LocalIndex),
-
- // Handlers.Map.OnPlacingBlood(ev)
- new(OpCodes.Call, Method(typeof(Handlers.Map), nameof(Handlers.Map.OnPlacingBlood))),
-
- // if (!ev.isAllowed)
- // return;
- new(OpCodes.Callvirt, PropertyGetter(typeof(PlacingBloodEventArgs), nameof(PlacingBloodEventArgs.IsAllowed))),
- new(OpCodes.Brfalse_S, returnLabel),
-
- // hit.info = ev.Position
- new(OpCodes.Ldarga_S, 2),
- new(OpCodes.Ldloc_S, ev.LocalIndex),
- new(OpCodes.Callvirt, PropertyGetter(typeof(PlacingBloodEventArgs), nameof(PlacingBloodEventArgs.Position))),
- new(OpCodes.Callvirt, PropertySetter(typeof(RaycastHit), nameof(RaycastHit.point))),
- });
-
- newInstructions[newInstructions.Count - 1].labels.Add(returnLabel);
-
- for (int z = 0; z < newInstructions.Count; z++)
- yield return newInstructions[z];
-
- ListPool.Pool.Return(newInstructions);
- }
- }
-}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/Patches/Events/Map/PlacingBulletHole.cs b/EXILED/Exiled.Events/Patches/Events/Map/PlacingBulletHole.cs
index 9431ddb4d..16a1b96e8 100644
--- a/EXILED/Exiled.Events/Patches/Events/Map/PlacingBulletHole.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Map/PlacingBulletHole.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -8,19 +8,18 @@
namespace Exiled.Events.Patches.Events.Map
{
using System.Collections.Generic;
+ using System.Linq;
+ using System.Reflection;
using System.Reflection.Emit;
using API.Features.Pools;
-
+ using Decals;
using Exiled.Events.Attributes;
using Exiled.Events.EventArgs.Map;
-
using Handlers;
-
using HarmonyLib;
-
+ using InventorySystem.Items;
using InventorySystem.Items.Firearms.Modules;
-
using UnityEngine;
using static HarmonyLib.AccessTools;
@@ -28,11 +27,11 @@ namespace Exiled.Events.Patches.Events.Map
using Player = API.Features.Player;
///
- /// Patches .
+ /// Patches .
/// Adds the event.
///
[EventPatch(typeof(Map), nameof(Map.PlacingBulletHole))]
- [HarmonyPatch(typeof(StandardHitregBase), nameof(StandardHitregBase.PlaceBulletholeDecal))]
+ [HarmonyPatch(typeof(ImpactEffectsModule), nameof(ImpactEffectsModule.ServerSendImpactDecal))]
internal static class PlacingBulletHole
{
private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator)
@@ -48,15 +47,15 @@ private static IEnumerable Transpiler(IEnumerable x.Name == "Get").First()),
// hit
new(OpCodes.Ldarg_2),
- // PlacingBulletHole ev = new(Player, RaycastHit)
+ // PlacingBulletHole ev = new(Item, RaycastHit)
new(OpCodes.Newobj, GetDeclaredConstructors(typeof(PlacingBulletHoleEventArgs))[0]),
new(OpCodes.Dup),
new(OpCodes.Dup),
diff --git a/EXILED/Exiled.Events/Patches/Events/Map/PlacingPickupIntoPocketDimension.cs b/EXILED/Exiled.Events/Patches/Events/Map/PlacingPickupIntoPocketDimension.cs
index 26afed44b..d82c11879 100644
--- a/EXILED/Exiled.Events/Patches/Events/Map/PlacingPickupIntoPocketDimension.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Map/PlacingPickupIntoPocketDimension.cs
@@ -1,6 +1,6 @@
-// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Map/Scp244Spawning.cs b/EXILED/Exiled.Events/Patches/Events/Map/Scp244Spawning.cs
index 10b7b0eb4..449fd14c5 100644
--- a/EXILED/Exiled.Events/Patches/Events/Map/Scp244Spawning.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Map/Scp244Spawning.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Map/SpawningItem.cs b/EXILED/Exiled.Events/Patches/Events/Map/SpawningItem.cs
index e65ced6fb..029395082 100644
--- a/EXILED/Exiled.Events/Patches/Events/Map/SpawningItem.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Map/SpawningItem.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Map/SpawningTeamVehicle.cs b/EXILED/Exiled.Events/Patches/Events/Map/SpawningTeamVehicle.cs
index 63f0f8fe0..08926e5be 100644
--- a/EXILED/Exiled.Events/Patches/Events/Map/SpawningTeamVehicle.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Map/SpawningTeamVehicle.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -21,11 +21,11 @@ namespace Exiled.Events.Patches.Events.Map
using static HarmonyLib.AccessTools;
///
- /// Patches .
+ /// Patches .
/// Adds the event.
///
[EventPatch(typeof(Handlers.Map), nameof(Handlers.Map.SpawningTeamVehicle))]
- [HarmonyPatch(typeof(RespawnEffectsController), nameof(RespawnEffectsController.ExecuteAllEffects))]
+ [HarmonyPatch(typeof(WaveUpdateMessage), nameof(WaveUpdateMessage.ServerSendUpdate))]
internal static class SpawningTeamVehicle
{
private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator)
@@ -35,28 +35,30 @@ private static IEnumerable Transpiler(IEnumerable x.opcode == OpCodes.Newobj) + offset;
+
+ newInstructions.InsertRange(index, new[]
{
+ new(OpCodes.Stloc_S, msg.LocalIndex),
+
// if (type != RespawnEffectsController.EffectType.Selection)
// goto continueLabel;
- new(OpCodes.Ldarg_0),
- new(OpCodes.Ldc_I4_0),
- new(OpCodes.Ceq),
+ new(OpCodes.Ldloca_S, msg.LocalIndex),
+ new(OpCodes.Callvirt, PropertyGetter(typeof(WaveUpdateMessage), nameof(WaveUpdateMessage.IsTrigger))),
new(OpCodes.Brfalse_S, continueLabel),
- // team
- new(OpCodes.Ldarg_1),
+ // wave
+ new(OpCodes.Ldarg_0),
// true
new(OpCodes.Ldc_I4_1),
- // SpawningTeamVehicleEventArgs ev = new(SpawnableTeamType, bool);
+ // SpawningTeamVehicleEventArgs ev = new(SpawnableWaveBase, bool);
new(OpCodes.Newobj, GetDeclaredConstructors(typeof(SpawningTeamVehicleEventArgs))[0]),
new(OpCodes.Dup),
- new(OpCodes.Dup),
- new(OpCodes.Stloc_S, ev.LocalIndex),
// Handlers.Map.OnSpawningTeamVehicle(ev);
new(OpCodes.Call, Method(typeof(Handlers.Map), nameof(Handlers.Map.OnSpawningTeamVehicle))),
@@ -66,12 +68,7 @@ private static IEnumerable Transpiler(IEnumerable
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/ActivatingWarheadPanel.cs b/EXILED/Exiled.Events/Patches/Events/Player/ActivatingWarheadPanel.cs
index 4a3d790b1..f910b8cb9 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/ActivatingWarheadPanel.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/ActivatingWarheadPanel.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/ActivatingWorkstation.cs b/EXILED/Exiled.Events/Patches/Events/Player/ActivatingWorkstation.cs
index 28edd3803..4dec7db38 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/ActivatingWorkstation.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/ActivatingWorkstation.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/Aiming.cs b/EXILED/Exiled.Events/Patches/Events/Player/Aiming.cs
new file mode 100644
index 000000000..737ff4ead
--- /dev/null
+++ b/EXILED/Exiled.Events/Patches/Events/Player/Aiming.cs
@@ -0,0 +1,75 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.Patches.Events.Player
+{
+ using System.Collections.Generic;
+ using System.Reflection.Emit;
+
+ using Exiled.API.Extensions;
+ using Exiled.API.Features.Pools;
+
+ using Exiled.Events.Attributes;
+
+ using Exiled.Events.EventArgs.Player;
+
+ using Exiled.Events.Handlers;
+
+ using HarmonyLib;
+ using InventorySystem.Items.Firearms.Modules;
+
+ using static HarmonyLib.AccessTools;
+
+ ///
+ /// Patches
+ /// to add event.
+ ///
+ [EventPatch(typeof(Player), nameof(Player.AimingDownSight))]
+ [HarmonyPatch(typeof(LinearAdsModule), nameof(LinearAdsModule.ServerProcessCmd))]
+ internal class Aiming
+ {
+ private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator)
+ {
+ List newInstructions = ListPool.Pool.Get(instructions);
+
+ LocalBuilder ads = generator.DeclareLocal(typeof(bool));
+
+ int offset = 0;
+ int index = newInstructions.FindIndex(x => x.StoresField(Field(typeof(LinearAdsModule), nameof(LinearAdsModule._userInput)))) + offset;
+
+ newInstructions.InsertRange(
+ index,
+ new[]
+ {
+ // read bool value
+ new CodeInstruction(OpCodes.Stloc_S, ads.LocalIndex),
+
+ // this.Firearm;
+ new(OpCodes.Ldarg_0),
+ new(OpCodes.Callvirt, PropertyGetter(typeof(LinearAdsModule), nameof(LinearAdsModule.Firearm))),
+
+ // userInput
+ new(OpCodes.Ldloc_S, ads.LocalIndex),
+
+ // AimingDownSightEventArgs ev = new(firearm, userInput);
+ new(OpCodes.Newobj, GetDeclaredConstructors(typeof(AimingDownSightEventArgs))[0]),
+ new(OpCodes.Dup),
+
+ // Handlers.Player.OnAimingDownSight(ev);
+ new(OpCodes.Call, Method(typeof(Player), nameof(Player.OnAimingDownSight))),
+
+ // loads AdsIn
+ new(OpCodes.Callvirt, PropertyGetter(typeof(AimingDownSightEventArgs), nameof(AimingDownSightEventArgs.AdsIn))),
+ });
+
+ for (int z = 0; z < newInstructions.Count; z++)
+ yield return newInstructions[z];
+
+ ListPool.Pool.Return(newInstructions);
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/Banned.cs b/EXILED/Exiled.Events/Patches/Events/Player/Banned.cs
index d06cdcf2f..f8486d05f 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/Banned.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/Banned.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/Banning.cs b/EXILED/Exiled.Events/Patches/Events/Player/Banning.cs
index 9873b079b..271d22ffe 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/Banning.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/Banning.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/ChangedItem.cs b/EXILED/Exiled.Events/Patches/Events/Player/ChangedItem.cs
index 1fe58b876..465935ad7 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/ChangedItem.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/ChangedItem.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/ChangingDangerState.cs b/EXILED/Exiled.Events/Patches/Events/Player/ChangingDangerState.cs
index c8f28a763..11030dddd 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/ChangingDangerState.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/ChangingDangerState.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/ChangingDisruptorMode.cs b/EXILED/Exiled.Events/Patches/Events/Player/ChangingDisruptorMode.cs
new file mode 100644
index 000000000..37aa6376b
--- /dev/null
+++ b/EXILED/Exiled.Events/Patches/Events/Player/ChangingDisruptorMode.cs
@@ -0,0 +1,71 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.Patches.Events.Player
+{
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Reflection.Emit;
+
+ using Exiled.API.Features.Items;
+ using Exiled.API.Features.Pools;
+ using Exiled.Events.Attributes;
+ using Exiled.Events.EventArgs.Player;
+ using HarmonyLib;
+ using InventorySystem.Items;
+ using InventorySystem.Items.Firearms.Modules;
+ using Mirror;
+
+ using static HarmonyLib.AccessTools;
+
+ ///
+ /// Patches
+ /// to add event.
+ ///
+ [EventPatch(typeof(Handlers.Player), nameof(Handlers.Player.ChangingDisruptorMode))]
+ [HarmonyPatch(typeof(DisruptorModeSelector), nameof(DisruptorModeSelector.ServerProcessCmd))]
+ internal static class ChangingDisruptorMode
+ {
+ private static IEnumerable Transpiler(IEnumerable instructions)
+ {
+ List newInstructions = ListPool.Pool.Get(instructions);
+
+ int index = newInstructions.FindLastIndex(x => x.opcode == OpCodes.Ldarg_0);
+
+ newInstructions.InsertRange(index, new CodeInstruction[]
+ {
+ // Item.Get(this.Firearm);
+ new(OpCodes.Ldarg_0),
+ new(OpCodes.Callvirt, PropertyGetter(typeof(DisruptorModeSelector), nameof(DisruptorModeSelector.Firearm))),
+ new(OpCodes.Call, GetDeclaredMethods(typeof(Item)).Find(x => !x.IsGenericMethod && x.GetParameters().FirstOrDefault()?.ParameterType == typeof(ItemBase))),
+
+ // reader.ReadBool();
+ new(OpCodes.Ldarg_1),
+ new(OpCodes.Call, Method(typeof(NetworkReaderExtensions), nameof(NetworkReaderExtensions.ReadBool))),
+
+ // ChangerDisruptorModeEventArgs ev = new(Item.Get(this.Firearm), reader.ReadBool(), true);
+ new(OpCodes.Newobj, GetDeclaredConstructors(typeof(ChangingDisruptorModeEventArgs))[0]),
+
+ // Handlers.Player.OnChangingDisruptorMode(ev);
+ new(OpCodes.Call, Method(typeof(Handlers.Player), nameof(Handlers.Player.OnChangingDisruptorMode))),
+
+ // reader.Position--;
+ new(OpCodes.Ldarg_1),
+ new(OpCodes.Ldarg_1),
+ new(OpCodes.Ldfld, Field(typeof(NetworkReader), nameof(NetworkReader.Position))),
+ new(OpCodes.Ldc_I4_M1),
+ new(OpCodes.Add),
+ new(OpCodes.Stfld, Field(typeof(NetworkReader), nameof(NetworkReader.Position))),
+ });
+
+ for (int z = 0; z < newInstructions.Count; z++)
+ yield return newInstructions[z];
+
+ ListPool.Pool.Return(newInstructions);
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/ChangingGroup.cs b/EXILED/Exiled.Events/Patches/Events/Player/ChangingGroup.cs
index cf179dfc5..3e94bf497 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/ChangingGroup.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/ChangingGroup.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/ChangingItem.cs b/EXILED/Exiled.Events/Patches/Events/Player/ChangingItem.cs
index 323c7c1b1..fa964cad8 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/ChangingItem.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/ChangingItem.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -42,8 +42,8 @@ private static IEnumerable Transpiler(IEnumerable instruction.Calls(Method(typeof(EquipDequipModifierExtensions), nameof(EquipDequipModifierExtensions.CanEquip)))) + offset;
+ int index = newInstructions.FindIndex(
+ instruction => instruction.Calls(PropertyGetter(typeof(ItemBase), nameof(ItemBase.AllowEquip)))) + offset;
newInstructions.InsertRange(
index,
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/ChangingMicroHIDState.cs b/EXILED/Exiled.Events/Patches/Events/Player/ChangingMicroHIDState.cs
index e476e2da9..c45000b67 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/ChangingMicroHIDState.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/ChangingMicroHIDState.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -8,89 +8,72 @@
namespace Exiled.Events.Patches.Events.Player
{
using System.Collections.Generic;
+ using System.Linq;
using System.Reflection.Emit;
- using API.Features;
+ using API.Features.Items;
using API.Features.Pools;
using Exiled.Events.Attributes;
using Exiled.Events.EventArgs.Player;
-
using HarmonyLib;
-
using InventorySystem.Items.MicroHID;
+ using InventorySystem.Items.MicroHID.Modules;
using static HarmonyLib.AccessTools;
///
- /// Patches .
+ /// Patches .
/// Adds the event.
///
[EventPatch(typeof(Handlers.Player), nameof(Handlers.Player.ChangingMicroHIDState))]
- [HarmonyPatch(typeof(MicroHIDItem), nameof(MicroHIDItem.ExecuteServerside))]
+ [HarmonyPatch(typeof(CycleController), nameof(CycleController.Phase), MethodType.Setter)]
internal static class ChangingMicroHIDState
{
private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator)
{
List newInstructions = ListPool.Pool.Get(instructions);
- Label skipLabel = generator.DefineLabel();
- Label continueLabel = generator.DefineLabel();
+ Label returnLabel = generator.DefineLabel();
LocalBuilder ev = generator.DeclareLocal(typeof(ChangingMicroHIDStateEventArgs));
- List instructionsToAdd = new()
- {
- // Player.Get(this.Owner);
- new CodeInstruction(OpCodes.Ldarg_0),
- new CodeInstruction(OpCodes.Callvirt, PropertyGetter(typeof(MicroHIDItem), nameof(MicroHIDItem.Owner))),
- new CodeInstruction(OpCodes.Call, Method(typeof(Player), nameof(Player.Get), new[] { typeof(ReferenceHub) })),
-
- // this
- new CodeInstruction(OpCodes.Ldarg_0),
+ int offset = 1;
+ int index = newInstructions.FindIndex(x => x.opcode == OpCodes.Ret) + offset;
- // state
- new CodeInstruction(OpCodes.Ldloc_0),
+ newInstructions.InsertRange(index, new[]
+ {
+ // Item.Get(this.Serial);
+ new CodeInstruction(OpCodes.Ldarg_0).MoveLabelsFrom(newInstructions[index]),
+ new(OpCodes.Ldfld, Field(typeof(CycleController), nameof(CycleController.Serial))),
+ new(OpCodes.Call, GetDeclaredMethods(typeof(Item)).Find(x => !x.IsGenericMethod && x.IsStatic && x.GetParameters().FirstOrDefault()?.ParameterType == typeof(ushort))),
- // this.State
- new CodeInstruction(OpCodes.Ldarg_0),
- new CodeInstruction(OpCodes.Ldfld, Field(typeof(MicroHIDItem), nameof(MicroHIDItem.State))),
+ // value
+ new(OpCodes.Ldarg_1),
// true
- new CodeInstruction(OpCodes.Ldc_I4_1),
+ new(OpCodes.Ldc_I4_1),
- // ChangingMicroHIDStateEventArgs ev = new(Player, MicroHIDItem, HidState, HidState, bool)
- new CodeInstruction(OpCodes.Newobj, GetDeclaredConstructors(typeof(ChangingMicroHIDStateEventArgs))[0]),
- new CodeInstruction(OpCodes.Dup),
- new CodeInstruction(OpCodes.Dup),
- new CodeInstruction(OpCodes.Stloc_S, ev.LocalIndex),
+ // ChangerMicroHIDStateEventArgs ev = new(Item.Get(this.Serial), value, true);
+ new(OpCodes.Newobj, GetDeclaredConstructors(typeof(ChangingMicroHIDStateEventArgs))[0]),
+ new(OpCodes.Dup),
+ new(OpCodes.Dup),
+ new(OpCodes.Stloc_S, ev.LocalIndex),
// Handlers.Player.OnChangingMicroHIDState(ev);
- new CodeInstruction(OpCodes.Call, Method(typeof(Handlers.Player), nameof(Handlers.Player.OnChangingMicroHIDState))),
+ new(OpCodes.Call, Method(typeof(Handlers.Player), nameof(Handlers.Player.OnChangingMicroHIDState))),
// if (!ev.IsAllowed)
- // goto skipLabel;
- new CodeInstruction(OpCodes.Callvirt, PropertyGetter(typeof(ChangingMicroHIDStateEventArgs), nameof(ChangingMicroHIDStateEventArgs.IsAllowed))),
- new CodeInstruction(OpCodes.Brfalse_S, skipLabel),
-
- // this.State = ev.NewState
- new CodeInstruction(OpCodes.Ldarg_0),
- new CodeInstruction(OpCodes.Ldloc_S, ev.LocalIndex),
- new CodeInstruction(OpCodes.Callvirt, PropertyGetter(typeof(ChangingMicroHIDStateEventArgs), nameof(ChangingMicroHIDStateEventArgs.NewState))),
- new CodeInstruction(OpCodes.Stfld, Field(typeof(MicroHIDItem), nameof(MicroHIDItem.State))),
- new CodeInstruction(OpCodes.Br, continueLabel),
-
- // this.State = state;
- new CodeInstruction(OpCodes.Ldarg_0).WithLabels(skipLabel),
- new CodeInstruction(OpCodes.Ldloc_0),
- new CodeInstruction(OpCodes.Stfld, Field(typeof(MicroHIDItem), nameof(MicroHIDItem.State))),
+ // return;
+ new(OpCodes.Callvirt, PropertyGetter(typeof(ChangingMicroHIDStateEventArgs), nameof(ChangingMicroHIDStateEventArgs.IsAllowed))),
+ new(OpCodes.Brfalse_S, returnLabel),
- new CodeInstruction(OpCodes.Nop).WithLabels(continueLabel),
- };
-
- int offset = 1;
+ // value = ev.NewPhase;
+ new(OpCodes.Ldloc_S, ev.LocalIndex),
+ new(OpCodes.Callvirt, PropertyGetter(typeof(ChangingMicroHIDStateEventArgs), nameof(ChangingMicroHIDStateEventArgs.NewPhase))),
+ new(OpCodes.Starg_S, 1),
+ });
- foreach (CodeInstruction instruction in newInstructions.FindAll(i => i.StoresField(Field(typeof(MicroHIDItem), nameof(MicroHIDItem.State)))))
- newInstructions.InsertRange(newInstructions.IndexOf(instruction) + offset, instructionsToAdd);
+ newInstructions[newInstructions.Count - 1].labels.Add(returnLabel);
for (int z = 0; z < newInstructions.Count; z++)
yield return newInstructions[z];
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/ChangingMoveState.cs b/EXILED/Exiled.Events/Patches/Events/Player/ChangingMoveState.cs
index 61d05c0aa..5c9879f7c 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/ChangingMoveState.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/ChangingMoveState.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -58,10 +58,7 @@ private static IEnumerable Transpiler(IEnumerable
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/ChangingRadioPreset.cs b/EXILED/Exiled.Events/Patches/Events/Player/ChangingRadioPreset.cs
index 602a349a2..4c4b27c4a 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/ChangingRadioPreset.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/ChangingRadioPreset.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/ChangingRoleAndSpawned.cs b/EXILED/Exiled.Events/Patches/Events/Player/ChangingRoleAndSpawned.cs
index c7c8d4176..47f1ede44 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/ChangingRoleAndSpawned.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/ChangingRoleAndSpawned.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -14,19 +14,21 @@ namespace Exiled.Events.Patches.Events.Player
using API.Features;
using API.Features.Pools;
-
using API.Features.Roles;
using Exiled.Events.EventArgs.Player;
-
using HarmonyLib;
-
using InventorySystem;
+ using InventorySystem.Configs;
+ using InventorySystem.Items;
using InventorySystem.Items.Armor;
using InventorySystem.Items.Pickups;
+ using InventorySystem.Items.Usables.Scp1344;
+ using Mirror;
using PlayerRoles;
using static HarmonyLib.AccessTools;
+ using static UnityEngine.GraphicsBuffer;
using Player = Handlers.Player;
@@ -149,18 +151,8 @@ private static IEnumerable Transpiler(IEnumerable list = new();
+ List list = new List();
if (inventory.TryGetBodyArmor(out BodyArmor bodyArmor))
bodyArmor.DontRemoveExcessOnDrop = true;
- while (inventory.UserInventory.Items.Count > 0)
+ HashSet hashSet = HashSetPool.Pool.Get();
+ foreach (KeyValuePair item2 in inventory.UserInventory.Items)
{
- int startCount = inventory.UserInventory.Items.Count;
- ushort key = inventory.UserInventory.Items.ElementAt(0).Key;
- ItemPickupBase item = inventory.ServerDropItem(key);
-
- // If the list wasn't changed, we need to manually remove the item to avoid a softlock.
- if (startCount == inventory.UserInventory.Items.Count)
- inventory.UserInventory.Items.Remove(key);
+ if (item2.Value is Scp1344Item scp1344Item)
+ scp1344Item.Status = Scp1344Status.Idle;
else
- list.Add(item);
+ hashSet.Add(item2.Key);
}
+ foreach (ushort item in hashSet)
+ list.Add(inventory.ServerDropItem(item));
+
+ HashSetPool.Pool.Return(hashSet);
InventoryItemProvider.PreviousInventoryPickups[ev.Player.ReferenceHub] = list;
}
else
{
while (inventory.UserInventory.Items.Count > 0)
- {
- int startCount = inventory.UserInventory.Items.Count;
- ushort key = inventory.UserInventory.Items.ElementAt(0).Key;
- inventory.ServerRemoveItem(key, null);
-
- // If the list wasn't changed, we need to manually remove the item to avoid a softlock.
- if (startCount == inventory.UserInventory.Items.Count)
- inventory.UserInventory.Items.Remove(key);
- }
+ inventory.ServerRemoveItem(inventory.UserInventory.Items.ElementAt(0).Key, null);
inventory.UserInventory.ReserveAmmo.Clear();
inventory.SendAmmoNextFrame = true;
}
- foreach (ItemType item in ev.Items)
- inventory.ServerAddItem(item);
+ if (!StartingInventories.DefinedInventories.TryGetValue(ev.NewRole, out InventoryRoleInfo value))
+ return;
- foreach (KeyValuePair keyValuePair in ev.Ammo)
- inventory.ServerAddAmmo(keyValuePair.Key, keyValuePair.Value);
+ foreach (KeyValuePair item in value.Ammo)
+ inventory.ServerAddAmmo(item.Key, item.Value);
- foreach (KeyValuePair item in inventory.UserInventory.Items)
- InventoryItemProvider.OnItemProvided?.Invoke(ev.Player.ReferenceHub, item.Value);
+ for (int i = 0; i < value.Items.Length; i++)
+ {
+ ItemBase arg = inventory.ServerAddItem(value.Items[i], ItemAddReason.StartingItem, 0);
+ InventoryItemProvider.OnItemProvided?.Invoke(ev.Player.ReferenceHub, arg);
+ }
- InventoryItemProvider.SpawnPreviousInventoryPickups(ev.Player.ReferenceHub);
+ InventoryItemProvider.InventoriesToReplenish.Enqueue(ev.Player.ReferenceHub);
}
catch (Exception exception)
{
@@ -254,4 +240,4 @@ private static void ChangeInventory(ChangingRoleEventArgs ev)
}
}
}
-}
\ No newline at end of file
+}
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/ChangingSpectatedPlayerPatch.cs b/EXILED/Exiled.Events/Patches/Events/Player/ChangingSpectatedPlayerPatch.cs
index c7f14f955..52617181a 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/ChangingSpectatedPlayerPatch.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/ChangingSpectatedPlayerPatch.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/DamagingDoor.cs b/EXILED/Exiled.Events/Patches/Events/Player/DamagingDoor.cs
index 9fb8aa936..2f5135a56 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/DamagingDoor.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/DamagingDoor.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -24,7 +24,7 @@ namespace Exiled.Events.Patches.Events.Player
using static HarmonyLib.AccessTools;
///
- /// Patch the .
+ /// Patch the .
/// Adds the event.
///
[EventPatch(typeof(Player), nameof(Player.DamagingDoor))]
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/DamagingShootingTarget.cs b/EXILED/Exiled.Events/Patches/Events/Player/DamagingShootingTarget.cs
index 9b73611eb..582a3770a 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/DamagingShootingTarget.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/DamagingShootingTarget.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/DamagingWindow.cs b/EXILED/Exiled.Events/Patches/Events/Player/DamagingWindow.cs
index fe342e84c..097127383 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/DamagingWindow.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/DamagingWindow.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -25,9 +25,9 @@ namespace Exiled.Events.Patches.Events.Player
///
/// Patch the .
- /// Adds the event.
+ /// Adds the event.
///
- [EventPatch(typeof(Player), nameof(Player.PlayerDamageWindow))]
+ [EventPatch(typeof(Player), nameof(Player.DamagingWindow))]
[HarmonyPatch(typeof(BreakableWindow), nameof(BreakableWindow.Damage))]
internal static class DamagingWindow
{
@@ -62,7 +62,7 @@ private static IEnumerable Transpiler(IEnumerable
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/Destroying.cs b/EXILED/Exiled.Events/Patches/Events/Player/Destroying.cs
index ad1d84480..5b1b6ac58 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/Destroying.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/Destroying.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/DroppingAmmo.cs b/EXILED/Exiled.Events/Patches/Events/Player/DroppingAmmo.cs
index c67b70d03..5ec938435 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/DroppingAmmo.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/DroppingAmmo.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/DroppingItem.cs b/EXILED/Exiled.Events/Patches/Events/Player/DroppingItem.cs
index 26d8cb2cc..d10d6cb2d 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/DroppingItem.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/DroppingItem.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/DryFire.cs b/EXILED/Exiled.Events/Patches/Events/Player/DryFire.cs
new file mode 100644
index 000000000..0c58fe435
--- /dev/null
+++ b/EXILED/Exiled.Events/Patches/Events/Player/DryFire.cs
@@ -0,0 +1,139 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.Patches.Events.Player
+{
+#pragma warning disable SA1402
+#pragma warning disable SA1600
+#pragma warning disable SA1649
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Reflection;
+ using System.Reflection.Emit;
+
+ using Exiled.API.Extensions;
+ using Exiled.API.Features.Pools;
+
+ using Exiled.Events.Attributes;
+
+ using Exiled.Events.EventArgs.Player;
+
+ using Exiled.Events.Handlers;
+
+ using HarmonyLib;
+
+ using InventorySystem.Items.Firearms;
+ using InventorySystem.Items.Firearms.Modules;
+
+ using static HarmonyLib.AccessTools;
+
+ ///
+ /// Patches
+ /// to add event for automatic firearms.
+ ///
+ [EventPatch(typeof(Player), nameof(Player.DryfiringWeapon))]
+ [HarmonyPatch(typeof(AutomaticActionModule), nameof(AutomaticActionModule.UpdateServer))]
+ internal class DryFireAutomatic
+ {
+ internal static IEnumerable GetInstructions(CodeInstruction start, Label ret)
+ {
+ // this.Firearm
+ yield return new CodeInstruction(OpCodes.Ldarg_0).MoveLabelsFrom(start);
+ yield return new(OpCodes.Callvirt, PropertyGetter(typeof(FirearmSubcomponentBase), nameof(FirearmSubcomponentBase.Firearm)));
+
+ // DryfiringWeaponEventArgs ev = new(firearm);
+ yield return new(OpCodes.Newobj, GetDeclaredConstructors(typeof(DryfiringWeaponEventArgs))[0]);
+ yield return new(OpCodes.Dup);
+
+ // Handlers.Player.OnDryfiringWeapon(ev);
+ yield return new(OpCodes.Call, Method(typeof(Player), nameof(Player.OnDryfiringWeapon)));
+
+ // if (!ev.IsAllowed)
+ // return;
+ yield return new(OpCodes.Callvirt, PropertyGetter(typeof(DryfiringWeaponEventArgs), nameof(DryfiringWeaponEventArgs.IsAllowed)));
+ yield return new(OpCodes.Brfalse_S, ret);
+ }
+
+ private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator)
+ {
+ List newInstructions = ListPool.Pool.Get(instructions);
+
+ // for returning we will goto ServerSendResponse method, it is necessarily
+ int offset = -3;
+ Label ret = newInstructions[newInstructions.Count - 1 + offset].labels[0];
+
+ offset = -2;
+ int index = newInstructions.FindIndex(x => x.Calls(PropertyGetter(typeof(AutomaticActionModule), nameof(AutomaticActionModule.Cocked)))) + offset;
+
+ newInstructions.InsertRange(index, GetInstructions(newInstructions[index], ret));
+
+ for (int z = 0; z < newInstructions.Count; z++)
+ yield return newInstructions[z];
+
+ ListPool.Pool.Return(newInstructions);
+ }
+ }
+
+ ///
+ /// Patches
+ /// to add event for double shots.
+ ///
+ [EventPatch(typeof(Player), nameof(Player.DryfiringWeapon))]
+ [HarmonyPatch(typeof(DoubleActionModule), nameof(DoubleActionModule.FireDry))]
+ internal class DryFireDouble
+ {
+ private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator)
+ {
+ List newInstructions = ListPool.Pool.Get(instructions);
+
+ Label ret = generator.DefineLabel();
+
+ newInstructions.InsertRange(0, DryFireAutomatic.GetInstructions(newInstructions[0], ret));
+
+ newInstructions[newInstructions.Count - 1].labels.Add(ret);
+
+ for (int z = 0; z < newInstructions.Count; z++)
+ yield return newInstructions[z];
+
+ ListPool.Pool.Return(newInstructions);
+ }
+ }
+
+ ///
+ /// Patches
+ /// to add event for double shots.
+ ///
+ [EventPatch(typeof(Player), nameof(Player.DryfiringWeapon))]
+ [HarmonyPatch(typeof(PumpActionModule), nameof(PumpActionModule.ShootOneBarrel))]
+ internal class DryFirePump
+ {
+ private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator)
+ {
+ List newInstructions = ListPool.Pool.Get(instructions);
+
+ Label ret = generator.DefineLabel();
+
+ int offset = -7;
+ int index = newInstructions.FindIndex(i => i.opcode == OpCodes.Stloc_1) + offset;
+
+ // firstly, set `flag` to a false, and then if `IsAllowed == false` we could return without problems
+ newInstructions.InsertRange(index, new CodeInstruction[]
+ {
+ new CodeInstruction(OpCodes.Ldc_I4_0),
+ new(OpCodes.Stloc_1),
+ }.Concat(DryFireAutomatic.GetInstructions(newInstructions[0], ret)));
+
+ // place return label to a ldloc instruction, to return `flag` variables
+ newInstructions[newInstructions.Count - 2].labels.Add(ret);
+
+ for (int z = 0; z < newInstructions.Count; z++)
+ yield return newInstructions[z];
+
+ ListPool.Pool.Return(newInstructions);
+ }
+ }
+}
\ No newline at end of file
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/DyingAndDied.cs b/EXILED/Exiled.Events/Patches/Events/Player/DyingAndDied.cs
index ea1137775..9b4c29b3b 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/DyingAndDied.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/DyingAndDied.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/EarningAchievement.cs b/EXILED/Exiled.Events/Patches/Events/Player/EarningAchievement.cs
index a818a3986..8acd20cb6 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/EarningAchievement.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/EarningAchievement.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/Emotion.cs b/EXILED/Exiled.Events/Patches/Events/Player/Emotion.cs
new file mode 100644
index 000000000..a7d447569
--- /dev/null
+++ b/EXILED/Exiled.Events/Patches/Events/Player/Emotion.cs
@@ -0,0 +1,87 @@
+// -----------------------------------------------------------------------
+//
+// Copyright (c) ExMod Team. All rights reserved.
+// Licensed under the CC BY-SA 3.0 license.
+//
+// -----------------------------------------------------------------------
+
+namespace Exiled.Events.Patches.Events.Player
+{
+ using System.Collections.Generic;
+ using System.Reflection.Emit;
+
+ using Exiled.API.Features.Pools;
+ using Exiled.Events.Attributes;
+ using Exiled.Events.EventArgs.Player;
+ using HarmonyLib;
+ using PlayerRoles.FirstPersonControl.Thirdperson.Subcontrollers;
+
+ using static HarmonyLib.AccessTools;
+
+ ///
+ /// Patches .
+ /// Adds the event and
+ /// event.
+ ///
+ [EventPatch(typeof(Handlers.Player), nameof(Handlers.Player.ChangingEmotion))]
+ [EventPatch(typeof(Handlers.Player), nameof(Handlers.Player.ChangedEmotion))]
+ [HarmonyPatch(typeof(EmotionSync), nameof(EmotionSync.ServerSetEmotionPreset))]
+ internal static class Emotion
+ {
+ private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator)
+ {
+ List newInstructions = ListPool.Pool.Get(instructions);
+
+ Label ret = generator.DefineLabel();
+ LocalBuilder ev = generator.DeclareLocal(typeof(ChangingEmotionEventArgs));
+
+ int index = newInstructions.FindIndex(x => x.opcode == OpCodes.Ldsfld);
+
+ newInstructions.InsertRange(index, new CodeInstruction[]
+ {
+ // ChangingEmotionEventArgs ev = new(hub, preset, EmotionSync.GetEmotionPreset(hub), true);
+ new CodeInstruction(OpCodes.Ldarg_0).MoveLabelsFrom(newInstructions[index]),
+ new(OpCodes.Ldarg_1),
+ new(OpCodes.Ldarg_0),
+ new(OpCodes.Call, Method(typeof(EmotionSync), nameof(EmotionSync.GetEmotionPreset))),
+ new(OpCodes.Ldc_I4_1),
+ new(OpCodes.Newobj, GetDeclaredConstructors(typeof(ChangingEmotionEventArgs))[0]),
+ new(OpCodes.Dup),
+ new(OpCodes.Dup),
+ new(OpCodes.Stloc_S, ev),
+
+ // Handlers.Player.OnChangingEmotion(ev);
+ new(OpCodes.Call, Method(typeof(Handlers.Player), nameof(Handlers.Player.OnChangingEmotion))),
+
+ // if (!ev.IsAllowed)
+ // return;
+ new(OpCodes.Callvirt, PropertyGetter(typeof(ChangingEmotionEventArgs), nameof(ChangingEmotionEventArgs.IsAllowed))),
+ new(OpCodes.Brfalse, ret),
+
+ // preset = ev.EmotionPresetTypeNew
+ new(OpCodes.Ldloc_S, ev),
+ new(OpCodes.Callvirt, PropertyGetter(typeof(ChangingEmotionEventArgs), nameof(ChangingEmotionEventArgs.NewEmotionPresetType))),
+ new(OpCodes.Starg_S, 1),
+ });
+
+ newInstructions.InsertRange(newInstructions.Count - 1, new CodeInstruction[]
+ {
+ // ChangedEmotionEventArgs ev = new(hub, EmotionSync.GetEmotionPreset(hub));
+ new CodeInstruction(OpCodes.Ldarg_0),
+ new(OpCodes.Ldarg_0),
+ new(OpCodes.Call, Method(typeof(EmotionSync), nameof(EmotionSync.GetEmotionPreset))),
+ new(OpCodes.Newobj, GetDeclaredConstructors(typeof(ChangedEmotionEventArgs))[0]),
+
+ // Handlers.Player.OnChangedEmotion(ev);
+ new(OpCodes.Call, Method(typeof(Handlers.Player), nameof(Handlers.Player.OnChangedEmotion))),
+ });
+
+ newInstructions[newInstructions.Count - 1].labels.Add(ret);
+
+ for (int z = 0; z < newInstructions.Count; z++)
+ yield return newInstructions[z];
+
+ ListPool.Pool.Return(newInstructions);
+ }
+ }
+}
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/EnteringKillerCollision.cs b/EXILED/Exiled.Events/Patches/Events/Player/EnteringKillerCollision.cs
index 3f277f3ad..59259d210 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/EnteringKillerCollision.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/EnteringKillerCollision.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -19,11 +19,11 @@ namespace Exiled.Events.Patches.Events.Player
using static HarmonyLib.AccessTools;
///
- /// Patches .
+ /// Patches .
/// Adds the event.
///
[EventPatch(typeof(Handlers.Player), nameof(Handlers.Player.EnteringKillerCollision))]
- [HarmonyPatch(typeof(CheckpointKiller), nameof(CheckpointKiller.OnTriggerEnter))]
+ [HarmonyPatch(typeof(PitKiller), nameof(PitKiller.OnTriggerEnter))]
internal static class EnteringKillerCollision
{
private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator)
@@ -32,8 +32,7 @@ private static IEnumerable Transpiler(IEnumerable instruction.opcode == OpCodes.Newobj) + offset;
+ int index = newInstructions.FindLastIndex(instruction => instruction.opcode == OpCodes.Ldarg_0);
newInstructions.InsertRange(
index,
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/EnteringPocketDimension.cs b/EXILED/Exiled.Events/Patches/Events/Player/EnteringPocketDimension.cs
index 1dabf6e26..f0dbbef92 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/EnteringPocketDimension.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/EnteringPocketDimension.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/EnteringSinkholeEnvironmentalHazard.cs b/EXILED/Exiled.Events/Patches/Events/Player/EnteringSinkholeEnvironmentalHazard.cs
index 2bccead6f..c98d66174 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/EnteringSinkholeEnvironmentalHazard.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/EnteringSinkholeEnvironmentalHazard.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/EnteringTantrumEnvironmentalHazard.cs b/EXILED/Exiled.Events/Patches/Events/Player/EnteringTantrumEnvironmentalHazard.cs
index faea5e778..b1d8fa813 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/EnteringTantrumEnvironmentalHazard.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/EnteringTantrumEnvironmentalHazard.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
diff --git a/EXILED/Exiled.Events/Patches/Events/Player/Escaping.cs b/EXILED/Exiled.Events/Patches/Events/Player/EscapingAndEscaped.cs
similarity index 71%
rename from EXILED/Exiled.Events/Patches/Events/Player/Escaping.cs
rename to EXILED/Exiled.Events/Patches/Events/Player/EscapingAndEscaped.cs
index 048de1136..c078ac2dc 100644
--- a/EXILED/Exiled.Events/Patches/Events/Player/Escaping.cs
+++ b/EXILED/Exiled.Events/Patches/Events/Player/EscapingAndEscaped.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
-//
-// Copyright (c) Exiled Team. All rights reserved.
+//
+// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
//
// -----------------------------------------------------------------------
@@ -8,40 +8,38 @@
namespace Exiled.Events.Patches.Events.Player
{
#pragma warning disable SA1402 // File may only contain a single type
+#pragma warning disable IDE0060
- using System;
using System.Collections.Generic;
- using System.Linq;
- using System.Reflection;
using System.Reflection.Emit;
using API.Enums;
using API.Features;
using API.Features.Pools;
-
using EventArgs.Player;
+ using Exiled.API.Features.Roles;
using Exiled.Events.Attributes;
using HarmonyLib;
using PlayerRoles.FirstPersonControl;
- using Respawning;
using static HarmonyLib.AccessTools;
///
- /// Patches for .
+ /// Patches for and .
///
[EventPatch(typeof(Handlers.Player), nameof(Handlers.Player.Escaping))]
+ [EventPatch(typeof(Handlers.Player), nameof(Handlers.Player.Escaped))]
[HarmonyPatch(typeof(Escape), nameof(Escape.ServerHandlePlayer))]
- internal static class Escaping
+ internal static class EscapingAndEscaped
{
private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator)
{
List newInstructions = ListPool.Pool.Get(instructions);
- List