Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smuggling posters are now random and NFSD gets rewarded for getting prints of posters and dead drops #1667

Merged
merged 99 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
362ebec
Changed the time between dead drops and distance
Shroomerian Jul 11, 2024
dabb88a
Removed deprecated GetMapEntityId for TryGetMap
Shroomerian Jul 11, 2024
1d99868
Removed tags that match autogenereated ones and simplified new Color
Shroomerian Jul 11, 2024
a008ba6
Made the distance even smaller
Shroomerian Jul 11, 2024
f71dab6
Revert "Made the distance even smaller"
Shroomerian Jul 11, 2024
ba4b15e
Merge branch 'new-frontiers-14:master' into smuggling-buff
Shroomerian Jul 11, 2024
abd0700
Added check to see how many dead drop components are nearby
Shroomerian Jul 12, 2024
7c80217
Changed behaviour of dead drop posters and added all of the previous …
Shroomerian Jul 12, 2024
5f6b3f3
Posters are finally random, only one can be active per point of interest
Shroomerian Jul 12, 2024
7670a6d
Added a message of the drop pod location to the NSFD after 15 minutes…
Shroomerian Jul 12, 2024
1cd4bae
Scanning activated dead drop posters gives 30k cash to NFSD and dead …
Shroomerian Jul 13, 2024
27dc7f6
NFSD scanning objects on the dead drop will reward them with 60k spes…
Shroomerian Jul 13, 2024
470fd58
Changed spessos rewards to FUC
Shroomerian Jul 13, 2024
f90afe4
Merge branch 'new-frontiers-14:master' into smuggling-buff
Shroomerian Jul 13, 2024
461f0e9
Merge branch 'master' into smuggling-buff
Shroomerian Jul 13, 2024
c94be83
Merge branch 'master' into smuggling-buff
Shroomerian Jul 13, 2024
6e0b359
Merge branch 'master' into smuggling-buff
Shroomerian Jul 13, 2024
98cff11
The timer now resets for the current poster if it detects any other p…
Shroomerian Jul 13, 2024
65d0dc8
Merge branch 'master' into smuggling-buff
Shroomerian Jul 13, 2024
64b460a
Merge branch 'master' into smuggling-buff
Shroomerian Jul 15, 2024
3fee8c8
Lowered the chance of posters appearing and thus being Dead Drops, ma…
Shroomerian Jul 15, 2024
889141e
Merge branch 'master' into smuggling-buff
Shroomerian Jul 15, 2024
14ad2d7
Merge branch 'smuggling-buff' of https://github.com/Shroomerian/front…
Shroomerian Jul 15, 2024
3bcca71
Increased the MinimumCooldown to 15 minutes and NFSD now gets progres…
Shroomerian Jul 16, 2024
c1493f6
Merge branch 'master' into smuggling-buff
dvir001 Jul 17, 2024
a1bc4db
Syndicate Supply Ships are now limited to 5 and if more are spawned, …
Shroomerian Jul 17, 2024
e0dbd44
Moved all of the radio strings to locale and additional comments
Shroomerian Jul 17, 2024
a47f678
Forensic scanner system now tracks based on access level rather than …
Shroomerian Jul 18, 2024
0726633
Removed the syndicate mob guy because he would step on mines and lose…
Shroomerian Jul 18, 2024
efd272f
Merge branch 'master' into smuggling-buff
Shroomerian Jul 19, 2024
9cbbd19
Merge branch 'master' into smuggling-buff
Shroomerian Jul 19, 2024
943213f
Merge branch 'master' into smuggling-buff
Shroomerian Jul 19, 2024
21efa0b
Merge branch 'master' into smuggling-buff
Shroomerian Jul 19, 2024
56c6fed
Merge branch 'master' into smuggling-buff
Shroomerian Jul 19, 2024
3429f58
Merge branch 'master' into smuggling-buff
Shroomerian Jul 19, 2024
928d28c
Merge branch 'master' into smuggling-buff
Shroomerian Jul 19, 2024
795db29
Merge branch 'master' into smuggling-buff
Shroomerian Jul 20, 2024
f0104a8
Merge branch 'master' into smuggling-buff
Shroomerian Jul 20, 2024
0c6703b
Merge branch 'master' into smuggling-buff
Shroomerian Jul 20, 2024
82cac6c
Merge branch 'master' into smuggling-buff
Shroomerian Jul 22, 2024
6ac840b
Merge branch 'master' into smuggling-buff
Shroomerian Jul 23, 2024
ac3ac66
Merge branch 'master' into smuggling-buff
Shroomerian Jul 23, 2024
eae25b3
Merge branch 'master' into smuggling-buff
Shroomerian Jul 24, 2024
9961336
Merge branch 'master' into smuggling-buff
Shroomerian Aug 5, 2024
d454abd
Changed the dead drop poster cooldown to 5-10 minutes but now only 2 …
Shroomerian Aug 6, 2024
02a9ffc
Merge branch 'master' into smuggling-buff
Shroomerian Aug 6, 2024
5008c31
Merge branch 'smuggling-buff' of https://github.com/Shroomerian/front…
whatston3 Aug 6, 2024
01633ee
Merge branch 'master' into smuggling-buff
dvir001 Aug 6, 2024
c637abb
Merge branch 'master' into smuggling-buff
Cheackraze Aug 9, 2024
681818b
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 Sep 10, 2024
cfff1e2
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 Sep 11, 2024
1297399
Random contraband generation, part one
whatston3 Aug 8, 2024
c420c7a
Station dead drop config, generation
whatston3 Aug 14, 2024
a0ee382
Forensics cartridge, nfsd uplink entry
whatston3 Sep 10, 2024
19808b6
forensic scanner, staton definitions
whatston3 Sep 10, 2024
ff2981b
Missing/inconsistent localization strings
whatston3 Sep 10, 2024
115b699
HardSuit->Hardsuit
whatston3 Sep 10, 2024
b74f967
A few more uplink fixes
whatston3 Sep 10, 2024
749d260
Revise dead drop tracking, always payout, add $
whatston3 Sep 10, 2024
cc5d90b
Prototype-based smuggling message passing
whatston3 Sep 11, 2024
4941dc5
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 Sep 12, 2024
02ce121
POI map fixes, revert health, remove MapInit
whatston3 Sep 12, 2024
0edca12
Logging, anchored items, no drops @ courthouse
whatston3 Sep 12, 2024
e754f97
Dead drop value fiddling, uplink rewrites
whatston3 Sep 12, 2024
0c4700b
cleanup
whatston3 Sep 12, 2024
a35d671
CVARS!
whatston3 Sep 13, 2024
d2ef2e3
Move prototype to Shared
whatston3 Sep 13, 2024
ec586ab
Fix config, cleanup, random error in drop pod msgs
whatston3 Sep 13, 2024
3d6c0eb
fix forensic printouts, dead drop spawn menu
whatston3 Sep 13, 2024
a5628dc
separate speso/fuc reward prints
whatston3 Sep 13, 2024
cefa52a
Min/Max delay to floats
whatston3 Sep 13, 2024
b2d14cd
DeadDropSystem: type fix
whatston3 Sep 13, 2024
77c31f1
Fix pirate delay, NFSD delay: 14-16 mins
whatston3 Sep 13, 2024
d18c603
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 Sep 16, 2024
8e7c70f
Random fax generator & event
whatston3 Sep 17, 2024
79b0180
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 Sep 18, 2024
18d5cc9
Roundstart hint generation
whatston3 Sep 19, 2024
2e62811
Remove test dead drop hints
whatston3 Sep 19, 2024
2e84ea5
Bugfixes for dead drop hint gen
whatston3 Sep 19, 2024
7cfa3c5
more paper!
whatston3 Sep 19, 2024
c344a2b
Smuggling guidebook entry, remove unneeded sec pgs
whatston3 Sep 19, 2024
fde1a6c
More smoog crate value, c3 trade crates, debug
whatston3 Sep 19, 2024
95ebf0b
Better drop pod scanner rewards
whatston3 Sep 19, 2024
b719ec6
DD writable VV field, fix crate parent
whatston3 Sep 19, 2024
084ce26
WindowedEvent fixes
whatston3 Sep 19, 2024
b706682
event naming
whatston3 Sep 19, 2024
001cda6
Add time to dead drop notes
whatston3 Sep 19, 2024
00280b8
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 Sep 19, 2024
fde2216
Merge branch 'smuggling-buff-suggestions-2' into smuggling-buff
whatston3 Sep 19, 2024
851a780
Freelancer->Freelance channel
whatston3 Sep 19, 2024
84a1957
PodLocation messages: fix precision for vectors
whatston3 Sep 19, 2024
bee9c50
Merge branch 'master' into smuggling-buff
dvir001 Sep 20, 2024
7d8835c
Disable shipyard sale component, tweak smoog param
whatston3 Sep 20, 2024
58b6455
Multiple faxes per event
whatston3 Sep 20, 2024
d02dc5a
fax and logic
whatston3 Sep 20, 2024
d5aaeb5
security_uplink_catalog: forensic module 2->4 FUC
whatston3 Sep 20, 2024
1370ab8
Merge branch 'smuggling-buff' of https://github.com/Shroomerian/front…
whatston3 Sep 21, 2024
6eb6974
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 Sep 21, 2024
bcca650
Merge branch 'master' of https://github.com/new-frontiers-14/frontier…
whatston3 Sep 21, 2024
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
150 changes: 149 additions & 1 deletion Content.Server/Forensics/Systems/ForensicScannerSystem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
using System.Linq;
using System.Text;
using Content.Server.Popups;
using Content.Server.Stack; // Frontier
using Content.Server._NF.Smuggling; // Frontier
using Content.Server._NF.Smuggling.Components; // Frontier
using Content.Server.Cargo.Systems; // Frontier
using Content.Server.Radio.EntitySystems; // Frontier
using Content.Shared.UserInterface;
using Content.Shared.DoAfter;
using Content.Shared.Fluids.Components;
Expand All @@ -9,13 +14,24 @@
using Content.Shared.Interaction;
using Content.Shared.Paper;
using Content.Shared.Verbs;
using Content.Shared.Stacks; // Frontier
using Content.Shared.Radio; // Frontier
using Content.Shared.Access.Systems; // Frontier
using Robust.Shared.Prototypes; // Frontier
using Content.Shared.Tag;
using Robust.Shared.Audio.Systems;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Player;
using Robust.Shared.Timing;
using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Shared.Containers.ItemSlots; // Frontier
using Content.Server.Cargo.Components; // Frontier
using Content.Server._NF.SectorServices; // Frontier
using Content.Shared.FixedPoint; // Frontier
using Robust.Shared.Configuration; // Frontier
using Content.Shared._NF.CCVar;
using Content.Shared._NF.Bank; // Frontier

