Skip to content

Commit

Permalink
Merge branch 'NC-Crescent-Update' of https://github.com/ErhardSteinha…
Browse files Browse the repository at this point in the history
  • Loading branch information
dvir001 committed Jan 29, 2024
2 parents 7c5324f + ad164bc commit 77ee73c
Show file tree
Hide file tree
Showing 172 changed files with 40,718 additions and 16,594 deletions.
3 changes: 1 addition & 2 deletions .github/mapchecker/whitelist.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# POI's
Frontier: true
nfsd: true

anomalouslab:
- WallPlastitaniumIndestructible
Expand Down Expand Up @@ -69,5 +70,3 @@ Schooner:
- IntercomCommand
Marauder:
- IntercomCommand
Empress:
- IntercomAll
5 changes: 5 additions & 0 deletions Content.Server/Guardian/GuardianComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@ public sealed partial class GuardianComponent : Component
/// </summary>
public bool GuardianLoose = false;

/// <summary>
/// If the guardian can be AI based
/// </summary>
[DataField("ai")]
public bool Ai;
}
}
11 changes: 11 additions & 0 deletions Content.Server/Guardian/GuardianSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,11 @@ private void CheckGuardianMove(
RetractGuardian(hostUid, hostComponent, guardianUid, guardianComponent);
}

private bool CanRelease(EntityUid guardian)
{
return HasComp<ActorComponent>(guardian);
}

private void ReleaseGuardian(EntityUid host, GuardianHostComponent hostComponent, EntityUid guardian, GuardianComponent guardianComponent)
{
if (guardianComponent.GuardianLoose)
Expand All @@ -309,6 +314,12 @@ private void ReleaseGuardian(EntityUid host, GuardianHostComponent hostComponent
return;
}

if (!guardianComponent.Ai && !CanRelease(guardian))
{
_popupSystem.PopupEntity(Loc.GetString("guardian-no-soul"), host, host);
return;
}

DebugTools.Assert(hostComponent.GuardianContainer.Contains(guardian));
hostComponent.GuardianContainer.Remove(guardian);
DebugTools.Assert(!hostComponent.GuardianContainer.Contains(guardian));
Expand Down
18 changes: 18 additions & 0 deletions Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ private void OnStartup(RoundStartingEvent ev)
var lab = "/Maps/_NF/POI/anomalouslab.yml";
var church = "Maps/_NF/POI/beacon.yml";
var grifty = "Maps/_NF/POI/grifty.yml";
var nfsdStation = "/Maps/_NF/POI/nfsd.yml";
var depotColor = new Color(55, 200, 55);
var civilianColor = new Color(55, 55, 200);
var lpbravoColor = new Color(200, 55, 55);
Expand Down Expand Up @@ -150,6 +151,23 @@ private void OnStartup(RoundStartingEvent ev)
_shuttle.SetIFFColor(depotUid3s[0], depotColor);
}

if (_map.TryLoad(mapId, nfsdStation, out var nfsdUids, new MapLoadOptions
{
Offset = _random.NextVector2(500f, 700f)
}))
{
// We should figure out if it is possible to add this grid to the latejoin listing.
// Hey turns out we can! (This is kinda copypasted from the lodge with some values filled in.)
if (_prototypeManager.TryIndex<GameMapPrototype>("nfsd", out var stationProto))
{
_station.InitializeNewStation(stationProto.Stations["nfsd"], nfsdUids);
}

var meta = EnsureComp<MetaDataComponent>(nfsdUids[0]);
_meta.SetEntityName(nfsdUids[0], "NFSD Outpost", meta);
_shuttle.SetIFFColor(nfsdUids[0], new Color(1f, 0.2f, 0.2f));
}

if (_map.TryLoad(mapId, tinnia, out var depotUid2s, new MapLoadOptions
{
Offset = tinniaOffset
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Robust.Shared.GameStates;

namespace Content.Shared.StepTrigger.Components;

/// <summary>
/// Frontier - This is used for immunity to cancelling step trigger events if the user is wearing shoes, such as for glass shards.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class ShoesRequiredStepTriggerImmuneComponent : Component // Frontier
{
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Shared.Examine;
using Content.Shared.Examine;
using Content.Shared.Inventory;
using Content.Shared.StepTrigger.Components;
using Content.Shared.Tag;
Expand All @@ -25,6 +25,12 @@ private void OnStepTriggerAttempt(EntityUid uid, ShoesRequiredStepTriggerCompone
return;
}

if (HasComp<ShoesRequiredStepTriggerImmuneComponent>(args.Tripper)) // Frontier
{
args.Cancelled = true;
return;
}

if (!TryComp<InventoryComponent>(args.Tripper, out var inventory))
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ public sealed partial class MaterialReclaimerMagnetPickupComponent : Component

[ViewVariables(VVAccess.ReadWrite), DataField("range")]
public float Range = 1f;

/// <summary>
/// Frontier - Is the magnet currently enabled?
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("magnetEnabled")]
public bool MagnetEnabled = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ public sealed partial class MaterialStorageMagnetPickupComponent : Component

[ViewVariables(VVAccess.ReadWrite), DataField("range")]
public float Range = 1f;

/// <summary>
/// Frontier - Is the magnet currently enabled?
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("magnetEnabled")]
public bool MagnetEnabled = false;
}
1 change: 0 additions & 1 deletion Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public bool ToggleMagnet(EntityUid uid, MagnetPickupComponent comp)
return comp.MagnetEnabled;
}


