mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 13:37:47 +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)
29 lines
1.0 KiB
C#
29 lines
1.0 KiB
C#
using Content.Shared.Damage;
|
|
using Content.Shared.Damage.Prototypes;
|
|
using Content.Shared.Mobs.Systems;
|
|
using Robust.Shared.Prototypes;
|
|
namespace Content.Server._Shitmed.DelayedDeath;
|
|
|
|
public partial class DelayedDeathSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly DamageableSystem _damageable = default!;
|
|
[Dependency] private readonly MobStateSystem _mobState = default!;
|
|
[Dependency] private readonly IPrototypeManager _prototypes = default!;
|
|
public override void Update(float frameTime)
|
|
{
|
|
base.Update(frameTime);
|
|
|
|
using var query = EntityQueryEnumerator<DelayedDeathComponent>();
|
|
while (query.MoveNext(out var ent, out var component))
|
|
{
|
|
component.DeathTimer += frameTime;
|
|
|
|
if (component.DeathTimer >= component.DeathTime && !_mobState.IsDead(ent))
|
|
{
|
|
var damage = new DamageSpecifier(_prototypes.Index<DamageTypePrototype>("Bloodloss"), 150);
|
|
_damageable.TryChangeDamage(ent, damage, partMultiplier: 0f);
|
|
}
|
|
}
|
|
}
|
|
}
|