Skip to content

Commit d96a609

Browse files
Merge branch 'upstream/solutions-rebirth' of https://github.com/wonderfulnewworld/luminous-skylight-station into trieste/super-chem-master-2.0
2 parents e9456ef + 53d1124 commit d96a609

16 files changed

Lines changed: 209 additions & 91 deletions

File tree

Content.IntegrationTests/Tests/Utility/EntityWhitelistTest.cs

Lines changed: 93 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,48 +13,75 @@ public sealed class EntityWhitelistTest : GameTest
1313
private const string InvalidComponent = "Sprite";
1414
private const string ValidComponent = "Physics";
1515

16-
[TestPrototypes]
17-
private const string Prototypes = $@"
18-
- type: Tag
19-
id: WhitelistTestValidTag
20-
- type: Tag
21-
id: WhitelistTestInvalidTag
22-
23-
- type: entity
24-
id: WhitelistDummy
25-
components:
26-
- type: ItemSlots
27-
slots:
28-
slotName:
29-
whitelist:
30-
prototypes:
31-
- ValidPrototypeDummy
32-
components:
33-
- {ValidComponent}
34-
tags:
35-
- WhitelistTestValidTag
36-
37-
- type: entity
38-
id: InvalidComponentDummy
39-
components:
40-
- type: {InvalidComponent}
41-
- type: entity
42-
id: WhitelistTestInvalidTagDummy
43-
components:
44-
- type: Tag
45-
tags:
46-
- WhitelistTestInvalidTag
47-
48-
- type: entity
49-
id: ValidComponentDummy
50-
components:
51-
- type: {ValidComponent}
52-
- type: entity
53-
id: WhitelistTestValidTagDummy
54-
components:
55-
- type: Tag
56-
tags:
57-
- WhitelistTestValidTag";
16+
[TestPrototypes] // Starlight, I didn't want to have to modify this entire section, but editor config will yell at me if I don't.
17+
private const string Prototypes = $"""
18+
- type: Tag
19+
id: WhitelistTestValidTag
20+
- type: Tag
21+
id: WhitelistTestInvalidTag
22+
23+
- type: entity
24+
id: WhitelistDummy
25+
components:
26+
- type: ItemSlots
27+
slots:
28+
slotName:
29+
whitelist:
30+
prototypes:
31+
- ValidPrototypeDummy
32+
components:
33+
- {ValidComponent}
34+
tags:
35+
- WhitelistTestValidTag
36+
toolQuality:
37+
- Slicing
38+
39+
- type: entity
40+
id: InvalidComponentDummy
41+
components:
42+
- type: {InvalidComponent}
43+
44+
- type: entity
45+
id: WhitelistTestInvalidTagDummy
46+
components:
47+
- type: Tag
48+
tags:
49+
- WhitelistTestInvalidTag
50+
51+
- type: entity
52+
id: ValidComponentDummy
53+
components:
54+
- type: {ValidComponent}
55+
56+
- type: entity
57+
id: WhitelistTestValidTagDummy
58+
components:
59+
- type: Tag
60+
tags:
61+
- WhitelistTestValidTag
62+
63+
- type: entity
64+
id: WhitelistTestInvalidToolQualityDummy
65+
components:
66+
- type: Tool
67+
qualities:
68+
- Anchoring
69+
70+
- type: entity
71+
id: WhitelistTestValidToolQualityDummy
72+
components:
73+
- type: Tool
74+
qualities:
75+
- Slicing
76+
77+
- type: entity
78+
id: WhitelistTestAllToolQualitiesDummy
79+
components:
80+
- type: Tool
81+
qualities:
82+
- Cutting
83+
- Slicing
84+
""";
5885