public override void Update(float frameTime)
{
base.Update(frameTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
using Content.Shared.Materials;
using Robust.Shared.Physics.Components;
using Robust.Shared.Timing;
using Content.Shared.Examine; // Frontier
using Content.Shared.Hands.Components; // Frontier
using Content.Shared.Verbs; // Frontier
using Robust.Shared.Utility; // Frontier

namespace Content.Shared.Storage.EntitySystems;

Expand All @@ -24,6 +28,8 @@ public override void Initialize()
_physicsQuery = GetEntityQuery<PhysicsComponent>();
SubscribeLocalEvent<MaterialReclaimerMagnetPickupComponent, MapInitEvent>(OnMagnetMapInit);
SubscribeLocalEvent<MaterialReclaimerMagnetPickupComponent, EntityUnpausedEvent>(OnMagnetUnpaused);
SubscribeLocalEvent<MaterialReclaimerMagnetPickupComponent, ExaminedEvent>(OnExamined); // Frontier
SubscribeLocalEvent<MaterialReclaimerMagnetPickupComponent, GetVerbsEvent<AlternativeVerb>>(AddToggleMagnetVerb); // Frontier
}

private void OnMagnetUnpaused(EntityUid uid, MaterialReclaimerMagnetPickupComponent component, ref EntityUnpausedEvent args)
Expand All @@ -33,7 +39,48 @@ private void OnMagnetUnpaused(EntityUid uid, MaterialReclaimerMagnetPickupCompon

private void OnMagnetMapInit(EntityUid uid, MaterialReclaimerMagnetPickupComponent component, MapInitEvent args)
{
component.NextScan = _timing.CurTime + TimeSpan.FromSeconds(1f);
component.NextScan = _timing.CurTime + TimeSpan.FromSeconds(1); // Need to add 1 sec to fix a weird time bug with it that make it never start the magnet
}

// Frontier, used to add the magnet toggle to the context menu
private void AddToggleMagnetVerb(EntityUid uid, MaterialReclaimerMagnetPickupComponent component, GetVerbsEvent<AlternativeVerb> args)
{
if (!args.CanAccess || !args.CanInteract)
return;

if (!HasComp<HandsComponent>(args.User))
return;

AlternativeVerb verb = new()
{
Act = () =>
{
ToggleMagnet(uid, component);
},
Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/Spare/poweronoff.svg.192dpi.png")),
Text = Loc.GetString("magnet-pickup-component-toggle-verb"),
Priority = 3
};

args.Verbs.Add(verb);
}

// Frontier, used to show the magnet state on examination
private void OnExamined(EntityUid uid, MaterialReclaimerMagnetPickupComponent component, ExaminedEvent args)
{
args.PushMarkup(Loc.GetString("magnet-pickup-component-on-examine-main",
("stateText", Loc.GetString(component.MagnetEnabled
? "magnet-pickup-component-magnet-on"
: "magnet-pickup-component-magnet-off"))));
}

// Frontier, used to toggle the magnet on the ore bag/box
public bool ToggleMagnet(EntityUid uid, MaterialReclaimerMagnetPickupComponent comp)
{
var query = EntityQueryEnumerator<MaterialReclaimerMagnetPickupComponent>();
comp.MagnetEnabled = !comp.MagnetEnabled;

return comp.MagnetEnabled;
}

public override void Update(float frameTime)
Expand All @@ -49,6 +96,10 @@ public override void Update(float frameTime)

comp.NextScan += ScanDelay;

// Frontier - magnet disabled
if (!comp.MagnetEnabled)
continue;

var parentUid = xform.ParentUid;

foreach (var near in _lookup.GetEntitiesInRange(uid, comp.Range, LookupFlags.Dynamic | LookupFlags.Sundries))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
using Content.Shared.Materials;
using Robust.Shared.Physics.Components;
using Robust.Shared.Timing;
using Content.Shared.Examine; // Frontier
using Content.Shared.Hands.Components; // Frontier
using Content.Shared.Verbs; // Frontier
using Robust.Shared.Utility; // Frontier

namespace Content.Shared.Storage.EntitySystems;

Expand All @@ -24,6 +28,8 @@ public override void Initialize()
_physicsQuery = GetEntityQuery<PhysicsComponent>();
SubscribeLocalEvent<MaterialStorageMagnetPickupComponent, MapInitEvent>(OnMagnetMapInit);
SubscribeLocalEvent<MaterialStorageMagnetPickupComponent, EntityUnpausedEvent>(OnMagnetUnpaused);
SubscribeLocalEvent<MaterialStorageMagnetPickupComponent, ExaminedEvent>(OnExamined); // Frontier
SubscribeLocalEvent<MaterialStorageMagnetPickupComponent, GetVerbsEvent<AlternativeVerb>>(AddToggleMagnetVerb); // Frontier
}

private void OnMagnetUnpaused(EntityUid uid, MaterialStorageMagnetPickupComponent component, ref EntityUnpausedEvent args)
Expand All @@ -33,7 +39,48 @@ private void OnMagnetUnpaused(EntityUid uid, MaterialStorageMagnetPickupComponen

private void OnMagnetMapInit(EntityUid uid, MaterialStorageMagnetPickupComponent component, MapInitEvent args)
{
component.NextScan = _timing.CurTime + TimeSpan.FromSeconds(1f);
component.NextScan = _timing.CurTime + TimeSpan.FromSeconds(1); // Need to add 1 sec to fix a weird time bug with it that make it never start the magnet
}

// Frontier, used to add the magnet toggle to the context menu
private void AddToggleMagnetVerb(EntityUid uid, MaterialStorageMagnetPickupComponent component, GetVerbsEvent<AlternativeVerb> args)
{
if (!args.CanAccess || !args.CanInteract)
return;

if (!HasComp<HandsComponent>(args.User))
return;

AlternativeVerb verb = new()
{
Act = () =>
{
ToggleMagnet(uid, component);
},
Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/Spare/poweronoff.svg.192dpi.png")),
Text = Loc.GetString("magnet-pickup-component-toggle-verb"),
Priority = 3
};

args.Verbs.Add(verb);
}

// Frontier, used to show the magnet state on examination
private void OnExamined(EntityUid uid, MaterialStorageMagnetPickupComponent component, ExaminedEvent args)
{
args.PushMarkup(Loc.GetString("magnet-pickup-component-on-examine-main",
("stateText", Loc.GetString(component.MagnetEnabled
? "magnet-pickup-component-magnet-on"
: "magnet-pickup-component-magnet-off"))));
}

// Frontier, used to toggle the magnet on the ore bag/box
public bool ToggleMagnet(EntityUid uid, MaterialStorageMagnetPickupComponent comp)
{
var query = EntityQueryEnumerator<MaterialStorageMagnetPickupComponent>();
comp.MagnetEnabled = !comp.MagnetEnabled;

return comp.MagnetEnabled;
}

public override void Update(float frameTime)
Expand All @@ -49,6 +96,10 @@ public override void Update(float frameTime)

comp.NextScan += ScanDelay;

// Frontier - magnet disabled
if (!comp.MagnetEnabled)
continue;

var parentUid = xform.ParentUid;

foreach (var near in _lookup.GetEntitiesInRange(uid, comp.Range, LookupFlags.Dynamic | LookupFlags.Sundries))
Expand Down
7 changes: 1 addition & 6 deletions Resources/Audio/Lobby/attributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,4 @@
- files: ["every_light_is_blinking_at_once.ogg"]
license: "CC-BY-NC-SA-3.0"
copyright: "every light is blinking at once by Alexander Divine."
source: "https://soundcloud.com/alexanderdivine/every-light-is-blinking-at-once"

- files: ["victory.ogg"]
license: "CC-BY-NC-SA-3.0"
copyright: "Victory by Koruu Chan. Rights reserved by Checkraze. Converted from WAV to OGG."
source: "https://github.com/Cheackraze"
source: "https://soundcloud.com/alexanderdivine/every-light-is-blinking-at-once"
Binary file removed Resources/Audio/Lobby/victory.ogg
Binary file not shown.
9 changes: 9 additions & 0 deletions Resources/Audio/_NF/Lobby/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- files: ["victory.ogg"]
license: "CC-BY-NC-SA-3.0"
copyright: "Victory by Koruu Chan. Rights reserved by Checkraze. Converted from WAV to OGG."
source: "https://github.com/Cheackraze"

- files: ["shibamata.ogg"]
license: "CC-BY-3.0"
copyright: "Shibamata midi remake. Likely original: https://www.nicovideo.jp/watch/sm32841166"
source: "https://github.com/Elijahrane/arcadia-station/blob/c2ea3f44d4de4c0a337aeddb12f167a89c5ed3ef/Resources/Audio/Lobby/shibamata.ogg"
Binary file added Resources/Audio/_NF/Lobby/shibamata.ogg
Binary file not shown.
Binary file added Resources/Audio/_NF/Lobby/victory.ogg
Binary file not shown.
Loading

0 comments on commit 77ee73c

Please sign in to comment.