mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-19 06:28:40 +03:00
Lots of stuff. Also moved everything I could to the _Shitmed namespace
as I do in Goob. Will make future ports way faster
# Changelog
🆑 Mocho
- add: Added some fun organs and other thingies, check out the Goob PRs
if you want more details.
- fix: Fixed tons of issues with shitmed. Too many for the changelog in
fact.
(cherry picked from commit 3c9db94102cb25b28a83d51ac8d659fa31fe7d12)
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using Content.Shared.Body.Organ;
|
|
using Content.Shared.StatusEffect;
|
|
using Robust.Shared.Timing;
|
|
|
|
namespace Content.Server._Shitmed.Body.Organ;
|
|
|
|
public sealed class StatusEffectOrganSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly IGameTiming _timing = default!;
|
|
[Dependency] private readonly StatusEffectsSystem _effects = default!;
|
|
|
|
public override void Update(float frameTime)
|
|
{
|
|
base.Update(frameTime);
|
|
|
|
var query = EntityQueryEnumerator<StatusEffectOrganComponent, OrganComponent>();
|
|
var now = _timing.CurTime;
|
|
while (query.MoveNext(out var uid, out var comp, out var organ))
|
|
{
|
|
if (now < comp.NextUpdate || organ.Body is not {} body)
|
|
continue;
|
|
|
|
comp.NextUpdate = now + comp.Delay;
|
|
if (!TryComp<StatusEffectsComponent>(body, out var effects))
|
|
continue;
|
|
|
|
foreach (var (key, component) in comp.Refresh)
|
|
{
|
|
_effects.TryAddStatusEffect(body, key, comp.Delay, refresh: true, component, effects);
|
|
}
|
|
}
|
|
}
|
|
}
|