Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into 2024-12-27-Tape
  • Loading branch information
dvir001 committed Jan 12, 2025
2 parents 7672df0 + 8b707fd commit f16aec3
Show file tree
Hide file tree
Showing 98 changed files with 3,709 additions and 1,205 deletions.
59 changes: 0 additions & 59 deletions Content.IntegrationTests/Tests/Nyanotrasen/DeepFryerTest.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Content.IntegrationTests/Tests/Round/JobTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Content.IntegrationTests.Tests.Round;
public sealed class JobTest
{
private static readonly ProtoId<JobPrototype> Passenger = "Contractor"; // Frontier: use job prototypes that exist
private static readonly ProtoId<JobPrototype> Engineer = "Pilot"; // Frontier
private static readonly ProtoId<JobPrototype> Engineer = "Prisoner"; // Frontier
private static readonly ProtoId<JobPrototype> Captain = "StationRepresentative"; // Frontier

private static string _map = "JobTestMap";
Expand Down
9 changes: 9 additions & 0 deletions Content.Server/Materials/MaterialStorageSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Content.Shared.Materials;
using Content.Shared.Popups;
using Content.Shared.Stacks;
using Content.Server.Storage.Components; // Frontier
using Content.Server.Power.Components;
using Content.Server.Stack;
using Content.Shared.ActionBlocker;
Expand Down Expand Up @@ -81,6 +82,14 @@ private void OnEjectMessage(EjectMaterialMessage msg, EntitySessionEventArgs arg
if (volume <= 0 || !TryChangeMaterialAmount(uid, msg.Material, -volume))
return;

// Frontier
// If we made it this far, turn off the magnet before spawning materials
if (TryComp<MaterialStorageMagnetPickupComponent>(uid, out var magnet))
{
magnet.MagnetEnabled = false;
}
// end Frontier

var mats = SpawnMultipleFromMaterial(volume, material, Transform(uid).Coordinates, out _);
foreach (var mat in mats.Where(mat => !TerminatingOrDeleted(mat)))
{
Expand Down
39 changes: 30 additions & 9 deletions Content.Server/Medical/HealingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ entity.Comp.DamageContainerID is not null &&
_audio.PlayPvs(healing.HealingEndSound, entity.Owner, AudioHelpers.WithVariation(0.125f, _random).WithVolume(1f));

// Logic to determine the whether or not to repeat the healing action
args.Repeat = (HasDamage(entity.Comp, healing) && !dontRepeat);
args.Repeat = (HasDamage(entity.Owner, entity.Comp, healing) && !dontRepeat); // Frontier: add entity.Owner
if (!args.Repeat && !dontRepeat)
_popupSystem.PopupEntity(Loc.GetString("medical-item-finished-using", ("item", args.Used)), entity.Owner, args.User);
args.Handled = true;
}

private bool HasDamage(DamageableComponent component, HealingComponent healing)
private bool HasDamage(EntityUid target, DamageableComponent component, HealingComponent healing)
{
var damageableDict = component.Damage.DamageDict;
var healingDict = healing.Damage.DamageDict;
Expand All @@ -133,6 +133,25 @@ private bool HasDamage(DamageableComponent component, HealingComponent healing)
}
}

// Frontier: check if this healing item can restore the target's blood or staunch their bleeding
var hasBloodstream = TryComp<BloodstreamComponent>(target, out var bloodstream);

if (healing.ModifyBloodLevel > 0
&& hasBloodstream
&& _solutionContainerSystem.ResolveSolution(target, bloodstream!.BloodSolutionName, ref bloodstream.BloodSolution, out var bloodSolution)
&& bloodSolution.Volume < bloodSolution.MaxVolume)
{
return true;
}

if (healing.BloodlossModifier < 0
&& hasBloodstream
&& bloodstream!.BleedAmount > 0)
{
return true;
}
// End Frontier

return false;
}

Expand Down Expand Up @@ -172,14 +191,16 @@ targetDamage.DamageContainerID is not null &&
if (TryComp<StackComponent>(uid, out var stack) && stack.Count < 1)
return false;

var anythingToDo =
HasDamage(targetDamage, component) ||
component.ModifyBloodLevel > 0 // Special case if healing item can restore lost blood...
&& TryComp<BloodstreamComponent>(target, out var bloodstream)
&& _solutionContainerSystem.ResolveSolution(target, bloodstream.BloodSolutionName, ref bloodstream.BloodSolution, out var bloodSolution)
&& bloodSolution.Volume < bloodSolution.MaxVolume; // ...and there is lost blood to restore.
// Frontier: extra conditions moved into HasDamage
// var anythingToDo =
// HasDamage(targetDamage, component) ||
// component.ModifyBloodLevel > 0 // Special case if healing item can restore lost blood...
// && TryComp<BloodstreamComponent>(target, out var bloodstream)
// && _solutionContainerSystem.ResolveSolution(target, bloodstream.BloodSolutionName, ref bloodstream.BloodSolution, out var bloodSolution)
// && bloodSolution.Volume < bloodSolution.MaxVolume; // ...and there is lost blood to restore.
// End Frontier