5986
[Test]
6087
public async Task Test()
@@ -72,24 +99,44 @@ await server.WaitAssertion(() =>
7299
{
73100
var validComponent = sEntities.SpawnEntity("ValidComponentDummy", mapCoordinates);
74101
var WhitelistTestValidTag = sEntities.SpawnEntity("WhitelistTestValidTagDummy", mapCoordinates);
102+
var validToolQuality = sEntities.SpawnEntity("WhitelistTestValidToolQualityDummy", mapCoordinates); // Starlight
103+
var allToolQualities = sEntities.SpawnEntity("WhitelistTestAllToolQualitiesDummy", mapCoordinates); // Starlight
75104

76105
var invalidComponent = sEntities.SpawnEntity("InvalidComponentDummy", mapCoordinates);
77106
var WhitelistTestInvalidTag = sEntities.SpawnEntity("WhitelistTestInvalidTagDummy", mapCoordinates);
107+
var invalidToolQuality = sEntities.SpawnEntity("WhitelistTestInvalidToolQualityDummy", mapCoordinates); // Starlight
78108

79109
// Test instantiated on its own
80110
var whitelistInst = new EntityWhitelist
81111
{
82112
Components = new[] { $"{ValidComponent}" },
83-
Tags = new() { "WhitelistTestValidTag" }
113+
Tags = new() { "WhitelistTestValidTag" },
114+
ToolQualities = new() { "Slicing" } // Starlight
84115
};
85116

86117
Assert.Multiple(() =>
87118
{
88119
Assert.That(sys.IsValid(whitelistInst, validComponent), Is.True);
89120
Assert.That(sys.IsValid(whitelistInst, WhitelistTestValidTag), Is.True);
121+
Assert.That(sys.IsValid(whitelistInst, validToolQuality), Is.True); // Starlight
90122

91123
Assert.That(sys.IsValid(whitelistInst, invalidComponent), Is.False);
92124
Assert.That(sys.IsValid(whitelistInst, WhitelistTestInvalidTag), Is.False);
125+
#region Starlight
126+
Assert.That(sys.IsValid(whitelistInst, invalidToolQuality), Is.False);
127+
});
128+
129+
var requireAllToolQualities = new EntityWhitelist
130+
{
131+
RequireAll = true,
132+
ToolQualities = new() { "Cutting", "Slicing" }
133+
};
134+
135+
Assert.Multiple(() =>
136+
{
137+
Assert.That(sys.IsValid(requireAllToolQualities, allToolQualities), Is.True);
138+
Assert.That(sys.IsValid(requireAllToolQualities, validToolQuality), Is.False);
139+
#endregion
93140
});
94141

95142
// Test from serialized
@@ -101,15 +148,18 @@ await server.WaitAssertion(() =>
101148
{
102149
Assert.That(whitelistSer.Components, Is.Not.Null);
103150
Assert.That(whitelistSer.Tags, Is.Not.Null);
151+
Assert.That(whitelistSer.ToolQualities, Is.Not.Null); // Starlight
104152
});
105153

106154
Assert.Multiple(() =>
107155
{
108156
Assert.That(sys.IsValid(whitelistSer, validComponent), Is.True);
109157
Assert.That(sys.IsValid(whitelistSer, WhitelistTestValidTag), Is.True);
158+
Assert.That(sys.IsValid(whitelistSer, validToolQuality), Is.True); // Starlight
110159

111160
Assert.That(sys.IsValid(whitelistSer, invalidComponent), Is.False);
112161
Assert.That(sys.IsValid(whitelistSer, WhitelistTestInvalidTag), Is.False);
162+
Assert.That(sys.IsValid(whitelistSer, invalidToolQuality), Is.False); // Starlight
113163
});
114164
});
115165
}