// todo: remove this stinky LINQy

namespace Content.Server.Forensics
Expand All @@ -33,6 +49,30 @@ public sealed class ForensicScannerSystem : EntitySystem
[Dependency] private readonly ForensicsSystem _forensicsSystem = default!;
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
[Dependency] private readonly TagSystem _tag = default!;
[Dependency] private readonly StackSystem _stackSystem = default!; // Frontier
[Dependency] private readonly SharedAudioSystem _audio = default!; // Frontier
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; // Frontier
[Dependency] private readonly RadioSystem _radio = default!; // Frontier
[Dependency] private readonly AccessReaderSystem _accessReader = default!; // Frontier
[Dependency] private readonly DeadDropSystem _deadDrop = default!; // Frontier
[Dependency] private readonly ItemSlotsSystem _itemSlots = default!; // Frontier
[Dependency] private readonly CargoSystem _cargo = default!; // Frontier
[Dependency] private readonly SectorServiceSystem _service = default!; // Frontier
[Dependency] private readonly IConfigurationManager _cfg = default!; // Frontier

// Frontier: payout constants
// Temporary values, sane defaults, will be overwritten by CVARs.
private int _minFUCPayout = 2;

private const int ActiveUnusedDeadDropSpesoReward = 20000;
private const float ActiveUnusedDeadDropFUCReward = 2.0f;
private const int ActiveUsedDeadDropSpesoReward = 10000;
private const float ActiveUsedDeadDropFUCReward = 1.0f;
private const int InactiveUsedDeadDropSpesoReward = 5000;
private const float InactiveUsedDeadDropFUCReward = 0.5f;
private const int DropPodSpesoReward = 10000;
private const float DropPodFUCReward = 1.0f;
// End Frontier: payout constants

