mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-28 02:57:52 +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)
58 lines
2.1 KiB
C#
58 lines
2.1 KiB
C#
/*using Content.Shared.Body.Organ;
|
|
using Content.Shared.Movement.Systems;
|
|
using Content.Shared.Medical;
|
|
|
|
namespace Content.Shared._Shitmed.Body.Organ;
|
|
|
|
public sealed class HeartSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly MovementSpeedModifierSystem _speedModifier = default!;
|
|
public override void Initialize()
|
|
{
|
|
SubscribeLocalEvent<HeartComponent, ComponentStartup>(OnStartup);
|
|
SubscribeLocalEvent<HeartComponent, OrganDamageChangedEvent>(OnDamageChanged);
|
|
SubscribeLocalEvent<HeartAttackComponent, ComponentStartup>(OnStartup);
|
|
SubscribeLocalEvent<HeartAttackComponent, ComponentShutdown>(OnShutdown);
|
|
SubscribeLocalEvent<HeartAttackComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshSpeed);
|
|
SubscribeLocalEvent<HeartAttackComponent, DefibrillatorZapSuccessEvent>(OnZapSuccess);
|
|
}
|
|
|
|
private void OnStartup(EntityUid uid, HeartComponent component, ComponentStartup args)
|
|
{
|
|
component.CurrentCapacity = component.Capacity;
|
|
}
|
|
|
|
private void OnStartup(EntityUid uid, HeartAttackComponent component, ComponentStartup args)
|
|
{
|
|
component.WalkSpeed *= 0.35f;
|
|
component.SprintSpeed *= 0.35f;
|
|
|
|
_speedModifier.RefreshMovementSpeedModifiers(uid);
|
|
}
|
|
|
|
private void OnShutdown(EntityUid uid, HeartAttackComponent component, ComponentShutdown args)
|
|
{
|
|
component.WalkSpeed /= 0.35f;
|
|
component.SprintSpeed /= 0.35f;
|
|
|
|
_speedModifier.RefreshMovementSpeedModifiers(uid);
|
|
}
|
|
|
|
private void OnRefreshSpeed(EntityUid uid, HeartAttackComponent component, ref RefreshMovementSpeedModifiersEvent args)
|
|
{
|
|
args.ModifySpeed(component.WalkSpeed, component.SprintSpeed);
|
|
}
|
|
|
|
private void OnZapSuccess(EntityUid uid, HeartAttackComponent component, ref DefibrillatorZapSuccessEvent args)
|
|
{
|
|
RemComp<HeartAttackComponent>(uid);
|
|
}
|
|
|
|
private void OnDamageChanged(EntityUid uid, HeartComponent component, ref OrganDamageChangedEvent args)
|
|
{
|
|
if (!TryComp<OrganComponent>(uid, out var organ))
|
|
return;
|
|
|
|
component.CurrentCapacity = component.Capacity * (100 / (int) organ.Status);
|
|
}
|
|
}*/ |