diff --git a/Content.Client/Zombies/ZombieSystem.cs b/Content.Client/Zombies/ZombieSystem.cs new file mode 100644 index 0000000000..eb45d86003 --- /dev/null +++ b/Content.Client/Zombies/ZombieSystem.cs @@ -0,0 +1,8 @@ +using Content.Shared.Zombies; + +namespace Content.Client.Zombies; + +public sealed class ZombieSystem : SharedZombieSystem +{ + +} diff --git a/Content.Server/Zombies/ZombieSystem.cs b/Content.Server/Zombies/ZombieSystem.cs index 458894eb9f..22f591bdcd 100644 --- a/Content.Server/Zombies/ZombieSystem.cs +++ b/Content.Server/Zombies/ZombieSystem.cs @@ -13,12 +13,12 @@ using Content.Server.Inventory; using Robust.Shared.Prototypes; using Content.Server.Speech; using Content.Server.Chat.Systems; -using Content.Shared.Movement.Systems; using Content.Shared.Damage; +using Content.Shared.Zombies; namespace Content.Server.Zombies { - public sealed class ZombieSystem : EntitySystem + public sealed class ZombieSystem : SharedZombieSystem { [Dependency] private readonly DiseaseSystem _disease = default!; [Dependency] private readonly BloodstreamSystem _bloodstream = default!; @@ -36,7 +36,7 @@ namespace Content.Server.Zombies SubscribeLocalEvent(OnMeleeHit); SubscribeLocalEvent(OnMobState); SubscribeLocalEvent(OnDamage); - SubscribeLocalEvent(OnRefreshSpeed); + } private void OnMobState(EntityUid uid, ZombieComponent component, MobStateChangedEvent args) @@ -53,12 +53,6 @@ namespace Content.Server.Zombies DoGroan(uid, component); } - private void OnRefreshSpeed(EntityUid uid, ZombieComponent component, RefreshMovementSpeedModifiersEvent args) - { - var mod = component.ZombieMovementSpeedDebuff; - args.ModifySpeed(mod, mod); - } - private float GetZombieInfectionChance(EntityUid uid, ZombieComponent component) { var baseChance = component.MaxZombieInfectionChance; diff --git a/Content.Shared/Zombies/SharedZombieSystem.cs b/Content.Shared/Zombies/SharedZombieSystem.cs new file mode 100644 index 0000000000..6d9103639f --- /dev/null +++ b/Content.Shared/Zombies/SharedZombieSystem.cs @@ -0,0 +1,20 @@ +using Content.Shared.Movement.Systems; + +namespace Content.Shared.Zombies; + +public abstract class SharedZombieSystem : EntitySystem +{ + /// + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnRefreshSpeed); + } + + private void OnRefreshSpeed(EntityUid uid, ZombieComponent component, RefreshMovementSpeedModifiersEvent args) + { + var mod = component.ZombieMovementSpeedDebuff; + args.ModifySpeed(mod, mod); + } +} diff --git a/Content.Server/Zombies/ZombieComponent.cs b/Content.Shared/Zombies/ZombieComponent.cs similarity index 94% rename from Content.Server/Zombies/ZombieComponent.cs rename to Content.Shared/Zombies/ZombieComponent.cs index c762af82f5..5bae7cea84 100644 --- a/Content.Server/Zombies/ZombieComponent.cs +++ b/Content.Shared/Zombies/ZombieComponent.cs @@ -1,10 +1,11 @@ using Content.Shared.Roles; using Content.Shared.Weapons.Melee; +using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; -namespace Content.Server.Zombies +namespace Content.Shared.Zombies { - [RegisterComponent] + [RegisterComponent, NetworkedComponent] public sealed class ZombieComponent : Component { ///