public override void Initialize()
{
Expand All @@ -45,7 +85,73 @@ public override void Initialize()
SubscribeLocalEvent<ForensicScannerComponent, ForensicScannerPrintMessage>(OnPrint);
SubscribeLocalEvent<ForensicScannerComponent, ForensicScannerClearMessage>(OnClear);
SubscribeLocalEvent<ForensicScannerComponent, ForensicScannerDoAfterEvent>(OnDoAfter);

Subs.CVar(_cfg, NFCCVars.SmugglingMinFucPayout, OnMinFucPayoutChanged, true); // Frontier
}

private void OnMinFucPayoutChanged(int newMin)
{
_minFUCPayout = newMin;
}

// Frontier: add dead drop rewards
/// <summary>
/// Rewards the NFSD department for scanning a dead drop.
/// Gives some amount of spesos and FUC to the
/// </summary>
private void GiveReward(EntityUid uidOrigin, EntityUid target, int spesoAmount, FixedPoint2 fucAmount, string msg)
{
SoundSpecifier confirmSound = new SoundPathSpecifier("/Audio/Effects/Cargo/ping.ogg");
_audio.PlayPvs(_audio.GetSound(confirmSound), uidOrigin);

// Credit the NFSD's bank account (todo: split these)
if (spesoAmount > 0)
{
var queryBank = EntityQuery<StationBankAccountComponent>();
foreach (var account in queryBank)
{
_cargo.DeductFunds(account, -spesoAmount);
}
}
else
spesoAmount = 0;

if (fucAmount > 0)
{
// Accumulate sector-wide FUCs, pay out if min threshold met
if (TryComp<SectorDeadDropComponent>(_service.GetServiceEntity(), out var sectorDD))
{
sectorDD.FUCAccumulator += fucAmount;
if (sectorDD.FUCAccumulator >= _minFUCPayout)
{
// inherent floor
int payout = sectorDD.FUCAccumulator.Int();
sectorDD.FUCAccumulator -= payout;

var stackPrototype = _prototypeManager.Index<StackPrototype>("FrontierUplinkCoin");
_stackSystem.Spawn(payout, stackPrototype, Transform(target).Coordinates);
}
}
}
else
fucAmount = 0;

var channel = _prototypeManager.Index<RadioChannelPrototype>("Nfsd");
string msgString = Loc.GetString(msg);
if (fucAmount >= 1)
{
msgString = msgString + " " + Loc.GetString("forensic-reward-amount",
("spesos", BankSystemExtensions.ToSpesoString(spesoAmount)),
("fuc", BankSystemExtensions.ToFUCString(fucAmount.Int())));
}
else
{
msgString = msgString + " " + Loc.GetString("forensic-reward-amount-speso-only",
("spesos", BankSystemExtensions.ToSpesoString(spesoAmount)));
}
_radio.SendRadioMessage(uidOrigin, msgString, channel, uidOrigin);
}
// End Frontier: add dead drop rewards

