Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion EXILED/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ ij_wrap_on_typing = false
csharp_style_var_for_built_in_types = false:error
csharp_style_var_when_type_is_apparent = false:error
csharp_style_var_elsewhere = false:error
dotnet_diagnostic.IDE0305.severity = none

# ReSharper properties
resharper_csharp_max_line_length = 400
Expand Down
8 changes: 4 additions & 4 deletions EXILED/EXILED.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@

<PropertyGroup Condition="$(BuildProperties) == '' OR $(BuildProperties) == 'true'">
<TargetFramework>net48</TargetFramework>
<LangVersion>13.0</LangVersion>
<LangVersion>9.0</LangVersion>
<PlatformTarget>x64</PlatformTarget>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>$(MSBuildThisFileDirectory)\bin\$(Configuration)\</OutputPath>
</PropertyGroup>

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

Expand All @@ -25,8 +25,8 @@

<Copyright>Copyright © $(Authors) 2020 - $([System.DateTime]::Now.ToString("yyyy"))</Copyright>
<RepositoryType>Git</RepositoryType>
<RepositoryUrl>https://github.com/Exmod-Team/EXILED</RepositoryUrl>
<PackageProjectUrl>https://github.com/Exmod-Team/EXILED</PackageProjectUrl>
<RepositoryUrl>https://github.com/ExSLMod-Team/EXILED</RepositoryUrl>
<PackageProjectUrl>https://github.com/ExSLMod-Team/EXILED</PackageProjectUrl>
<PackageLicenseExpression>CC-BY-SA-3.0</PackageLicenseExpression>

