Skip to content

Commit

Permalink
Merge branch 'master' into The-Big-Balance-#1
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDoktorZ authored Dec 16, 2024
2 parents 712ff7b + e3a5b25 commit c01aa45
Show file tree
Hide file tree
Showing 31 changed files with 400 additions and 198 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
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
24 changes: 12 additions & 12 deletions Resources/Locale/en-US/_Nuclear14/job-names.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ job-description-caravan-leader = Coordinate the caravan company in the area and
job-name-caravan-trader = Caravan Trader
job-description-caravan-trader = Conduct trade missions and travel caravan routes to generate profit for the company.
job-name-caravan-guard = Caravan Guard
job-description-caravan-guard = Protect the caravan company traders, their livestock and their inventory.
job-description-caravan-guard = Protect the caravan company traders, their livestock, and their inventory.
# NCR
job-name-ncr-cadet = NCR Cadet
job-description-ncr-cadet = Show your officers that youre ready to become a private of the NCR army.
job-description-ncr-cadet = Prove to the officers that you're ready to become a soldier of the NCR army.
job-name-ncr-medic = NCR Medic
job-description-ncr-medic = Treat the troopers and offer services to the wasteland people.
job-description-ncr-medic = Treat the troops and offer services to the wasteland people.
job-name-ncr-sgt = NCR Sergeant
job-description-ncr-sgt = A non-commissioned officer in the NCR military. Lead a squad to protect the NCRs interests in the region.
job-description-ncr-sgt = A non-commissioned officer in the NCR military. Lead a squad to protect the NCR interests in the region.
job-name-ncr-lt = NCR Lieutenant
job-description-ncr-lt = The local leader of the NCR military. Fulfil your missions by coordinating your military forces in the area. Organise your Sergeants.
job-description-ncr-lt = The local leader of the NCR military. Fulfill your mission by coordinating your military forces in the area. Organise your Sergeants.
job-name-ncr-soldier = NCR Soldier
job-description-ncr-soldier = The backbone of any military. Soldiers get stuff done and follow a Sergeant on missions.
job-name-ncr-engineer = NCR Engineer
Expand Down Expand Up @@ -72,13 +72,13 @@ job-description-tribal-healer = Produce medicines and compounds for the tribe, a
# Vault
job-name-overseer = Vault Overseer
job-description-overseer = Follow Vault Tec's objectives in managing your Vault and ensure everything goes to plan...
job-description-overseer = Follow Vault-Tec's objectives in managing your Vault and ensure everything goes to plan...
job-name-vault-doctor = Vault Doctor
job-description-vault-doctor = Maintain the health and well-being of your fellow Vault Dwellers. Conduct research where necessary.
job-name-vault-dweller = Vault Dweller
job-description-vault-dweller = The general populous of the Vault. Live a comfortable life and pull your own weight where necessary.
job-description-vault-dweller = The general populace of the Vault. Live a comfortable life and pull your own weight where necessary.
job-name-vault-engineer = Vault Engineer
job-description-vault-engineer = Maintain the Vault and all it's vital systems to ensure a comfortable and safe life.
job-description-vault-engineer = Maintain the Vault and all its vital systems to ensure a comfortable and safe life.
job-name-vault-security = Vault Security
job-description-vault-security = Keep order within the Vault and report to the Overseer. For the good of the Vault!
Expand All @@ -94,23 +94,23 @@ job-description-wastelander = Survive in the wasteland and carve out your own pa
# Town
job-name-townsperson = Townsperson
job-description-townsperson = A member of the new world society. Follow the town rules or try run for Mayor to change them.
job-description-townsperson = A member of the post-war society. Follow the town rules or try run for Mayor to change them.
job-name-towndoctor = Town Doctor
job-description-towndoctor = Sell your medical knowledge as a service. Treat the injured for money and manage a doctors practice in town.
job-name-townmechanic = Town Mechanic
job-description-townmechanic = Maintain the towns services and infrastructure and do what you can on the side for others for money.
job-name-townshopkeeper = Town Shopkeeper
job-description-townshopkeeper = Setup shop in town, organise trade partnerships and sell your wares to the wanderes of the wastes. Beware the tax man.
job-description-townshopkeeper = Setup shop in town, organise trade partnerships, and sell your wares to the wanderers of the wastes. Beware the tax man.
job-name-towndeputy = Town Deputy
job-description-towndeputy = Deputy peacekeeper for the town. Keep the peace and provide backup to your Sheriff.
job-name-townsheriff = Town Sheriff
job-description-townsheriff = Maintain law and order within the town and support the Mayor in their rule.
job-name-townmayor = Town Mayor
job-description-townmayor = Maintain civilisation in the town. Set taxes and laws and try not to be thrown out or taken over.
job-name-townreporter = Town Reporter
job-description-townreporter = Interview people and spread the news across the region, or just have a talk show!
job-description-townreporter = Interview people, spread the news across the region, or just have a talk show!
job-name-townbartender = Town Innkeeper
job-description-townbartender = Manage the local bar, kitchen and rooms that are there for renting. Run a business in town!
job-description-townbartender = Manage the local bar, kitchen, and rooms that are there for renting. Run a business in town!
# Followers
job-name-followers = Followers of the Apocalypse
Expand Down
87 changes: 81 additions & 6 deletions Resources/Prototypes/_Nuclear14/Entities/Markers/Spawners/mobs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Passive Animals
#MARK: Passive Animals
- type: entity
name: Brahmin Spawner
id: N14SpawnMobBrahmin
Expand Down Expand Up @@ -59,7 +59,82 @@
prototypes:
- N14MobRadstag

