Skip to content

Commit

Permalink
Merge branch 'master' into 2024-01-27-SmallShipsCargo
Browse files Browse the repository at this point in the history
  • Loading branch information
dvir001 authored Jan 29, 2024
2 parents ff35c0f + cf8e3e5 commit 68e2bb4
Show file tree
Hide file tree
Showing 83 changed files with 16,867 additions and 12,410 deletions.
2 changes: 0 additions & 2 deletions .github/mapchecker/whitelist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,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
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
102 changes: 102 additions & 0 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2984,3 +2984,105 @@ Entries:
their subordinates!
id: 4770
time: '2024-01-27T16:31:09.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Tweak
message: Updated NC Mail to current mapping standards.
id: 4771
time: '2024-01-28T13:33:42.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Tweak
message: Updated NC Mission to current mapping standards.
id: 4772
time: '2024-01-28T13:59:17.0000000+00:00'
- author: TsjipTsjip
changes:
- type: Remove
message: Biomass from frontier outpost. (Experimental change, may get reverted.)
id: 4773
time: '2024-01-28T14:18:46.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Tweak
message: >-
Updated NC Bocadillo to current mapping standards plus made some QoL
changes.
id: 4774
time: '2024-01-28T15:21:02.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Tweak
message: >-
Updated NC Liquidator to current mapping standards, simplified atmos
setup.
id: 4775
time: '2024-01-28T15:49:40.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Tweak
message: Updated NC Barge to current mapping standards.
id: 4776
time: '2024-01-28T16:12:33.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Tweak
message: Updated NC Prospector to current mapping standards.
id: 4777
time: '2024-01-28T17:35:40.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Tweak
message: Updated HS Garden to current mapping standards.
id: 4778
time: '2024-01-28T18:20:52.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Fix
message: Fixed the problem with tabletop consoles.
id: 4779
time: '2024-01-29T11:03:59.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Fix
message: Fixed interaction angles for Suit Wallstorage Units. Probably.
id: 4780
time: '2024-01-29T14:56:18.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Tweak
message: Updated KL Bulker to current mapping standards.
id: 4781
time: '2024-01-29T16:01:49.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Tweak
message: Updated NC WaveShot to current mapping standards.
id: 4782
time: '2024-01-29T16:58:45.0000000+00:00'
- author: dvir01
changes:
- type: Tweak
message: >-
Cargo has moved some of the crates items to vending machines, Implant to
medical, cloth to theater, toys to cuddly critter.
id: 4783
time: '2024-01-29T17:04:22.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Tweak
message: Updated HS Garden to current mapping standards.
id: 4784
time: '2024-01-29T17:04:57.0000000+00:00'
- author: dvir01
changes:
- type: Add
message: >-
Plasma and uranium generators can now auto insert fuel with internal
magnet, toggle the magnet to on via the verb menu UI.
- type: Add
message: >-
Lathes can now auto insert materials, toggle the magnet to on via the
verb menu UI.
id: 4785
time: '2024-01-29T17:07:42.0000000+00:00'
20 changes: 0 additions & 20 deletions Resources/Locale/en-US/_NF/paper/book-medical-insurance.ftl

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 68e2bb4

Please sign in to comment.