Skip to content

Commit

Permalink
Merge branch 'new-frontiers-14:master' into Goblin-Species
Browse files Browse the repository at this point in the history
  • Loading branch information
ErhardSteinhauer authored Jan 29, 2024
2 parents 3374fc9 + 4004121 commit 8129d2a
Show file tree
Hide file tree
Showing 105 changed files with 21,965 additions and 15,791 deletions.
5 changes: 0 additions & 5 deletions .github/mapchecker/whitelist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,9 @@ RosebudMKII:
- EncryptionKeyEngineering
- EncryptionKeyScience
- EncryptionKeyService
Crescent:
- EncryptionKeyScience
- IntercomCommand
Pathfinder:
- IntercomCommand
Schooner:
- IntercomCommand
Marauder:
- IntercomCommand
Empress:
- IntercomAll
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private void FixGridAtmosCommand(IConsoleShell shell, string argstr, string[] ar
return;
}

var mixtures = new GasMixture[10]; // Add one per added array
var mixtures = new GasMixture[11]; // Add one per added array
for (var i = 0; i < mixtures.Length; i++)
mixtures[i] = new GasMixture(Atmospherics.CellVolume) { Temperature = Atmospherics.T20C };

Expand Down Expand Up @@ -76,6 +76,13 @@ private void FixGridAtmosCommand(IConsoleShell shell, string argstr, string[] ar
mixtures[9].Clear();
mixtures[9].AdjustMoles(Gas.Plasma, Atmospherics.MolesCellShuttle);

// Frontier - 10: Sauna (GM)
mixtures[10].Clear();
mixtures[10].AdjustMoles(Gas.Oxygen, Atmospherics.OxygenMolesStandard);
mixtures[10].AdjustMoles(Gas.Nitrogen, Atmospherics.NitrogenMolesStandard);
mixtures[10].AdjustMoles(Gas.WaterVapor, Atmospherics.NitrogenMolesStandard);
mixtures[10].Temperature = 340f; // Sauna

foreach (var arg in args)
{
if (!NetEntity.TryParse(arg, out var netEntity) || !TryGetEntity(netEntity, out var euid))
Expand Down
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
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
Loading

0 comments on commit 8129d2a

Please sign in to comment.