<DefineConstants Condition="$(PublicBeta) == 'true'">$(DefineConstants);PUBLIC_BETA</DefineConstants>
Expand Down
17 changes: 7 additions & 10 deletions EXILED/EXILED.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exiled.CreditTags", "Exiled
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exiled.CustomRoles", "Exiled.CustomRoles\Exiled.CustomRoles.csproj", "{417C3309-8B93-4218-A1D1-D4BB7B09BE0F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "docs", "docs\docs.csproj", "{BE130A80-6819-44C6-AA1B-BF068DEA67FF}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exiled.Starter", "Exiled.Starter\Exiled.Starter.csproj", "{290794B1-EABF-4416-A36E-57F341B68372}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -45,7 +45,6 @@ Global
{10A8BFEC-B9E2-4119-BB21-2CF1EA820D19}.Installer|Any CPU.ActiveCfg = Installer|Any CPU
{10A8BFEC-B9E2-4119-BB21-2CF1EA820D19}.Installer|Any CPU.Build.0 = Installer|Any CPU
{10A8BFEC-B9E2-4119-BB21-2CF1EA820D19}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10A8BFEC-B9E2-4119-BB21-2CF1EA820D19}.Release|Any CPU.Build.0 = Release|Any CPU
{4FFB9CEB-2956-4F62-88B3-6416DB8A8ED7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4FFB9CEB-2956-4F62-88B3-6416DB8A8ED7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4FFB9CEB-2956-4F62-88B3-6416DB8A8ED7}.Installer|Any CPU.ActiveCfg = Installer|Any CPU
Expand All @@ -60,7 +59,6 @@ Global
{4F183633-0A36-408C-A42E-6FBA48751054}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4F183633-0A36-408C-A42E-6FBA48751054}.Installer|Any CPU.ActiveCfg = Installer|Any CPU
{4F183633-0A36-408C-A42E-6FBA48751054}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4F183633-0A36-408C-A42E-6FBA48751054}.Release|Any CPU.Build.0 = Release|Any CPU
{B7FBA3C1-6182-4E96-A33B-053EDDCC4F65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7FBA3C1-6182-4E96-A33B-053EDDCC4F65}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7FBA3C1-6182-4E96-A33B-053EDDCC4F65}.Installer|Any CPU.ActiveCfg = Installer|Any CPU
Expand All @@ -70,18 +68,17 @@ Global
{9FEBCAEA-EB51-46D0-BC04-F74789A40079}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9FEBCAEA-EB51-46D0-BC04-F74789A40079}.Installer|Any CPU.ActiveCfg = Installer|Any CPU
{9FEBCAEA-EB51-46D0-BC04-F74789A40079}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9FEBCAEA-EB51-46D0-BC04-F74789A40079}.Release|Any CPU.Build.0 = Release|Any CPU
{417C3309-8B93-4218-A1D1-D4BB7B09BE0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{417C3309-8B93-4218-A1D1-D4BB7B09BE0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{417C3309-8B93-4218-A1D1-D4BB7B09BE0F}.Installer|Any CPU.ActiveCfg = Installer|Any CPU
{417C3309-8B93-4218-A1D1-D4BB7B09BE0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{417C3309-8B93-4218-A1D1-D4BB7B09BE0F}.Release|Any CPU.Build.0 = Release|Any CPU
{BE130A80-6819-44C6-AA1B-BF068DEA67FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BE130A80-6819-44C6-AA1B-BF068DEA67FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE130A80-6819-44C6-AA1B-BF068DEA67FF}.Installer|Any CPU.ActiveCfg = Installer|Any CPU
{BE130A80-6819-44C6-AA1B-BF068DEA67FF}.Installer|Any CPU.Build.0 = Installer|Any CPU
{BE130A80-6819-44C6-AA1B-BF068DEA67FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BE130A80-6819-44C6-AA1B-BF068DEA67FF}.Release|Any CPU.Build.0 = Release|Any CPU
{290794B1-EABF-4416-A36E-57F341B68372}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{290794B1-EABF-4416-A36E-57F341B68372}.Debug|Any CPU.Build.0 = Debug|Any CPU
{290794B1-EABF-4416-A36E-57F341B68372}.Installer|Any CPU.ActiveCfg = Debug|Any CPU
{290794B1-EABF-4416-A36E-57F341B68372}.Installer|Any CPU.Build.0 = Debug|Any CPU
{290794B1-EABF-4416-A36E-57F341B68372}.Release|Any CPU.ActiveCfg = Release|Any CPU
{290794B1-EABF-4416-A36E-57F341B68372}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion EXILED/Exiled.API/Enums/AdminToyType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public enum AdminToyType
TextToy,

/// <summary>
/// Waypoint toy.
/// Waypoint Toy.
/// </summary>
WaypointToy,
}
Expand Down
50 changes: 50 additions & 0 deletions EXILED/Exiled.API/Enums/BoneType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// -----------------------------------------------------------------------
// <copyright file="BoneType.cs" company="ExMod Team">
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Enums
{
/// <summary>
/// Более подробная чем <see cref="HitboxType"/> точка попадания в игрока.
/// </summary>
public enum BoneType
{
/// <summary>
/// Попадание в голову.
/// </summary>
Head = 0,

/// <summary>
/// Попадание в тело.
/// </summary>
Body = 1,

/// <summary>
/// Попадание в левую руку.
/// </summary>
LeftHand = 2,

/// <summary>
/// Попадание в правую руку.
/// </summary>
RightHand = 3,

/// <summary>
/// Попадание в левую ногу.
/// </summary>
LeftLeg = 4,

/// <summary>
/// Попадание в правую ногу.
/// </summary>
RightLeg = 5,

/// <summary>
/// Зону попадания не удалось определить.
/// </summary>
Unknown = 6,
}
}
10 changes: 5 additions & 5 deletions EXILED/Exiled.API/Enums/KeycardPermissions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ public enum KeycardPermissions
/// </summary>
Checkpoints = 1,

/// <summary>
/// Opens <see cref="DoorType.GateA">Gate A</see> and <see cref="DoorType.GateB">Gate B</see>.
/// </summary>
ExitGates = 2,

/// <summary>
/// Opens <see cref="DoorType.Intercom">the Intercom door</see>.
/// </summary>
Expand Down Expand Up @@ -80,5 +75,10 @@ public enum KeycardPermissions
/// <see cref="Checkpoints"/>.
/// </summary>
ScpOverride = 1024, // 0x0400

/// <summary>
/// Opens <see cref="DoorType.GateA">Gate A</see> and <see cref="DoorType.GateB">Gate B</see>.
/// </summary>
ExitGates = 2050, // 0x0800
}
}
21 changes: 7 additions & 14 deletions EXILED/Exiled.API/Enums/LockerType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ namespace Exiled.API.Enums
public enum LockerType
{
/// <summary>
/// The pedestal used by SCP items.
/// Unknown type of locker.
/// </summary>
[Obsolete("This value is not used.")]
Pedestal,
Unknown,

/// <summary>
/// Large weapon locker.
Expand All @@ -45,17 +44,6 @@ public enum LockerType
/// </summary>
Adrenaline,

/// <summary>
/// Unknown type of locker.
/// </summary>
Unknown,

/// <summary>
/// Unknown type of locker.
/// </summary>
[Obsolete("Use LockerType.Unknown", true)]
Unknow = Unknown,

/// <summary>
/// MircoHid pedestal.
/// </summary>
Expand Down Expand Up @@ -120,5 +108,10 @@ public enum LockerType
/// SCP-127 pedestal.
/// </summary>
Scp127Pedestal,

/// <summary>
/// SCP pedestal.
/// </summary>
ScpPedestal,
}
}
2 changes: 1 addition & 1 deletion EXILED/Exiled.API/Enums/RoomType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public enum RoomType
EzSmallrooms,