private void UpdateUserInterface(EntityUid uid, ForensicScannerComponent component)
{
Expand Down Expand Up @@ -87,6 +193,48 @@ private void OnDoAfter(EntityUid uid, ForensicScannerComponent component, DoAfte
scanner.Residues = forensics.Residues.ToList();
}

// Frontier: contraband poster/pod scanning
if (_itemSlots.TryGetSlot(uid, "forensics_cartridge", out var itemSlot) && itemSlot.HasItem)
{
EntityUid target = args.Args.Target.Value;
if (TryComp<DeadDropComponent>(target, out var deadDrop))
{
// If there's a dead drop note present, pay out regardless and compromise the dead drop.
if (_gameTiming.CurTime >= deadDrop.NextDrop)
{
int spesoReward;
FixedPoint2 fucReward;
string msg;
if (deadDrop.DeadDropCalled)
{
spesoReward = ActiveUsedDeadDropSpesoReward;
fucReward = ActiveUsedDeadDropFUCReward;
msg = "forensic-reward-dead-drop-used-present";
}
else
{
spesoReward = ActiveUnusedDeadDropSpesoReward;
fucReward = ActiveUnusedDeadDropFUCReward;
msg = "forensic-reward-dead-drop-unused";
}
GiveReward(uid, target, spesoReward, fucReward, msg);
_deadDrop.CompromiseDeadDrop(target, deadDrop);
}
// Otherwise, if it's been used, pay out at a reduced rate and compromise it.
else if (deadDrop.DeadDropCalled)
{
GiveReward(uid, target, InactiveUsedDeadDropSpesoReward, InactiveUsedDeadDropFUCReward, "forensic-reward-dead-drop-used-gone");
_deadDrop.CompromiseDeadDrop(target, deadDrop);
}
}
else if (TryComp<ContrabandPodGridComponent>(Transform(target).GridUid, out var pod) && !pod.Scanned)
{
GiveReward(uid, target, DropPodSpesoReward, DropPodFUCReward, "forensic-reward-pod");
pod.Scanned = true;
}
}
// End Frontier: contraband poster/pod scanning

if (_tag.HasTag(args.Args.Target.Value, "DNASolutionScannable"))
{
scanner.SolutionDNAs = _forensicsSystem.GetSolutionsDNA(args.Args.Target.Value);
Expand Down
34 changes: 34 additions & 0 deletions Content.Server/Shipyard/Systems/ShipyardSystem.Consoles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
using Robust.Shared.Audio.Systems;
using Content.Shared.Access;
using Content.Shared.Tiles;
using Content.Server._NF.Smuggling.Components;

namespace Content.Server.Shipyard.Systems;

Expand Down Expand Up @@ -367,6 +368,17 @@ public void OnSellMessage(EntityUid uid, ShipyardConsoleComponent component, Shi

var shuttleName = ToPrettyString(shuttleUid); // Grab the name before it gets 1984'd

// Check for shipyard blacklisting components
var disableSaleQuery = GetEntityQuery<DisableShipyardSaleComponent>();
var xformQuery = GetEntityQuery<TransformComponent>();
var disableSaleMsg = FindDisableShipyardSaleObjects(shuttleUid, (ShipyardConsoleUiKey)args.UiKey, disableSaleQuery, xformQuery);
if (disableSaleMsg != null)
{
ConsolePopup(args.Actor, Loc.GetString(disableSaleMsg));
PlayDenySound(args.Actor, uid, component);
return;
}

var saleResult = TrySellShuttle(stationUid, shuttleUid, out var bill);
if (saleResult.Error != ShipyardSaleError.Success)
{
Expand Down Expand Up @@ -606,6 +618,28 @@ private void OnItemSlotChanged(EntityUid uid, ShipyardConsoleComponent component
return null;
}

/// <summary>
/// Looks for a living, sapient being aboard a particular entity.
/// </summary>
/// <param name="uid">The entity to search (e.g. a shuttle, a station)</param>
/// <param name="mobQuery">A query to get the MobState from an entity</param>
/// <param name="xformQuery">A query to get the transform component of an entity</param>
/// <returns>The name of the sapient being if one was found, null otherwise.</returns>
public string? FindDisableShipyardSaleObjects(EntityUid shuttle, ShipyardConsoleUiKey key, EntityQuery<DisableShipyardSaleComponent> disableSaleQuery, EntityQuery<TransformComponent> xformQuery)
{
var xform = xformQuery.GetComponent(shuttle);
var childEnumerator = xform.ChildEnumerator;

while (childEnumerator.MoveNext(out var child))
{
if (disableSaleQuery.TryGetComponent(child, out var disableSale)
&& !disableSale.AllowedShipyardTypes.Contains(key))
return disableSale.Reason;
}

return null;
}

private struct IDShipAccesses
{
public IReadOnlyCollection<ProtoId<AccessLevelPrototype>> Tags;
Expand Down
4 changes: 4 additions & 0 deletions Content.Server/Shipyard/Systems/ShipyardSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Content.Shared.Shipyard.Events;
using Content.Shared.Mobs.Components;
using Robust.Shared.Containers;
using Content.Server._NF.Smuggling.Components;

namespace Content.Server.Shipyard.Systems;

Expand Down Expand Up @@ -46,12 +47,15 @@ public enum ShipyardSaleError
Undocked, // Ship is not docked with the station.
OrganicsAboard, // Sapient intelligence is aboard, cannot sell, would delete the organics
InvalidShip, // Ship is invalid
MessageOverwritten, // Overwritten message.
}

// TODO: swap to strictly being a formatted message.
public struct ShipyardSaleResult
{
public ShipyardSaleError Error; // Whether or not the ship can be sold.
public string? OrganicName; // In case an organic is aboard, this will be set to the first that's aboard.
public string? OverwrittenMessage; // The message to write if Error is MessageOverwritten.
}

public override void Initialize()
Expand Down
4 changes: 4 additions & 0 deletions Content.Server/_NF/Forensics/ForensicsCartridgeComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace Content.Server._NF.Forensics;

[RegisterComponent]
public sealed partial class ForensicsCartridgeComponent : Component;
7 changes: 7 additions & 0 deletions Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
using Content.Shared._NF.GameRule;
using Content.Server.Procedural;
using Content.Shared.Bank.Components;
using Content.Server._NF.GameTicking.Events;
using Content.Server.GameTicking.Events;
using Content.Server.GameTicking.Rules.Components;
using Content.Shared.Procedural;
using Robust.Server.GameObjects;
using Robust.Server.Maps;
Expand All @@ -23,6 +26,7 @@
using Robust.Shared.Random;
using Robust.Shared.Map.Components;
using Content.Shared.Shuttles.Components;
using Content.Server._NF.GameTicking.Events;
using Content.Server.Shuttles.Systems;
using Content.Server.Cargo.Components;
using Content.Server.GameTicking;
Expand Down Expand Up @@ -161,6 +165,9 @@ protected override void Started(EntityUid uid, AdventureRuleComponent component,

base.Started(uid, component, gameRule, args);

// Using invalid entity, we don't have a relevant entity to reference here.
RaiseLocalEvent(EntityUid.Invalid, new StationsGeneratedEvent(), broadcast: true); // TODO: attach this to a meaningful entity.

var dungenTypes = _prototypeManager.EnumeratePrototypes<DungeonConfigPrototype>();

foreach (var dunGen in dungenTypes)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Robust.Shared.Prototypes;

namespace Content.Server.GameTicking.Rules.VariationPass.Components;

/// <summary>
/// This handles generating round-start dead drop hints.
/// </summary>
[RegisterComponent]
public sealed partial class DeadDropHintVariationPassComponent : Component
{
/// <summary>
/// Chance that a potential hint will be generated on a table.
/// Remember, the average number
/// </summary>
[DataField]
public float HintSpawnChance = 0.02f;

/// <summary>
/// The entity to spawn for a hint.
/// </summary>
[DataField]
public EntProtoId HintSpawnPrototype = "PaperDeadDropHint";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Content.Server._NF.Smuggling.Components;
using Content.Server.GameTicking.Rules.VariationPass.Components;
using Content.Shared.Climbing.Components;
using Content.Shared.Placeable;

namespace Content.Server.GameTicking.Rules.VariationPass;

/// <inheritdoc cref="DeadDropHintVariationPassComponent"/>
public sealed class DeadDropHintVariationPass : VariationPassSystem<DeadDropHintVariationPassComponent>
{
protected override void ApplyVariation(Entity<DeadDropHintVariationPassComponent> ent, ref StationVariationPassEvent args)
{
if (HasComp<StationDeadDropHintExemptComponent>(args.Station))
return;

// Best query for table-like objects: bonkable filters out grills.
var query = AllEntityQuery<BonkableComponent, PlaceableSurfaceComponent, TransformComponent>();
while (query.MoveNext(out var uid, out var _, out var _, out var xform))
{
if (!IsMemberOfStation((uid, xform), ref args))
continue;

var prob = Random.NextFloat();
if (prob < ent.Comp.HintSpawnChance)
{
SpawnAttachedTo(ent.Comp.HintSpawnPrototype, xform.Coordinates);
}
}
}
}
11 changes: 11 additions & 0 deletions Content.Server/_NF/GameTicking/SectorGeneratedEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Content.Server._NF.GameTicking.Events;

/// <summary>
/// Raised once all of the stations have been generated.
/// </summary>
public sealed class StationsGeneratedEvent : EntityEventArgs
{
public StationsGeneratedEvent()
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Content.Server._NF.Smuggling.Components;

/// <summary>
/// Denotes a grid that is brought in via a dead drop.
/// </summary>
[RegisterComponent]
public sealed partial class ContrabandPodGridComponent : Component
{
/// <summary>
/// Maximum number of dead drops to spawn on the station.
/// </summary>
[DataField]
public bool Scanned = false;
}
Loading
Loading