Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ReginaeSpence committed Jan 7, 2025
2 parents 6d63ae8 + a5cc8b7 commit ed0d154
Show file tree
Hide file tree
Showing 110 changed files with 401,425 additions and 645,394 deletions.
2 changes: 1 addition & 1 deletion Content.Server/Body/Systems/MetabolizerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public override void Initialize()

private void OnMapInit(Entity<MetabolizerComponent> ent, ref MapInitEvent args)
{
ent.Comp.NextUpdate = _gameTiming.CurTime + ent.Comp.UpdateInterval;
ent.Comp.NextUpdate = _gameTiming.CurTime + ent.Comp.UpdateInterval * (1+_random.NextFloat());
}

private void OnUnpaused(Entity<MetabolizerComponent> ent, ref EntityUnpausedEvent args)
Expand Down
4 changes: 3 additions & 1 deletion Content.Server/Body/Systems/StomachSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
using Content.Shared.Chemistry.Components.SolutionManager;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Robust.Shared.Random;

namespace Content.Server.Body.Systems
{
public sealed class StomachSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
[Dependency] private readonly IRobustRandom _random = default!;

public const string DefaultSolutionName = "stomach";

Expand All @@ -24,7 +26,7 @@ public override void Initialize()

private void OnMapInit(Entity<StomachComponent> ent, ref MapInitEvent args)
{
ent.Comp.NextUpdate = _gameTiming.CurTime + ent.Comp.UpdateInterval;
ent.Comp.NextUpdate = _gameTiming.CurTime + ent.Comp.UpdateInterval * (1+_random.NextFloat());
}

private void OnUnpaused(Entity<StomachComponent> ent, ref EntityUnpausedEvent args)
Expand Down
26 changes: 15 additions & 11 deletions Content.Server/Fluids/EntitySystems/DrainSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,20 @@ public sealed class DrainSystem : SharedDrainSystem
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;

private float DrainRunPeriod = 1f; // 1 second to make multiplying by DrainFrequency correct
private float Accumulator;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<DrainComponent, GetVerbsEvent<Verb>>(AddEmptyVerb);
SubscribeLocalEvent<DrainComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<DrainComponent, AfterInteractUsingEvent>(OnInteract);
SubscribeLocalEvent<DrainComponent, DrainDoAfterEvent>(OnDoAfter);
SubscribeLocalEvent<DrainComponent, ComponentInit>(OnComponentInit);
}

private void OnComponentInit(EntityUid uid, DrainComponent component, ComponentInit args)
{
// Randomize accumulator on init to try to spread out all drain updates as much as possible.
component.Accumulator = _random.NextFloat() * component.DrainFrequency;
}

private void AddEmptyVerb(Entity<DrainComponent> entity, ref GetVerbsEvent<Verb> args)
Expand Down Expand Up @@ -111,14 +115,7 @@ private void Empty(EntityUid container, SpillableComponent spillable, EntityUid

public override void Update(float frameTime)
{
Accumulator += frameTime;
if (Accumulator < DrainRunPeriod)
{
return;
}
Accumulator -= DrainRunPeriod;

base.Update(DrainRunPeriod);
base.Update(frameTime);
var managerQuery = GetEntityQuery<SolutionContainerManagerComponent>();
var xformQuery = GetEntityQuery<TransformComponent>();
var puddleQuery = GetEntityQuery<PuddleComponent>();
Expand All @@ -127,6 +124,13 @@ public override void Update(float frameTime)
var query = EntityQueryEnumerator<DrainComponent>();
while (query.MoveNext(out var uid, out var drain))
{
drain.Accumulator += frameTime;
if (drain.Accumulator < drain.DrainFrequency)
{
continue;
}
drain.Accumulator -= drain.DrainFrequency;

// Disable ambient sound from emptying manually
if (!drain.AutoDrain)
{
Expand Down
7 changes: 6 additions & 1 deletion Resources/Audio/_Nuclear14/Effects/attributions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
- files: ["UI_Pipboy_Radio_On.ogg", "UI_Quest_Update.ogg", "UI_QuestNew.ogg"]
license: "CC-BY-NC-SA-3.0"
copyright: "Bethesda Softworks, from fallout 4. Converted from WAV to OGG. License unconfirmed Fair use?"
source: "https://www.youtube.com/watch?v=xTvducynPKQ"
source: "https://www.youtube.com/watch?v=xTvducynPKQ"

- files: ["open_gift.ogg"]
license: "CC-BY-NC-SA-4.0"
copyright: "Taken from zvukipro.com . Converted from mp3 to OGG Mr_Lop_Lop. Custom license."
source: "https://zvukipro.com/predmet/1308-zvuki-podarka.html"
Binary file added Resources/Audio/_Nuclear14/Effects/open_gift.ogg
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions Resources/Audio/_Nuclear14/Lobby/attributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@
license: "CC-BY-NC-SA-4.0"
copyright: "Copyright owned by respective artists, see source link for details."
source: "https://fallout.fandom.com/wiki/Fallout:_New_Vegas_soundtrack"

- files: ["Frank-Sinatra-Jingle-Bells.ogg"]
license: "Custom"
copyright: "Copyright owned by respective artists, see source link for details."
source: "https://www.youtube.com/watch?v=hLf0-lro8X8"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
special-appearance-component-examine-charisma-very-low = { CAPITALIZE(SUBJECT($user)) } seems repulsive.
special-appearance-component-examine-charisma-low = { CAPITALIZE(SUBJECT($user)) } seems awkward.
special-appearance-component-examine-charisma-medium = { CAPITALIZE(SUBJECT($user)) } seems normal.
special-appearance-component-examine-charisma-high = { CAPITALIZE(SUBJECT($user)) } seem approachable.
special-appearance-component-examine-charisma-high = { CAPITALIZE(SUBJECT($user)) } seems approachable.
special-appearance-component-examine-charisma-very-high = { CAPITALIZE(SUBJECT($user)) } seems suave.
# Examine all special modifiers
Expand Down
Loading

0 comments on commit ed0d154

Please sign in to comment.