/// <summary>
/// Heavy Containment Zone's SCP-127 room.
/// Heavy Containment Zone's SCP-330 room.
/// </summary>
Hcz127,

Expand Down
32 changes: 7 additions & 25 deletions EXILED/Exiled.API/Enums/SpawnLocationType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ public enum SpawnLocationType
InsideLczCafe,

/// <summary>
/// Inside the Nuke armory.
/// Inside the Hid Lab.
/// </summary>
[Obsolete("This Location has been removed from the game.")]
InsideNukeArmory,
InsideHidLab,

/// <summary>
/// Inside the SCP-127 Lab.
/// </summary>
Inside127Lab,

/// <summary>
/// Inside the surface nuke room.
Expand Down Expand Up @@ -129,18 +133,6 @@ public enum SpawnLocationType
/// </summary>
InsideHidChamber,

/// <summary>
/// Inside the lower door that leads to the stairs in Micro-HID room.
/// </summary>
[Obsolete("This location has been removed from the game.")]
InsideHidLower,

/// <summary>
/// Inside the upper door that leads into the Micro-HID room just after the stairs.
/// </summary>
[Obsolete("This location has been removed from the game. Use InsideHidLab instead.")]
InsideHidUpper,

/// <summary>
/// Just inside the LCZ WC door.
/// </summary>
Expand Down Expand Up @@ -170,15 +162,5 @@ public enum SpawnLocationType
/// Inside SCP-079's Armory
/// </summary>
Inside079Armory,

/// <summary>
/// Inside SCP-127's Lab
/// </summary>
Inside127Lab,

/// <summary>
/// Inside the upper door that leads into the Micro-HID Lab room.
/// </summary>
InsideHidLab,
}
}
22 changes: 15 additions & 7 deletions EXILED/Exiled.API/Exiled.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,42 @@
</ItemGroup>

<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>$(EXILED_REFERENCES)\Assembly-CSharp-Publicized.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp" HintPath="$(EXILED_REFERENCES)\Assembly-CSharp-Publicized.dll" Private="false" />
<Reference Include="Assembly-CSharp-firstpass" HintPath="$(EXILED_REFERENCES)\Assembly-CSharp-firstpass.dll" Private="false" />
<Reference Include="CommandSystem.Core" HintPath="$(EXILED_REFERENCES)\CommandSystem.Core.dll" Private="false" />
<Reference Include="Exiled.CustomRoles">
<HintPath>$(EXILED_REFERENCES)\Exiled.CustomRoles.dll</HintPath>
</Reference>
<Reference Include="FLXLib">
<HintPath>$(EXILED_REFERENCES)\FLXLib.dll</HintPath>
</Reference>
<Reference Include="LabApi" HintPath="$(EXILED_REFERENCES)\LabApi.dll" Private="false" />
<Reference Include="Pooling" HintPath="$(EXILED_REFERENCES)\Pooling.dll" Private="false" />
<Reference Include="Mirror" HintPath="$(EXILED_REFERENCES)\Mirror.dll" Private="false" />
<Reference Include="NorthwoodLib" HintPath="$(EXILED_REFERENCES)\NorthwoodLib.dll" Private="false" />
<Reference Include="Snake" HintPath="$(EXILED_REFERENCES)\Snake.dll" Private="false" />
<Reference Include="Unity.TextMeshPro" HintPath="$(EXILED_REFERENCES)\Unity.TextMeshPro.dll" Private="false" />
<Reference Include="UnityEngine" HintPath="$(EXILED_REFERENCES)\UnityEngine.dll" Private="false" />
<Reference Include="UnityEngine.AudioModule">
<HintPath>$(EXILED_REFERENCES)\UnityEngine.AudioModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule" HintPath="$(EXILED_REFERENCES)\UnityEngine.CoreModule.dll" Private="false" />
<Reference Include="UnityEngine.ParticleSystemModule" HintPath="$(EXILED_REFERENCES)\UnityEngine.ParticleSystemModule.dll" Private="false" />
<Reference Include="UnityEngine.PhysicsModule" HintPath="$(EXILED_REFERENCES)\UnityEngine.PhysicsModule.dll" Private="false" />
<Reference Include="UnityEngine.AudioModule" HintPath="$(EXILED_REFERENCES)\UnityEngine.AudioModule.dll" Private="false" />
<Reference Include="UnityEngine.UI" HintPath="$(EXILED_REFERENCES)\UnityEngine.UI.dll" Private="false" />
<Reference Include="YamlDotNet" HintPath="$(EXILED_REFERENCES)\YamlDotNet.dll" Private="false" />
<Reference Include="mscorlib" HintPath="$(EXILED_REFERENCES)\mscorlib.dll" Private="false" />
<Reference Include="System" HintPath="$(EXILED_REFERENCES)\System.dll" Private="false" />
</ItemGroup>

