Skip to content

Commit

Permalink
Merge branch 'master' into 2024-12-01-Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheackraze authored Jan 12, 2025
2 parents 562c18f + cf73ba9 commit 478086f
Show file tree
Hide file tree
Showing 63 changed files with 2,867 additions and 896 deletions.
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
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
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 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.
54 changes: 54 additions & 0 deletions Resources/Changelog/Frontier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6304,3 +6304,57 @@ Entries:
message: Accentless now works on goblins.
id: 5641
time: '2025-01-10T11:01:45.0000000+00:00'
- author: dvir001
changes:
- type: Tweak
message: Moved Victory and Shibamata from the lobby music to the jukebox.
id: 5642
time: '2025-01-10T17:58:03.0000000+00:00'
- author: blackknight954
changes:
- type: Add
message: Added shotgun slugs and rubber magazines to the NFSD and Mercfabs
id: 5643
time: '2025-01-10T21:16:43.0000000+00:00'
- author: dustylens
changes:
- type: Add
message: New ramen dishes from Umami! (Sometimes the SR)
id: 5644
time: '2025-01-10T21:48:51.0000000+00:00'
- author: MagnusCrowe
changes:
- type: Add
message: Added monkey and kobold cubes to loadout under tools.
id: 5645
time: '2025-01-10T21:50:07.0000000+00:00'
- author: Alkheemist
changes:
- type: Fix
message: >-
Trade mall has had a new solar array fitted, power should be more
consistent now.
id: 5646
time: '2025-01-11T08:22:27.0000000+00:00'
- author: dvir001
changes:
- type: Fix
message: >-
Player controlled borgs no longer get deleted on event grids when they
end.
id: 5647
time: '2025-01-11T15:50:26.0000000+00:00'
- author: dvir001
changes:
- type: Fix
message: Paladin NFSD Shuttle locker isn't locked to detective only anymore.
id: 5648
time: '2025-01-11T16:10:51.0000000+00:00'
- author: whatston3
changes:
- type: Add
message: >-
Blood restoring/hemostatic items can be used even if the user isn't
damaged.
id: 5649
time: '2025-01-12T12:28:48.0000000+00:00'
3 changes: 3 additions & 0 deletions Resources/Locale/en-US/_NF/flavors/flavor-profiles.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ flavor-complex-blast = like jungle warfare
flavor-complex-torpedo = like convoy raiding
flavor-complex-bees = like buzzing and honey
flavor-complex-wassail = warm and comforting
flavor-complex-fine-noodles = like fine noodles
flavor-complex-rich-broth = rich broth
flavor-complex-tangy = tangy
Loading

0 comments on commit 478086f

Please sign in to comment.