Skip to content

Commit 9614b26

Browse files
author
GeneralGaws
committed
ups fix
2 parents be83c75 + 45f50db commit 9614b26

File tree

15 files changed

+307
-278
lines changed

15 files changed

+307
-278
lines changed

Content.Server/DeltaV/Abilities/Psionics/PrecognitionPowerSystem.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public sealed class PrecognitionPowerSystem : EntitySystem
4545
public override void Initialize()
4646
{
4747
base.Initialize();
48+
CachePrecognitionResults();
4849

4950
SubscribeLocalEvent<PrecognitionPowerComponent, MapInitEvent>(OnMapInit);
5051
SubscribeLocalEvent<PrecognitionPowerComponent, ComponentShutdown>(OnShutdown);
@@ -148,7 +149,7 @@ private void OnDoAfter(EntityUid uid, PrecognitionPowerComponent component, Prec
148149
var msg = Loc.GetString(locId);
149150
_chat.ChatMessageToOne(ChatChannel.Server,
150151
msg,
151-
Loc.GetString("chat-manager-server-wrap-message", ("message", message)),
152+
Loc.GetString("chat-manager-server-wrap-message", ("message", msg)),
152153
uid,
153154
false,
154155
mindComponent.Session.Channel,
@@ -161,12 +162,12 @@ private void OnDoAfter(EntityUid uid, PrecognitionPowerComponent component, Prec
161162
/// Gets the precognition result message corosponding to the passed event id.
162163
/// </summary>
163164
/// <returns>message string corosponding to the event id passed</returns>
164-
private LocId GetResultMessage(EntProtoId eventId)
165+
private LocId? GetResultMessage(EntProtoId eventId)
165166
{
166167
if (!Results.TryGetValue(eventId, out var result))
167168
{
168169
Log.Error($"Prototype {eventId} does not have an associated precognitionResult!");
169-
return string.Empty;
170+
return null;
170171
}
171172

172173
return result.Message;

Content.Server/StationEvents/Components/VentCrittersRuleComponent.cs

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Content.Server.StationEvents.Events;
2+
using Content.Shared.EntityTable.EntitySelectors;
23
using Content.Shared.Storage;
34
using Robust.Shared.Map; // DeltaV
45

@@ -7,8 +8,15 @@ namespace Content.Server.StationEvents.Components;
78
[RegisterComponent, Access(typeof(VentCrittersRule))]
89
public sealed partial class VentCrittersRuleComponent : Component
910
{
10-
[DataField("entries")]
11-
public List<EntitySpawnEntry> Entries = new();
11+
// DeltaV: Replaced by Table
12+
//[DataField("entries")]
13+
//public List<EntitySpawnEntry> Entries = new();
14+
15+
/// <summary>
16+
/// DeltaV: Table of possible entities to spawn.
17+
/// </summary>
18+
[DataField(required: true)]
19+
public EntityTableSelector Table = default!;
1220

1321
/// <summary>
1422
/// At least one special entry is guaranteed to spawn

Content.Server/StationEvents/Events/VentCrittersRule.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Content.Server.GameTicking.Rules.Components;
33
using Content.Server.Pinpointer;
44
using Content.Server.StationEvents.Components;
5+
using Content.Shared.EntityTable;
56
using Content.Shared.GameTicking.Components;
67
using Content.Shared.Station.Components;
78
using Content.Shared.Storage;
@@ -26,6 +27,7 @@ public sealed class VentCrittersRule : StationEventSystem<VentCrittersRuleCompon
2627
*/
2728

2829
[Dependency] private readonly AntagSelectionSystem _antag = default!;
30+
[Dependency] private readonly EntityTableSystem _entityTable = default!;
2931
[Dependency] private readonly ISharedPlayerManager _player = default!;
3032
[Dependency] private readonly NavMapSystem _navMap = default!;
3133
[Dependency] private readonly SharedTransformSystem _transform = default!;
@@ -62,9 +64,10 @@ protected override void Ended(EntityUid uid, VentCrittersRuleComponent comp, Gam
6264
var min = comp.Min * players / comp.PlayerRatio;
6365
var max = comp.Max * players / comp.PlayerRatio;
6466
var count = Math.Max(RobustRandom.Next(min, max), 1);
67+
Log.Info($"Spawning {count} critters for {ToPrettyString(uid):rule}");
6568
for (int i = 0; i < count; i++)
6669
{
67-
foreach (var spawn in EntitySpawnCollection.GetSpawns(comp.Entries, RobustRandom))
70+
foreach (var spawn in _entityTable.GetSpawns(comp.Table))
6871
{
6972
Spawn(spawn, coords);
7073
}

Resources/Changelog/DeltaVChangelog.yml

+22-21
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,4 @@
11
Entries:
2-
- author: pissdemon
3-
changes:
4-
- message: Gumballs and lollipops now come in 32 awesome flavors! Try them all!
5-
type: Add
6-
id: 314
7-
time: '2024-04-14T16:49:00.0000000+00:00'
8-
url: https://github.com/DeltaV-Station/Delta-v/pull/1074
9-
- author: Velcroboy
10-
changes:
11-
- message: Fixed mail access
12-
type: Fix
13-
id: 315
14-
time: '2024-04-15T19:38:04.0000000+00:00'
15-
url: https://github.com/DeltaV-Station/Delta-v/pull/1095
16-
- author: adeinitas
17-
changes:
18-
- message: Mr. Butlertron can now be vinced (and also unanchored.)
19-
type: Tweak
20-
id: 316
21-
time: '2024-04-16T15:45:18.0000000+00:00'
22-
url: https://github.com/DeltaV-Station/Delta-v/pull/1100
232
- author: deltanedas
243
changes:
254
- message: The SecDrobe now has Prison Headsets. Prisoners have rights too!
@@ -3833,3 +3812,25 @@
38333812
id: 813
38343813
time: '2024-12-23T10:45:34.0000000+00:00'
38353814
url: https://github.com/DeltaV-Station/Delta-v/pull/2495
3815+
- author: ewokswagger
3816+
changes:
3817+
- message: Fixed Precognition results not appearing when power is used.
3818+
type: Fix
3819+
id: 814
3820+
time: '2024-12-23T21:58:04.0000000+00:00'
3821+
url: https://github.com/DeltaV-Station/Delta-v/pull/2519
3822+
- author: juniwoofs
3823+
changes:
3824+
- message: added Morty Plushie to a few loot tables!
3825+
type: Tweak
3826+
id: 815
3827+
time: '2024-12-23T22:08:29.0000000+00:00'
3828+
url: https://github.com/DeltaV-Station/Delta-v/pull/2516
3829+
- author: Colin-Tel
3830+
changes:
3831+
- message: Added a recipe for a box of chicken nuggets. Requires protein, egg, flour,
3832+
and cardboard!
3833+
type: Add
3834+
id: 816
3835+
time: '2024-12-26T09:42:07.0000000+00:00'
3836+
url: https://github.com/DeltaV-Station/Delta-v/pull/2524

0 commit comments

Comments
 (0)