forked from wylab/wylab-station-14
revert: remove unused GolemHeat feature
Wylab doesn't have playable golem species - only hostile Flesh Golems. This code does nothing without the GolemHeatComponent on entities. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
namespace Content.Server._WL.Nutrition.Components;
|
||||
[RegisterComponent]
|
||||
public sealed partial class GolemHeatComponent : Component
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
using Content.Server._WL.Nutrition.Components;
|
||||
using Content.Server.Temperature.Components;
|
||||
using Content.Server.Temperature.Systems;
|
||||
using Content.Shared.Body.Systems;
|
||||
using Content.Shared.Temperature.Components;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.Nutrition.Components;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Content.Server._WL.Nutrition.Systems;
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class GolemHeatSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly IEntitySystemManager _systemManager = default!;
|
||||
[Dependency] private readonly MovementSpeedModifierSystem _movement = default!;
|
||||
[Dependency] private readonly SharedBodySystem _bodySystem = default!;
|
||||
|
||||
private const int HeatChangeAmount = 4000;
|
||||
private const float SprintSpeed = 3.24f;
|
||||
private const float WalkSpeed = 1.8f;
|
||||
private const int Acceleration = 20;
|
||||
|
||||
private void ChangeGolemHeat(EntityUid uid)
|
||||
{
|
||||
if (!_entityManager.TryGetComponent(uid, out HungerComponent? hungerComponent))
|
||||
return;
|
||||
|
||||
if (hungerComponent.CurrentThreshold != HungerThreshold.Overfed)
|
||||
{
|
||||
_bodySystem.UpdateMovementSpeed(uid);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TryComp(uid, out TemperatureComponent? temperatureComponent))
|
||||
return;
|
||||
|
||||
var temperatureSystem = _systemManager.GetEntitySystem<TemperatureSystem>();
|
||||
temperatureSystem.ChangeHeat(uid, HeatChangeAmount, true, temperatureComponent);
|
||||
|
||||
var movementSpeed = EnsureComp<MovementSpeedModifierComponent>(uid);
|
||||
_movement.ChangeBaseSpeed(uid, WalkSpeed, SprintSpeed, Acceleration, movementSpeed);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
base.Update(frameTime);
|
||||
|
||||
var query = EntityQueryEnumerator<GolemHeatComponent>();
|
||||
while (query.MoveNext(out var uid, out var comp))
|
||||
{
|
||||
ChangeGolemHeat(uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user