Content.Shared/Whitelist/EntityWhitelist.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Content.Shared.Item;
22
using Content.Shared.Tag;
3+
using Content.Shared.Tools;
34
using Robust.Shared.Prototypes;
45
using Robust.Shared.Serialization;
56
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
@@ -26,6 +27,8 @@ namespace Content.Shared.Whitelist;
2627
/// sizes:
2728
/// - Tiny
2829
/// - Large
30+
/// toolQuality: // Starlight, we support ToolQuality now
31+
/// - Slicing
2932
/// </code>
3033
[DataDefinition]
3134
[Serializable, NetSerializable]
@@ -52,9 +55,17 @@ public sealed partial class EntityWhitelist
5255
[DataField]
5356
public List<ProtoId<TagPrototype>>? Tags;
5457

58+
#region starlight
5559
/// <summary>
56-
/// If false, an entity only requires one of these components or tags to pass the whitelist. If true, an
57-
/// entity requires to have ALL of these components and tags to pass.
60+
/// Tool qualities that are allowed in the whitelist.
61+
/// </summary>
62+
[DataField("toolQuality")]
63+
public HashSet<ProtoId<ToolQualityPrototype>>? ToolQualities;
64+
#endregion
65+
66+
/// <summary>
67+
/// If false, an entity only requires one of these components, tags, or tool qualities to pass the whitelist.
68+
/// If true, an entity requires to have ALL of these components, tags, and tool qualities to pass.
5869
/// The "Sizes" criteria will ignores this, since an item can only have one size.
5970
/// </summary>
6071
[DataField]

Content.Shared/Whitelist/EntityWhitelistSystem.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
using System.Diagnostics.CodeAnalysis;
22
using Content.Shared.Item;
33
using Content.Shared.Tag;
4+
using Content.Shared.Tools.Systems;
45
using Robust.Shared.Utility;
56

67
namespace Content.Shared.Whitelist;
78

89
public sealed partial class EntityWhitelistSystem : EntitySystem
910
{
1011
[Dependency] private TagSystem _tag = default!;
12+
[Dependency] private SharedToolSystem _tools = default!; // Starlight
1113

1214
private EntityQuery<ItemComponent> _itemQuery;
1315

@@ -69,6 +71,25 @@ public bool IsValid(EntityWhitelist list, EntityUid uid)
6971
return true;
7072
}
7173

