Skip to content

Commit d5e7777

Browse files
Merge branch 'dev' into uncuff
2 parents 967d20a + 1f2d209 commit d5e7777

32 files changed

+307
-692
lines changed

.github/labeler.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ Localization: # Add the 'Localization' label
3535
- changed-files:
3636
- any-glob-to-any-file: EXILED/Localization/** # Any modifications to Localization
3737

38-
GitHub_Actions: # Add the 'GitHub' label
38+
GitHub: # Add the 'GitHub' label
3939
- changed-files:
4040
- any-glob-to-any-file: .github/** # Any modifications to github related files
41-

.github/pull_request_template.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Description
2+
**Describe the changes**
3+
4+
5+
**What is the current behavior?** (You can also link to an open issue here)
6+
7+
8+
**What is the new behavior?** (if this is a feature change)
9+
10+
11+
**Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?)
12+
13+
14+
**Other information**:
15+
16+
<br />
17+
18+
## Types of changes
19+
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
20+
- [ ] Bug fix (non-breaking change which fixes an issue)
21+
- [ ] New feature (non-breaking change which adds functionality)
22+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
23+
- [ ] Documentations
24+
<br />
25+
26+
## Submission checklist
27+
<!--- Put an `x` in all the boxes that apply: -->
28+
- [ ] I have checked the project can be compiled
29+
- [ ] I have tested my changes and it worked as expected
30+
31+
### Patches (if there are any changes related to Harmony patches)
32+
- [ ] I have checked no IL patching errors in the console
33+
34+
### Other
35+
- [ ] Still requires more testing

.github/workflows/dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defaults:
1414
working-directory: ./EXILED
1515

1616
env:
17-
EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-Reference/Dev.zip
17+
EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Dev.zip
1818
EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References
1919
EXILED_DLL_ARCHIVER_URL: https://github.com/ExMod-Team/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe
2020

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
id-token: write
1313

1414
env:
15-
EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Dev.zip
15+
EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Master.zip
1616
EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References
1717

1818
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ defaults:
1313
working-directory: ./EXILED
1414

1515
env:
16-
EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Master.zip
16+
EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Master.zip
1717
EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References
1818

1919
jobs:

.github/workflows/labeler.yml renamed to .github/workflows/pull_request_opened.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,10 @@ jobs:
2020
repo-token: ${{ secrets.GITHUB_TOKEN }}
2121
configuration-path: .github/labeler.yml
2222
sync-labels: true
23+
assign-author:
24+
runs-on: ubuntu-latest
25+
permissions:
26+
pull-requests: write
27+
28+
steps:
29+
- uses: toshimaru/auto-author-assign@v2.1.1

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ defaults:
1111
working-directory: ./EXILED
1212

1313
env:
14-
EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Dev.zip
14+
EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Dev.zip
1515
EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References
16-
EXILED_DLL_ARCHIVER_URL: https://github.com/Exiled-Official/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe
16+
EXILED_DLL_ARCHIVER_URL: https://github.com/ExMod-Team/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe
1717

1818
jobs:
1919
build:

EXILED/Exiled.API/Extensions/MirrorExtensions.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ namespace Exiled.API.Extensions
2525
using PlayerRoles;
2626
using PlayerRoles.FirstPersonControl;
2727
using PlayerRoles.PlayableScps.Scp049.Zombies;
28+
using PlayerRoles.Voice;
2829
using RelativePositioning;
2930

3031
using Respawning;
@@ -181,6 +182,18 @@ public static void PlayGunSound(this Player player, Vector3 position, ItemType i
181182
player.Connection.Send(message);
182183
}
183184

185+
/// <summary>
186+
/// Sets <see cref="Features.Intercom.DisplayText"/> that only the <paramref name="target"/> player can see.
187+
/// </summary>
188+
/// <param name="target">Only this player can see Display Text.</param>
189+
/// <param name="text">Text displayed to the player.</param>
190+
public static void SetIntercomDisplayTextForTargetOnly(this Player target, string text) => target.SendFakeSyncVar(IntercomDisplay._singleton.netIdentity, typeof(IntercomDisplay), nameof(IntercomDisplay.Network_overrideText), text);
191+
192+
/// <summary>
193+
/// Resync <see cref="Features.Intercom.DisplayText"/>.
194+
/// </summary>
195+
public static void ResetIntercomDisplayText() => ResyncSyncVar(IntercomDisplay._singleton.netIdentity, typeof(IntercomDisplay), nameof(IntercomDisplay.Network_overrideText));
196+
184197
/// <summary>
185198
/// Sets <see cref="Room.Color"/> of a <paramref name="room"/> that only the <paramref name="target"/> player can see.
186199
/// </summary>

EXILED/Exiled.API/Features/Items/Jailbird.cs

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77

88
namespace Exiled.API.Features.Items
99
{
10+
using System;
11+
1012
using Exiled.API.Features.Pickups;
1113
using Exiled.API.Interfaces;
1214
using InventorySystem.Items.Autosync;
1315
using InventorySystem.Items.Jailbird;
1416
using Mirror;
17+
using UnityEngine;
1518

1619
using JailbirdPickup = Pickups.JailbirdPickup;
1720

@@ -114,12 +117,35 @@ public JailbirdWearState WearState
114117
get => Base._deterioration.WearState;
115118
set
116119
{
117-
if (JailbirdDeteriorationTracker.ReceivedStates.ContainsKey(Serial))
118-
JailbirdDeteriorationTracker.ReceivedStates[Serial] = value;
120+
TotalDamageDealt = GetDamage(value);
121+
TotalCharges = GetCharge(value);
119122
Base._deterioration.RecheckUsage();
120123
}
121124
}
122125

126+
/// <summary>
127+
/// Calculates the damage corresponding to a given <see cref="JailbirdWearState"/>.
128+
/// </summary>
129+
/// <param name="wearState">The wear state to calculate damage for.</param>
130+
/// <returns>The amount of damage associated with the specified wear state.</returns>
131+
public float GetDamage(JailbirdWearState wearState)
132+
{
133+
foreach (Keyframe keyframe in Base._deterioration._damageToWearState.keys)
134+
{
135+
if (Base._deterioration.FloatToState(keyframe.value) == wearState)
136+
return keyframe.time;
137+
}
138+
139+
throw new Exception("Wear state not found in damage to wear state mapping.");
140+
}
141+
142+
/// <summary>
143+
/// Gets the charge needed to reach a specific <see cref="JailbirdWearState"/>.
144+
/// </summary>
145+
/// <param name="wearState">The desired wear state to calculate the charge for.</param>
146+
/// <returns>The charge value required to achieve the specified wear state.</returns>
147+
public int GetCharge(JailbirdWearState wearState) => (int)wearState;
148+
123149
/// <summary>
124150
/// Breaks the Jailbird.
125151
/// </summary>

EXILED/Exiled.API/Features/Map.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ public static class Map
5757
/// </summary>
5858
internal static readonly List<PocketDimensionTeleport> TeleportsValue = new(8);
5959

60-
/// <summary>
61-
/// A list of <see cref="AdminToy"/>s on the map.
62-
/// </summary>
63-
internal static readonly List<AdminToy> ToysValue = new();
64-
6560
private static TantrumEnvironmentalHazard tantrumPrefab;
6661
private static Scp939AmnesticCloudInstance amnesticCloudPrefab;
6762

@@ -130,7 +125,7 @@ DecontaminationController.Singleton.NetworkDecontaminationOverride is Decontamin
130125
/// <summary>
131126
/// Gets all <see cref="AdminToy"/> objects.
132127
/// </summary>
133-
public static ReadOnlyCollection<AdminToy> Toys { get; } = ToysValue.AsReadOnly();
128+
public static ReadOnlyCollection<AdminToy> Toys => AdminToy.BaseToAdminToy.Values.ToList().AsReadOnly(); // TODO: Obsolete it and make people use AdminToy.List
134129

135130
/// <summary>
136131
/// Gets or sets the current seed of the map.

0 commit comments

Comments
 (0)