# Hostile Animals
- type: entity
name: Nuclear Beaver Spawner
id: N14SpawnMobNuclearBeaver
parent: MarkerBase
components:
- type: Sprite
layers:
- state: green
- sprite: _Nuclear14/Mobs/Animals/beaver.rsi
state: beaver
- state: ai
- type: ConditionalSpawner
prototypes:
- N14MobNuclearBeaver

- type: entity
name: Nuclear Opossum Spawner
id: N14SpawnMobNuclearOpossum
parent: MarkerBase
components:
- type: Sprite
layers:
- state: green
- sprite: _Nuclear14/Mobs/Animals/opossum.rsi
state: opossum
- state: ai
- type: ConditionalSpawner
prototypes:
- N14MobNuclearOpossum

- type: entity
name: Nuclear Rabbit Spawner
id: N14SpawnMobNuclearRabbit
parent: MarkerBase
components:
- type: Sprite
layers:
- state: green
- sprite: _Nuclear14/Mobs/Animals/rabbit.rsi
state: rabbit
- state: ai
- type: ConditionalSpawner
prototypes:
- N14MobNuclearRabbit

- type: entity
name: Opossum Spawner
id: N14SpawnMobOpossum
parent: MarkerBase
components:
- type: Sprite
layers:
- state: green
- sprite: _Nuclear14/Mobs/Animals/opossum.rsi
state: normopossum
- state: ai
- type: ConditionalSpawner
prototypes:
- N14MobOpossum

- type: entity
name: Normal Rabbit Spawner
id: N14SpawnMobNormRabbit
parent: MarkerBase
components:
- type: Sprite
layers:
- state: green
- sprite: _Nuclear14/Mobs/Animals/rabbit.rsi
state: normrabbit
- state: ai
- type: ConditionalSpawner
prototypes:
- N14MobRabbit

#MARK: Hostile Animals
- type: entity
name: Molerat Spawner
id: N14SpawnMobMolerat
Expand Down Expand Up @@ -210,7 +285,7 @@
prototypes:
- N14MobYaoguai

# Scaley Animals
#MARK: Scaley Animals
- type: entity
name: Deathclaw Spawner
id: N14SpawnMobDeathclaw
Expand Down Expand Up @@ -256,7 +331,7 @@
prototypes:
- N14MobDeathclawMetal

# Insects
#MARK: Insects
- type: entity
name: Bloatfly Spawner
id: N14SpawnMobBloatfly
Expand Down Expand Up @@ -559,7 +634,7 @@
prototypes:
- N14MobRaiderEnforcerMelee

# Ghoul
#MARK: Ghoul
- type: entity
name: Feral Ghoul Spawner
id: N14SpawnMobFeralGhoul
Expand Down Expand Up @@ -620,7 +695,7 @@
prototypes:
- N14MobGhoulMaypole

# Robots
#MARK: Robots
- type: entity
name: Assaultron Spawner
id: N14SpawnMobAssaultron
Expand Down
99 changes: 0 additions & 99 deletions Resources/Prototypes/_Nuclear14/Entities/Mobs/GodHoward

This file was deleted.

Loading

0 comments on commit c01aa45

Please sign in to comment.