74+
#region Starlight
75+
if (list.ToolQualities != null)
76+
{
77+
if (list.RequireAll)
78+
{
79+
if (!_tools.HasAllQualities(uid, list.ToolQualities))
80+
return false;
81+
}
82+
else
83+
{
84+
foreach (var quality in list.ToolQualities)
85+
{
86+
if (_tools.HasQuality(uid, quality))
87+
return true;
88+
}
89+
}
90+
}
91+
#endregion
92+
7293
if (list.Tags != null)
7394
{
7495
return list.RequireAll

Resources/Changelog/ChangelogStarlight.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,4 @@
11
Entries:
2-
- author: Forrestgod
3-
changes:
4-
- message: '[Serpentcrest] Added Waste/Distro Pipes to Arrival Docks.'
5-
type: Add
6-
id: 407644
7-
time: '2026-08-16T15:22:38.000000+00:00'
8-
url: https://github.com/ss14Starlight/space-station-14/pull/5668
9-
- author: Forrestgod
10-
changes:
11-
- message: '[Serpentcrest] Added Waste/Distro Pipes to Docking Arm.'
12-
type: Add
13-
id: 407645
14-
time: '2026-08-16T15:22:38.000000+00:00'
15-
url: https://github.com/ss14Starlight/space-station-14/pull/5668
16-
- author: Forrestgod
17-
changes:
18-
- message: '[Serpentcrest] Small waste system for Top East maintance Tunnels.'
19-
type: Add
20-
id: 407646
21-
time: '2026-08-16T15:22:38.000000+00:00'
22-
url: https://github.com/ss14Starlight/space-station-14/pull/5668
232
- author: Rhapsody (Pepta Vismahl)
243
changes:
254
- message: Removed Scientist playtime requirement from S.E.L.F Agent.
@@ -2799,4 +2778,25 @@ Entries:
27992778
id: 408043
28002779
time: '2026-09-02T02:14:14.000000+00:00'
28012780
url: https://github.com/ss14Starlight/space-station-14/pull/5931
2781+
- author: Conflee
2782+
changes:
2783+
- message: Added a Guidebook entry for Stir Stir adding more information on how to play as Stir Stir, interact with him as Security, and basic information to help RP as/with him. Their crime is vague on purpose, so RPers can decide in round. He can be paroled for good behavior, try to involve Lawyers and Magi, and he is NOT an Antag (unless he rolls an antag role).
2784+
type: Add
2785+
id: 408044
2786+
time: '2026-09-02T05:00:03.000000+00:00'
2787+
url: https://github.com/ss14Starlight/space-station-14/pull/5778
2788+
- author: Conflee
2789+
changes:
2790+
- message: Changed Stir Stir's playtime requirement from 15 minutes of Security Department to 2 hours of Security Officer. Maybe people will hesitate to be a shitter as Stir Stir if they've been on the receiving end as a Secoff before.
2791+
type: Tweak
2792+
id: 408045
2793+
time: '2026-09-02T05:00:03.000000+00:00'
2794+
url: https://github.com/ss14Starlight/space-station-14/pull/5778
2795+
- author: Conflee
2796+
changes:
2797+
- message: Added Starlight jobs to the Jobs and Security pages in the Guidebook.
2798+
type: Tweak
2799+
id: 408046
2800+
time: '2026-09-02T05:00:03.000000+00:00'
2801+
url: https://github.com/ss14Starlight/space-station-14/pull/5778
28022802
Order: -1

Resources/Locale/en-US/_Starlight/ghost/roles/ghost-role-component.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ ghost-role-information-kiki-name = Kiki
129129
ghost-role-information-kiki-description = An honorable member of the kobold society in charge of botany and helping the botanists in any way she can.
130130
131131
ghost-role-information-stirstir-name = Stir Stir
132-
ghost-role-information-stirstir-description = A disreputable monkey who should not be trusted. A real cell stuffer.
132+
ghost-role-information-stirstir-description = A disreputable monkey who should not be trusted. A real cell stuffer. Check the Guidebook for more information.
133133
134134
ghost-role-information-syndicate-mothroach-reinforcement-name = Syndicate Mobroach
135135
ghost-role-information-syndicate-mothroach-reinforcement-description = Someone needs reinforcements. You, a trained mobroach, will help them.

Resources/Locale/en-US/_Starlight/guidebook/guides.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ guide-entry-sl-security-sop-hostage-situations = Hostage Situations
9393
guide-entry-sl-security-sop-criminal-status = Criminal Status
9494
9595
guide-entry-rules-supernatural-entities = Supernatural Entities
96+
guide-entry-stirstir = Stir Stir
9697
9798
guide-entry-sl-legal-sop-intro = Legal
9899

Resources/Prototypes/Guidebook/security.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Forensics
77
- Defusal
88
- CriminalRecords
9+
- StirStir #SL Edit
910

1011
- type: guideEntry
1112
id: Forensics

Resources/Prototypes/_Starlight/Body/Prototypes/rodentia.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
blacklist:
1212
components:
1313
- MindContainer
14+
toolQuality:
15+
- Slicing
1416
- type: ContainerContainer
1517
containers:
1618
storagebase: !type:Container

Resources/Prototypes/_Starlight/CosmicCult/glyphs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@
107107
- SwordCosmicCult
108108
- SpearCosmicCult
109109
whitelist:
110-
components:
111-
- Tool
110+
toolQuality:
111+
- Slicing
112112
- type: CosmicGlyph
113113
requiredCultists: 2
114114
activationDamage:

Resources/Prototypes/_Starlight/Entities/Mobs/NPCs/pets.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@
124124
attributes:
125125
proper: true
126126
gender: male
127+
- type: GuideHelp
128+
guides:
129+
- StirStir
127130

128131
## ADMIN MICE
129132

0 commit comments

Comments
 (0)