Skip to content

Commit

Permalink
Merge branch 'master' into DeltaV-Station_Delta-v_1002_2024-04-07
Browse files Browse the repository at this point in the history
  • Loading branch information
VMSolidus authored Apr 8, 2024
2 parents e15e53b + e20884b commit 0e88729
Show file tree
Hide file tree
Showing 90 changed files with 2,880 additions and 1,107 deletions.
2 changes: 1 addition & 1 deletion Content.Server/Ame/AmeNodeGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public float CalculatePower(int fuel, int cores)
// Fuel is squared so more fuel vastly increases power and efficiency
// We divide by the number of cores so a larger AME is less efficient at the same fuel settings
// this results in all AMEs having the same efficiency at the same fuel-per-core setting
return 2000000f * fuel * fuel / cores;
return 20000f * fuel * fuel / cores; // Delt V - Revert upstream buff for normal AME operation
}

public int GetTotalStability()
Expand Down
3 changes: 2 additions & 1 deletion Content.Shared/Access/Components/IdCardConsoleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public WriteToTargetIdMessage(string fullName, string jobTitle, List<string> acc
"ChiefEngineer",
"ChiefMedicalOfficer",
"Clown", // DeltaV - Add Clown access
"Corpsman", // DeltaV - Add Corpsman access
"Command",
"Cryogenics",
"Engineering",
Expand All @@ -67,7 +68,7 @@ public WriteToTargetIdMessage(string fullName, string jobTitle, List<string> acc
"Janitor",
"Kitchen",
"Lawyer",
"Library", // DeltaV - Add Library access
"Library", // DeltaV - Add Library access
"Maintenance",
"Medical",
"Mime", // DeltaV - Add Mime access
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace Content.Shared.Frontier.Storage.Components;

/// <summary>
/// Applies an ongoing pickup area around the attached entity.
/// </summary>
[RegisterComponent]
public sealed partial class MaterialReclaimerMagnetPickupComponent : Component
{
[ViewVariables(VVAccess.ReadWrite), DataField("nextScan")]
public TimeSpan NextScan = TimeSpan.Zero;

[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
@@ -0,0 +1,20 @@
namespace Content.Shared.Frontier.Storage.Components;

/// <summary>
/// Applies an ongoing pickup area around the attached entity.
/// </summary>
[RegisterComponent]
public sealed partial class MaterialStorageMagnetPickupComponent : Component
{
[ViewVariables(VVAccess.ReadWrite), DataField("nextScan")]
public TimeSpan NextScan = TimeSpan.Zero;

[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
@@ -0,0 +1,107 @@
using Content.Shared.Frontier.Storage.Components;
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.Frontier.Storage.EntitySystems;

/// <summary>
/// <see cref="MaterialReclaimerMagnetPickupComponent"/>
/// </summary>
public sealed class MaterialReclaimerMagnetPickupSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly SharedMaterialReclaimerSystem _storage = default!;

private static readonly TimeSpan ScanDelay = TimeSpan.FromSeconds(1);

private EntityQuery<PhysicsComponent> _physicsQuery;

public override void Initialize()
{
base.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)
{
component.NextScan += args.PausedTime;
}

private void OnMagnetMapInit(EntityUid uid, MaterialReclaimerMagnetPickupComponent component, MapInitEvent args)
{
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 (!HasComp<HandsComponent>(args.User)
|| !args.CanInteract
|| !args.CanAccess)
return;

AlternativeVerb verb = new()
{
Act = () =>
{
component.MagnetEnabled = !component.MagnetEnabled;
},
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"))));
}

public override void Update(float frameTime)
{
base.Update(frameTime);
var query = EntityQueryEnumerator<MaterialReclaimerMagnetPickupComponent, MaterialReclaimerComponent, TransformComponent>();
var currentTime = _timing.CurTime;

while (query.MoveNext(out var uid, out var comp, out var storage, out var xform))
{
if (comp.NextScan < currentTime)
continue;

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))
{
if (!_physicsQuery.TryGetComponent(near, out var physics) || physics.BodyStatus != BodyStatus.OnGround)
continue;

if (near == parentUid)
continue;

_storage.TryStartProcessItem(uid, near);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
using Content.Shared.Frontier.Storage.Components;
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.Frontier.Storage.EntitySystems;

/// <summary>
/// <see cref="MaterialStorageMagnetPickupComponent"/>
/// </summary>
public sealed class MaterialStorageMagnetPickupSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly SharedMaterialStorageSystem _storage = default!;

private static readonly TimeSpan ScanDelay = TimeSpan.FromSeconds(1);

private EntityQuery<PhysicsComponent> _physicsQuery;

public override void Initialize()
{
base.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)
{
component.NextScan += args.PausedTime;
}

private void OnMagnetMapInit(EntityUid uid, MaterialStorageMagnetPickupComponent component, MapInitEvent args)
{
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 (!HasComp<HandsComponent>(args.User)
|| !args.CanInteract
|| !args.CanAccess)
return;

AlternativeVerb verb = new()
{
Act = () =>
{
component.MagnetEnabled = !component.MagnetEnabled;
},
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"))));
}

public override void Update(float frameTime)
{
base.Update(frameTime);
var query = EntityQueryEnumerator<MaterialStorageMagnetPickupComponent, MaterialStorageComponent, TransformComponent>();
var currentTime = _timing.CurTime;

while (query.MoveNext(out var uid, out var comp, out var storage, out var xform))
{
if (comp.NextScan < currentTime)
continue;

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))
{
if (!_physicsQuery.TryGetComponent(near, out var physics) || physics.BodyStatus != BodyStatus.OnGround)
continue;

if (near == parentUid)
continue;

_storage.TryInsertMaterialEntity(uid, near, uid, storage);
}
}
}
}
12 changes: 12 additions & 0 deletions Resources/Locale/en-US/deltav/paper/paper-misc.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
book-text-lunchbox-generic = Hello Honey!
I've packed your lunch for this shift, I hope you enjoy it!!
Love you so so much,
- Mum.
book-text-lunchbox-healthy = Hello Honey!
I've packed you something healthy for this shift! I hope you enjoy it!!
Love you so so much,
- Mum.
book-text-lunchbox-unhealthy = Hello Honey!
I've packed you something fun for this shift! I hope you enjoy it!!
Love you so so much,
- Mum.
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
id-card-access-level-orders = Orders
id-card-access-level-mantis = Psionic Mantis
id-card-access-level-corpsman = Corpsman
41 changes: 41 additions & 0 deletions Resources/Locale/en-US/deltav/warp-points/warp-points.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
warp-point-evac = Evac
warp-point-shuttle = Shuttle
warp-point-debris = Space Debris
warp-point-ruin = Space Ruin
warp-point-bridge = Bridge
warp-point-vault = Vault
warp-point-sec = Security
warp-point-perma = Perma
warp-point-detective = Detective
warp-point-court = Courtroom
warp-point-medical = Medical
warp-point-morgue = Morgue
warp-point-epistemics = Epistemics
warp-point-logistics = Logistics
warp-point-salvage = Salvage
warp-point-engineering = Engineering
warp-point-singularity = Singularity
warp-point-atmospherics = Atmos
warp-point-hop = HoP
warp-point-kitchen = Kitchen
warp-point-bar = Bar
warp-point-botany = Botany
warp-point-janitor = Janitor
warp-point-reporter = Reporter
warp-point-lawyer = Lawyer
warp-point-ai = AI
warp-point-arrivals = Arrivals
warp-point-evac = Evac
warp-point-cryo = Cryo
warp-point-chapel = Chapel
warp-point-library = Library
warp-point-dorms = Dorms
warp-point-disposals = Disposals
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
magnet-pickup-component-toggle-verb = Toggle magnet
magnet-pickup-component-on-examine-main = The magnet appears to be {$stateText}.
magnet-pickup-component-magnet-on = [color=darkgreen]on[/color]
magnet-pickup-component-magnet-off = [color=darkred]off[/color]
Loading

0 comments on commit 0e88729

Please sign in to comment.