Skip to content

Commit 7340393

Browse files
committed
Merge branch 'dev' of https://github.com/ExMod-Team/EXILED into ExMod-dev
2 parents 27af636 + dc62365 commit 7340393

File tree

93 files changed

+3488
-377
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+3488
-377
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,4 +376,7 @@ _site/
376376
JSON/
377377

378378
# Mac DS_Store
379-
.DS_Store
379+
.DS_Store
380+
381+
# Code Rush
382+
/EXILED/.cr/*

EXILED/EXILED.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<PropertyGroup>
1717
<!-- This is the global version and is used for all projects that don't have a version -->
18-
<Version Condition="$(Version) == ''">9.6.1</Version>
18+
<Version Condition="$(Version) == ''">9.7.1</Version>
1919
<!-- Enables public beta warning via the PUBLIC_BETA constant -->
2020
<PublicBeta>false</PublicBeta>
2121

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// -----------------------------------------------------------------------
2+
// <copyright file="AspectRatioType.cs" company="ExMod Team">
3+
// Copyright (c) ExMod Team. All rights reserved.
4+
// Licensed under the CC BY-SA 3.0 license.
5+
// </copyright>
6+
// -----------------------------------------------------------------------
7+
8+
namespace Exiled.API.Enums
9+
{
10+
/// <summary>
11+
/// All available screen aspect ratio types.
12+
/// </summary>
13+
public enum AspectRatioType : byte
14+
{
15+
/// <summary>
16+
/// Unknown aspect ratio.
17+
/// </summary>
18+
Unknown,
19+
20+
/// <summary>
21+
/// 1:1 aspect ratio (square screen).
22+
/// </summary>
23+
Ratio1_1,
24+
25+
/// <summary>
26+
/// 3:2 aspect ratio.
27+
/// </summary>
28+
Ratio3_2,
29+
30+
/// <summary>
31+
/// 4:3 aspect ratio (standard definition TVs, older monitors).
32+
/// </summary>
33+
Ratio4_3,
34+
35+
/// <summary>
36+
/// 5:4 aspect ratio (some older computer monitors).
37+
/// </summary>
38+
Ratio5_4,
39+
40+
/// <summary>
41+
/// 16:9 aspect ratio (modern widescreen displays, HDTV).
42+
/// </summary>
43+
Ratio16_9,
44+
45+
/// <summary>
46+
/// 16:10 aspect ratio (common in productivity monitors and laptops).
47+
/// </summary>
48+
Ratio16_10,
49+
50+
/// <summary>
51+
/// 21:9 aspect ratio (ultrawide displays).
52+
/// </summary>
53+
Ratio21_9,
54+
55+
/// <summary>
56+
/// 32:9 aspect ratio (super ultrawide displays).
57+
/// </summary>
58+
Ratio32_9,
59+
}
60+
}

EXILED/Exiled.API/Enums/DamageType.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ namespace Exiled.API.Enums
1515
/// Identifiers for types of damage.
1616
/// </summary>
1717
/// <seealso cref="Player.Hurt(float, DamageType, string)"/>
18-
/// <seealso cref="Player.Hurt(Player, float, DamageType, Features.DamageHandlers.DamageHandlerBase.CassieAnnouncement)"/>
19-
/// <seealso cref="Player.Hurt(Player, float, DamageType, Features.DamageHandlers.DamageHandlerBase.CassieAnnouncement, string)"/>
18+
/// <seealso cref="Player.Hurt(Player, float, DamageType, Features.DamageHandlers.DamageHandlerBase.CassieAnnouncement, string, bool)"/>
2019
/// <seealso cref="Player.Kill(DamageType, string)"/>
2120
public enum DamageType
2221
{
@@ -275,4 +274,4 @@ public enum DamageType
275274
/// </summary>
276275
Scp127,
277276
}
278-
}
277+
}

EXILED/Exiled.API/Enums/EffectType.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,5 +288,25 @@ public enum EffectType
288288
/// <see cref="CustomPlayerEffects.Scp1344Detected"/>.
289289
/// </summary>
290290
Scp1344Detected,
291+
292+
/// <summary>
293+
/// <see cref="CustomPlayerEffects.Scp1576"/>.
294+
/// </summary>
295+
Scp1576,
296+
297+
/// <summary>
298+
/// <see cref="CustomPlayerEffects.Lightweight"/>.
299+
/// </summary>
300+
Lightweight,
301+
302+
/// <summary>
303+
/// <see cref="CustomPlayerEffects.HeavyFooted"/>.
304+
/// </summary>
305+
HeavyFooted,
306+
307+
/// <summary>
308+
/// <see cref="CustomPlayerEffects.Fade"/>.
309+
/// </summary>
310+
Fade,
291311
}
292312
}

EXILED/Exiled.API/Enums/PrefabType.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,5 +372,14 @@ public enum PrefabType
372372

373373
[Prefab(162530276, "TextToy")]
374374
TextToy,
375+
376+
[Prefab(4046276968, "Spawnable Unsecured Pryable GateDoor")]
377+
SpawnableUnsecuredPryableGateDoor,
378+
379+
[Prefab(2332883846, "CullableParentToy")]
380+
CullableParentToy,
381+
382+
[Prefab(3938583646, "WaypointToy")]
383+
WaypointToy,
375384
}
376385
}

EXILED/Exiled.API/Enums/SpawnReason.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ public enum SpawnReason : byte // TOTO: Remove this file and use Basegame
5757
/// </summary>
5858
Destroyed,
5959

60+
/// <summary>
61+
/// The player was dead and is respawning in a mini-wave.
62+
/// </summary>
63+
RespawnMiniwave,
64+
6065
/// <summary>
6166
/// The user has been spawn by the usage of an Item.
6267
/// </summary>

EXILED/Exiled.API/Extensions/DamageTypeExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ public static class DamageTypeExtensions
124124
/// Check if a <see cref="DamageType">damage type</see> is caused by a weapon.
125125
/// </summary>
126126
/// <param name="type">The damage type to be checked.</param>
127-
/// <param name="checkMicro">Indicates whether the MicroHid damage type should be taken into account.</param>
127+
/// <param name="checkNonFirearm">Indicates whether the MicroHid and Jailbird damage type should be taken into account.</param>
128128
/// <returns>Returns whether the <see cref="DamageType"/> is caused by weapon.</returns>
129-
public static bool IsWeapon(this DamageType type, bool checkMicro = true) => type switch
129+
public static bool IsWeapon(this DamageType type, bool checkNonFirearm = true) => type switch
130130
{
131131
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,
132-
DamageType.MicroHid when checkMicro => true,
132+
DamageType.MicroHid or DamageType.Jailbird when checkNonFirearm => true,
133133
_ => false,
134134
};
135135

EXILED/Exiled.API/Extensions/EffectTypeExtension.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ public static class EffectTypeExtension
7676
{ EffectType.PitDeath, typeof(PitDeath) },
7777
{ EffectType.Blurred, typeof(Blurred) },
7878
{ EffectType.Scp1344Detected, typeof(Scp1344Detected) },
79+
{ EffectType.Scp1576, typeof(Scp1576) },
80+
{ EffectType.Lightweight, typeof(Lightweight) },
81+
{ EffectType.HeavyFooted, typeof(HeavyFooted) },
82+
{ EffectType.Fade, typeof(Fade) },
7983
#pragma warning disable CS0618
8084
{ EffectType.Marshmallow, typeof(MarshmallowEffect) },
8185
{ EffectType.BecomingFlamingo, typeof(BecomingFlamingo) },
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// -----------------------------------------------------------------------
2+
// <copyright file="FloatExtensions.cs" company="ExMod Team">
3+
// Copyright (c) ExMod Team. All rights reserved.
4+
// Licensed under the CC BY-SA 3.0 license.
5+
// </copyright>
6+
// -----------------------------------------------------------------------
7+
8+
namespace Exiled.API.Extensions
9+
{
10+
using System;
11+
using System.Collections.Generic;
12+
13+
using Exiled.API.Enums;
14+
15+
/// <summary>
16+
/// A set of extensions for <see cref="float"/>.
17+
/// </summary>
18+
public static class FloatExtensions
19+
{
20+
private static readonly Dictionary<AspectRatioType, float> AspectRatioReferences = new()
21+
{
22+
{ AspectRatioType.Unknown, 0f },
23+
{ AspectRatioType.Ratio1_1, 1f },
24+
{ AspectRatioType.Ratio3_2, 3f / 2f },
25+
{ AspectRatioType.Ratio4_3, 4f / 3f },
26+
{ AspectRatioType.Ratio5_4, 5f / 4f },
27+
{ AspectRatioType.Ratio16_9, 16f / 9f },
28+
{ AspectRatioType.Ratio16_10, 16f / 10f },
29+
{ AspectRatioType.Ratio21_9, 21f / 9f },
30+
{ AspectRatioType.Ratio32_9, 32f / 9f },
31+
};
32+
33+
/// <summary>
34+
/// Gets the closest <see cref="AspectRatioType"/> for a given aspect ratio value.
35+
/// </summary>
36+
/// <param name="ratio">The aspect ratio value to compare.</param>
37+
/// <returns>The closest matching <see cref="AspectRatioType"/>.</returns>
38+
public static AspectRatioType GetAspectRatioLabel(this float ratio)
39+
{
40+
float closestDiff = float.MaxValue;
41+
AspectRatioType closestRatio = AspectRatioType.Unknown;
42+
43+
foreach (KeyValuePair<AspectRatioType, float> kvp in AspectRatioReferences)
44+
{
45+
float diff = Math.Abs(ratio - kvp.Value);
46+
if (diff < closestDiff)
47+
{
48+
closestDiff = diff;
49+
closestRatio = kvp.Key;
50+
}
51+
}
52+
53+
return closestRatio;
54+
}
55+
}
56+
}

0 commit comments

Comments
 (0)