<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<PostBuildEvent>if not "$(EXILED_DEV_PLUGINAPI_REFERENCE)"=="" copy /y "$(OutputPath)$(AssemblyName).dll" "$(EXILED_DEV_PLUGINAPI_REFERENCE)\dependencies\" &amp;&amp; if not "$(EXILED_DEV_REFERENCES)"=="" copy /y "$(OutputPath)$(AssemblyName).dll" "$(EXILED_DEV_REFERENCES)\Plugins\dependencies\"</PostBuildEvent>
<PostBuildEvent>
if not "$(EXILED_DEV_REFERENCES)"=="" copy /y "$(OutputPath)$(AssemblyName).dll" "$(EXILED_DEV_REFERENCES)\Plugins\dependencies\"
if not "$(EXILED_REFERENCES)"=="" copy /y "$(OutputPath)$(AssemblyName).dll" "$(EXILED_REFERENCES)\"
if not "$(EXILED_REFERENCES)"=="" copy /y "$(OutputPath)$(AssemblyName).xml" "$(EXILED_REFERENCES)\"
</PostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' == 'Unix' ">
<PostBuildEvent>if [[ ! -z "$EXILED_DEV_REFERENCES" ]]; then cp "$(OutputPath)$(AssemblyName).dll" "$EXILED_DEV_REFERENCES/Plugins/dependencies/"; fi</PostBuildEvent>
<PostBuildEvent>if [[ ! -z "$EXILED_DEV_PLUGINAPI_REFERENCE" ]]; then cp "$(OutputPath)$(AssemblyName).dll" "$EXILED_DEV_PLUGINAPI_REFERENCE/dependencies/"; fi</PostBuildEvent>
</PropertyGroup>


Expand Down
58 changes: 58 additions & 0 deletions EXILED/Exiled.API/Extensions/BoneTypeExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// -----------------------------------------------------------------------
// <copyright file="BoneTypeExtensions.cs" company="ExMod Team">
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Extensions
{
using System;

using Exiled.API.Enums;
using Exiled.API.Features;
using UnityEngine;

/// <summary>
/// Содержит методы для определения точки попадания в игрока.
/// </summary>
public static class BoneTypeExtensions
{
/// <summary>
/// Определяет точку попадания в игрока по конкретному хитбоксу.
/// </summary>
/// <param name="target">Игрок, попадание в которого рассчитывется.</param>
/// <param name="hitboxIdentity">Хитбокс, попадание в которого.</param>
/// <returns>Точная зона попадания в игрока.</returns>
public static BoneType GetByMassCenter(this Player target, HitboxIdentity hitboxIdentity)
{
BoneType boneType;
Vector3 boneLocalMassCenter = target.Transform.InverseTransformPoint(hitboxIdentity.CenterOfMass);
switch (hitboxIdentity._dmgMultiplier)
{
case HitboxType.Headshot:
boneType = BoneType.Head;
break;
case HitboxType.Body:
if (IsArms(boneLocalMassCenter))
boneType = IsRight(boneLocalMassCenter) ? BoneType.RightHand : BoneType.LeftHand;
else
boneType = BoneType.Body;
break;
case HitboxType.Limb:
boneType = IsRight(boneLocalMassCenter) ? BoneType.RightLeg : BoneType.LeftLeg;
break;
default:
boneType = BoneType.Unknown;
break;
}

Log.Debug($"[{nameof(GetByMassCenter)}] [{hitboxIdentity._dmgMultiplier}] at {boneLocalMassCenter}: {boneType}");
return boneType;
}

private static bool IsArms(Vector3 point) => point.z <= -0.2 || Math.Abs(point.x) > 0.1;

private static bool IsRight(Vector3 point) => point.x > 0;
}
}
Loading
Loading