if (!anythingToDo)
if (!HasDamage(target, targetDamage, component)) // Frontier: anythingToDo<!HasDamage
{
_popupSystem.PopupEntity(Loc.GetString("medical-item-cant-use", ("item", uid)), uid, user);
return false;
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Worldgen/Systems/LocalityLoaderSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private void OnDebrisDespawn(EntityUid entity, SpaceDebrisComponent component, E
}

// Do not delete the grid, it is being deleted.
_linkedLifecycleGrid.UnparentPlayersFromGrid(entity, false);
_linkedLifecycleGrid.UnparentPlayersFromGrid(grid: entity, deleteGrid: false, ignoreLifeStage: true);
}
}
// Frontier
Expand Down
44 changes: 44 additions & 0 deletions Content.Server/_NF/Construction/Conditions/NFStrapEmpty.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using Content.Shared.Construction;
using JetBrains.Annotations;
using Content.Shared.Examine;
using Content.Shared.Buckle.Components;

namespace Content.Server.Construction.Conditions;

[UsedImplicitly]
[DataDefinition]
public sealed partial class NFStrapEmpty : IGraphCondition
{
public bool Condition(EntityUid uid, IEntityManager entityManager)
{
if (!entityManager.TryGetComponent(uid, out StrapComponent? strap))
return true; // No strap, nothing can be buckled.

return strap.BuckledEntities.Count == 0;
}

public bool DoExamine(ExaminedEvent args)
{
var entity = args.Examined;

var entMan = IoCManager.Resolve<IEntityManager>();

if (!entMan.TryGetComponent(entity, out StrapComponent? strap)) return false;

if (strap.BuckledEntities.Count > 0)
{
args.PushMarkup(Loc.GetString("construction-examine-condition-nf-strap-empty", ("entityName", entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
return true;
}

return false;
}

public IEnumerable<ConstructionGuideEntry> GenerateGuideEntry()
{
yield return new ConstructionGuideEntry()
{
Localization = "construction-step-condition-nf-strap-empty"
};
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
using System.Numerics;
using Content.Server.StationEvents.Components;
using Content.Shared.Buckle.Components;
using Content.Shared.Humanoid;
using Content.Shared.Mech.Components;
using Content.Shared.Mind;
using Content.Shared.Mind.Components;
using Content.Shared.Mobs.Components;
using Content.Shared.Silicons.Borgs.Components;
using Content.Shared.Vehicle.Components;
using Robust.Shared.Map;
using Robust.Shared.Player;

namespace Content.Server.StationEvents.Events;

Expand Down Expand Up @@ -106,6 +107,20 @@ private void OnMasterRemoved(EntityUid uid, LinkedLifecycleGridParentComponent c
reparentEntities.Add(((targetUid, targetXform), targetXform.MapUid!.Value, _transform.GetWorldPosition(targetXform)));
}

// Get silicon
var borgQuery = AllEntityQuery<BorgChassisComponent, ActorComponent, TransformComponent>();
while (borgQuery.MoveNext(out var borgUid, out _, out _, out var xform))
{
handledEntities.Add(borgUid);

if (xform.GridUid == null || xform.MapUid == null || xform.GridUid != grid)
continue;

var (targetUid, targetXform) = GetParentToReparent(borgUid, xform);

reparentEntities.Add(((targetUid, targetXform), targetXform.MapUid!.Value, _transform.GetWorldPosition(targetXform)));
}

// Get occupied MindContainers
var mindQuery = AllEntityQuery<MindContainerComponent, TransformComponent>();
while (mindQuery.MoveNext(out var mobUid, out var mindContainer, out var xform))
Expand All @@ -130,9 +145,9 @@ private void OnMasterRemoved(EntityUid uid, LinkedLifecycleGridParentComponent c
}

// Deletes a grid, reparenting every humanoid and player character that's on it.
public void UnparentPlayersFromGrid(EntityUid grid, bool deleteGrid)
public void UnparentPlayersFromGrid(EntityUid grid, bool deleteGrid, bool ignoreLifeStage = false)
{
if (MetaData(grid).EntityLifeStage >= EntityLifeStage.Terminating)
if (!ignoreLifeStage && MetaData(grid).EntityLifeStage >= EntityLifeStage.Terminating)
return;

var reparentEntities = GetEntitiesToReparent(grid);
Expand Down
10 changes: 10 additions & 0 deletions Resources/Audio/_NF/Jukebox/attributions.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
- 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"

- files: ["lateraligator.ogg"]
license: "CC-BY-3.0"
copyright: "Later Alligator By Silverman Sound Studios. Converted to mono OGG."
Expand Down
Binary file added Resources/Audio/_NF/Jukebox/shibamata.ogg
Binary file not shown.
Binary file added Resources/Audio/_NF/Jukebox/victory.ogg
Binary file not shown.
9 changes: 0 additions & 9 deletions Resources/Audio/_NF/Lobby/attributions.yml

This file was deleted.

Binary file removed Resources/Audio/_NF/Lobby/shibamata.ogg
Binary file not shown.
Binary file removed Resources/Audio/_NF/Lobby/victory.ogg
Binary file not shown.
Loading

0 comments on commit f16aec3

Please sign in to comment.