diff --git a/Content.Client/Antag/AntagStatusIconSystem.cs b/Content.Client/Antag/AntagStatusIconSystem.cs index 16c519b886d..c24b116e36b 100644 --- a/Content.Client/Antag/AntagStatusIconSystem.cs +++ b/Content.Client/Antag/AntagStatusIconSystem.cs @@ -25,8 +25,9 @@ public override void Initialize() //start-backmen: antag SubscribeLocalEvent(GetIcon); - SubscribeLocalEvent(GetIcon); - SubscribeLocalEvent(GetIcon); + SubscribeLocalEvent(GetIcon); + SubscribeLocalEvent(GetIcon); + SubscribeLocalEvent(GetIcon); SubscribeLocalEvent(GetIcon); //end-backmen: antag } diff --git a/Content.Client/Backmen/Blob/BlobCarrierSystem.cs b/Content.Client/Backmen/Blob/BlobCarrierSystem.cs index 85e31594609..7342b6de00f 100644 --- a/Content.Client/Backmen/Blob/BlobCarrierSystem.cs +++ b/Content.Client/Backmen/Blob/BlobCarrierSystem.cs @@ -1,4 +1,5 @@ using Content.Shared.Backmen.Blob; +using Content.Shared.Backmen.Blob.Components; namespace Content.Client.Backmen.Blob; diff --git a/Content.Client/Backmen/Blob/BlobChemSwapBoundUserInterface.cs b/Content.Client/Backmen/Blob/BlobChemSwapBoundUserInterface.cs index 5dde1b028a7..cb1e3ec45c5 100644 --- a/Content.Client/Backmen/Blob/BlobChemSwapBoundUserInterface.cs +++ b/Content.Client/Backmen/Blob/BlobChemSwapBoundUserInterface.cs @@ -1,4 +1,5 @@ using Content.Shared.Backmen.Blob; +using Content.Shared.Backmen.Blob.Components; using JetBrains.Annotations; using Robust.Client.GameObjects; diff --git a/Content.Client/Backmen/Blob/BlobChemSwapMenu.xaml.cs b/Content.Client/Backmen/Blob/BlobChemSwapMenu.xaml.cs index e2325d48662..ed3d18bcaa7 100644 --- a/Content.Client/Backmen/Blob/BlobChemSwapMenu.xaml.cs +++ b/Content.Client/Backmen/Blob/BlobChemSwapMenu.xaml.cs @@ -1,6 +1,7 @@ using System.Numerics; using Content.Client.Stylesheets; using Content.Shared.Backmen.Blob; +using Content.Shared.Backmen.Blob.Components; using Robust.Client.AutoGenerated; using Robust.Client.GameObjects; using Robust.Client.UserInterface.Controls; diff --git a/Content.Client/Backmen/Blob/BlobObserverSystem.cs b/Content.Client/Backmen/Blob/BlobObserverSystem.cs index 70228ef0f63..2bad36b7760 100644 --- a/Content.Client/Backmen/Blob/BlobObserverSystem.cs +++ b/Content.Client/Backmen/Blob/BlobObserverSystem.cs @@ -1,5 +1,6 @@ using Content.Shared.Antag; using Content.Shared.Backmen.Blob; +using Content.Shared.Backmen.Blob.Components; using Content.Shared.GameTicking; using Content.Shared.Ghost; using Content.Shared.StatusIcon.Components; @@ -21,6 +22,7 @@ public override void Initialize() SubscribeLocalEvent(OnCanShowBlobIcon); SubscribeLocalEvent(OnCanShowBlobIcon); + SubscribeLocalEvent(OnCanShowBlobIcon); SubscribeNetworkEvent(RoundRestartCleanup); } @@ -38,6 +40,9 @@ private bool CanDisplayIcon(EntityUid? uid, bool visibleToGhost) if (HasComp(uid)) return true; + if (HasComp(uid)) + return true; + if (visibleToGhost && HasComp(uid)) return true; diff --git a/Content.Client/Backmen/Blob/BlobPodSystem.cs b/Content.Client/Backmen/Blob/BlobPodSystem.cs new file mode 100644 index 00000000000..6a240673c47 --- /dev/null +++ b/Content.Client/Backmen/Blob/BlobPodSystem.cs @@ -0,0 +1,13 @@ +using Content.Shared.Backmen.Blob.Components; +using Content.Shared.Backmen.Blob.NPC.BlobPod; + +namespace Content.Client.Backmen.Blob; + +public sealed class BlobPodSystem : SharedBlobPodSystem +{ + public override bool NpcStartZombify(EntityUid uid, EntityUid argsTarget, BlobPodComponent component) + { + // do nothing + return false; + } +} diff --git a/Content.Client/Backmen/LightHandleSystem.cs b/Content.Client/Backmen/LightHandleSystem.cs index 9ad280aa083..b04064d6a3a 100644 --- a/Content.Client/Backmen/LightHandleSystem.cs +++ b/Content.Client/Backmen/LightHandleSystem.cs @@ -1,4 +1,5 @@ using Content.Shared.Backmen.Blob; +using Content.Shared.Backmen.Blob.Components; using Content.Shared.Eye.Blinding.Components; using Content.Shared.Mobs.Components; using Robust.Client.Console; diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs index 847903be067..11f9924d2b0 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs @@ -57,7 +57,7 @@ private void AddAntagVerbs(GetVerbsEvent args) Icon = new SpriteSpecifier.Rsi(new("/Textures/Backmen/Interface/Actions/blob.rsi"), "blobFactory"), Act = () => { - EnsureComp(args.Target).HasMind = HasComp(args.Target); + EnsureComp(args.Target).HasMind = HasComp(args.Target); }, Impact = LogImpact.High, Message = Loc.GetString("admin-verb-text-make-blob"), diff --git a/Content.Server/Backmen/Abilities/Psionics/Abilities/MindSwapPowerSystem.cs b/Content.Server/Backmen/Abilities/Psionics/Abilities/MindSwapPowerSystem.cs index 440dfca2832..7fef4e9772f 100644 --- a/Content.Server/Backmen/Abilities/Psionics/Abilities/MindSwapPowerSystem.cs +++ b/Content.Server/Backmen/Abilities/Psionics/Abilities/MindSwapPowerSystem.cs @@ -11,6 +11,7 @@ using Content.Server.GameTicking; using Content.Shared.Backmen.Abilities.Psionics; using Content.Shared.Backmen.Blob; +using Content.Shared.Backmen.Blob.Components; using Content.Shared.Backmen.Psionics.Events; using Content.Shared.Mind.Components; using Content.Shared.Mindshield.Components; @@ -205,7 +206,7 @@ public bool Swap(EntityUid performer, EntityUid target, bool end = false) return false; } - if (HasComp(target)) + if (HasComp(target) || HasComp(performer)) { _popupSystem.PopupCursor("Ошибка! Ваша цель не стабильна!", performer); return false; diff --git a/Content.Server/Backmen/Blob/BlobCarrierSystem.cs b/Content.Server/Backmen/Blob/BlobCarrierSystem.cs index b94c5555285..955ac023b83 100644 --- a/Content.Server/Backmen/Blob/BlobCarrierSystem.cs +++ b/Content.Server/Backmen/Blob/BlobCarrierSystem.cs @@ -4,6 +4,7 @@ using Content.Server.Ghost.Roles.Components; using Content.Server.Mind; using Content.Shared.Backmen.Blob; +using Content.Shared.Backmen.Blob.Components; using Content.Shared.Mind.Components; using Content.Shared.Mobs; using Content.Shared.Popups; diff --git a/Content.Server/Backmen/Blob/BlobObserverMover.cs b/Content.Server/Backmen/Blob/BlobObserverMover.cs index 1ec7bba406a..be423e225a0 100644 --- a/Content.Server/Backmen/Blob/BlobObserverMover.cs +++ b/Content.Server/Backmen/Blob/BlobObserverMover.cs @@ -2,6 +2,7 @@ using System.Threading.Tasks; using Content.Shared.ActionBlocker; using Content.Shared.Backmen.Blob; +using Content.Shared.Backmen.Blob.Components; using Robust.Shared.CPUJob.JobQueues; using Robust.Shared.Map; using Robust.Shared.Timing; diff --git a/Content.Server/Backmen/Blob/BlobSpawnerSystem.cs b/Content.Server/Backmen/Blob/BlobSpawnerSystem.cs index d84b564501f..8036cfb6c79 100644 --- a/Content.Server/Backmen/Blob/BlobSpawnerSystem.cs +++ b/Content.Server/Backmen/Blob/BlobSpawnerSystem.cs @@ -1,5 +1,6 @@ using Content.Server.Backmen.Blob.Components; using Content.Shared.Backmen.Blob; +using Content.Shared.Backmen.Blob.Components; using Robust.Shared.Map.Components; using Robust.Shared.Player; diff --git a/Content.Server/Backmen/Blob/Components/ZombieBlobComponent.cs b/Content.Server/Backmen/Blob/Components/ZombieBlobComponent.cs deleted file mode 100644 index 8f0176b3519..00000000000 --- a/Content.Server/Backmen/Blob/Components/ZombieBlobComponent.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Content.Shared.Damage; -using Content.Shared.Damage.Prototypes; -using Robust.Shared.Audio; - -namespace Content.Server.Backmen.Blob.Components; - -[RegisterComponent] -public sealed partial class ZombieBlobComponent : Component -{ - public List OldFactions = new(); - - public EntityUid BlobPodUid = default!; - - public float? OldColdDamageThreshold = null; - - [ViewVariables] - public Dictionary DisabledFixtureMasks { get; } = new(); - - [DataField("greetSoundNotification")] - public SoundSpecifier GreetSoundNotification = new SoundPathSpecifier("/Audio/Ambience/Antag/zombie_start.ogg"); - -} diff --git a/Content.Server/Backmen/Blob/NPC/BlobPod/BlobPodSystem.cs b/Content.Server/Backmen/Blob/NPC/BlobPod/BlobPodSystem.cs index 0c05d79a42b..759fbc387e2 100644 --- a/Content.Server/Backmen/Blob/NPC/BlobPod/BlobPodSystem.cs +++ b/Content.Server/Backmen/Blob/NPC/BlobPod/BlobPodSystem.cs @@ -5,17 +5,21 @@ using Content.Server.Popups; using Content.Shared.ActionBlocker; using Content.Shared.Backmen.Blob; +using Content.Shared.Backmen.Blob.Components; using Content.Shared.Backmen.Blob.NPC.BlobPod; using Content.Shared.CombatMode; using Content.Shared.Destructible; using Content.Shared.DoAfter; using Content.Shared.Humanoid; using Content.Shared.Interaction.Components; +using Content.Shared.Interaction.Events; using Content.Shared.Inventory; +using Content.Shared.Inventory.Events; using Content.Shared.Mobs.Systems; using Content.Shared.Rejuvenate; using Content.Shared.Verbs; using Robust.Server.Audio; +using Robust.Shared.Containers; using Robust.Shared.Player; namespace Content.Server.Backmen.Blob.NPC.BlobPod; @@ -29,12 +33,26 @@ public sealed class BlobPodSystem : SharedBlobPodSystem [Dependency] private readonly AudioSystem _audioSystem = default!; [Dependency] private readonly InventorySystem _inventory = default!; [Dependency] private readonly ExplosionSystem _explosionSystem = default!; + public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnZombify); SubscribeLocalEvent(OnDestruction); + SubscribeLocalEvent(OnUnequip); + + } + + private void OnUnequip(Entity ent, ref EntGotRemovedFromContainerMessage args) + { + if(args.Container.ID != "head") + return; + + if (!HasComp(args.Container.Owner) || !HasComp(args.Container.Owner)) + return; + + RemCompDeferred(args.Container.Owner); } private void OnDestruction(EntityUid uid, BlobPodComponent component, DestructionEventArgs args) @@ -71,8 +89,12 @@ private void OnZombify(EntityUid uid, BlobPodComponent component, BlobPodZombify if (!equipped) return; - _popups.PopupEntity(Loc.GetString("blob-mob-zombify-second-end", ("pod", uid)), args.Args.Target.Value, args.Args.Target.Value, Shared.Popups.PopupType.LargeCaution); - _popups.PopupEntity(Loc.GetString("blob-mob-zombify-third-end", ("pod", uid), ("target", args.Args.Target.Value)), args.Args.Target.Value, Filter.PvsExcept(args.Args.Target.Value), true, Shared.Popups.PopupType.LargeCaution); + _popups.PopupEntity(Loc.GetString("blob-mob-zombify-second-end", ("pod", uid)), args.Args.Target.Value, + args.Args.Target.Value, Shared.Popups.PopupType.LargeCaution); + _popups.PopupEntity( + Loc.GetString("blob-mob-zombify-third-end", ("pod", uid), ("target", args.Args.Target.Value)), + args.Args.Target.Value, Filter.PvsExcept(args.Args.Target.Value), true, + Shared.Popups.PopupType.LargeCaution); RemComp(uid); RemComp(uid); @@ -111,8 +133,10 @@ public void StartZombify(EntityUid uid, EntityUid target, BlobPodComponent? comp return; component.ZombifyTarget = target; - _popups.PopupEntity(Loc.GetString("blob-mob-zombify-second-start", ("pod", uid)), target, target, Shared.Popups.PopupType.LargeCaution); - _popups.PopupEntity(Loc.GetString("blob-mob-zombify-third-start", ("pod", uid), ("target", target)), target, Filter.PvsExcept(target), true, Shared.Popups.PopupType.LargeCaution); + _popups.PopupEntity(Loc.GetString("blob-mob-zombify-second-start", ("pod", uid)), target, target, + Shared.Popups.PopupType.LargeCaution); + _popups.PopupEntity(Loc.GetString("blob-mob-zombify-third-start", ("pod", uid), ("target", target)), target, + Filter.PvsExcept(target), true, Shared.Popups.PopupType.LargeCaution); component.ZombifyStingStream = _audioSystem.PlayPvs(component.ZombifySoundPath, target); component.IsZombifying = true; diff --git a/Content.Server/Backmen/Blob/Rule/BlobRuleSystem.cs b/Content.Server/Backmen/Blob/Rule/BlobRuleSystem.cs index 0aed34f6315..007ed7ed8f7 100644 --- a/Content.Server/Backmen/Blob/Rule/BlobRuleSystem.cs +++ b/Content.Server/Backmen/Blob/Rule/BlobRuleSystem.cs @@ -10,6 +10,7 @@ using Content.Shared.Actions; using Content.Shared.Antag; using Content.Shared.Backmen.Blob; +using Content.Shared.Backmen.Blob.Components; using Content.Shared.Backmen.CCVar; using Content.Shared.Humanoid; using Content.Shared.Preferences; diff --git a/Content.Server/Backmen/Blob/ZombieBlobSystem.cs b/Content.Server/Backmen/Blob/ZombieBlobSystem.cs index cf01162f018..6d1bcde6816 100644 --- a/Content.Server/Backmen/Blob/ZombieBlobSystem.cs +++ b/Content.Server/Backmen/Blob/ZombieBlobSystem.cs @@ -5,14 +5,17 @@ using Content.Server.Body.Components; using Content.Server.Body.Systems; using Content.Server.Chat.Managers; +using Content.Server.Explosion.EntitySystems; using Content.Server.Mind; using Content.Server.NPC; using Content.Server.NPC.Components; using Content.Server.NPC.HTN; using Content.Server.NPC.Systems; +using Content.Server.Roles; using Content.Server.Speech.Components; using Content.Server.Temperature.Components; using Content.Shared.Atmos; +using Content.Shared.Backmen.Blob.Components; using Content.Shared.Damage; using Content.Shared.Mind.Components; using Content.Shared.Mobs; @@ -33,6 +36,8 @@ public sealed class ZombieBlobSystem : EntitySystem [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly IChatManager _chatMan = default!; [Dependency] private readonly SharedPhysicsSystem _physics = default!; + [Dependency] private readonly RoleSystem _roleSystem = default!; + [Dependency] private readonly TriggerSystem _trigger = default!; private const int ClimbingCollisionGroup = (int) (CollisionGroup.BlobImpassable); @@ -140,11 +145,22 @@ private void OnStartup(EntityUid uid, ZombieBlobComponent component, ComponentSt } var mindComp = EnsureComp(uid); - if (_mind.TryGetSession(mindComp.Mind, out var session)) + if (mindComp.Mind != null) { - _chatMan.DispatchServerMessage(session, Loc.GetString("blob-zombie-greeting")); - - _audio.PlayGlobal(component.GreetSoundNotification, session); + /* + if (!_roleSystem.MindHasRole(mindComp.Mind.Value)) + { + _roleSystem.MindAddRole(mindComp.Mind.Value, new BlobRoleComponent + { + PrototypeId = "Blob" + }); + } +*/ + if (_mind.TryGetSession(mindComp.Mind, out var session)) + { + _chatMan.DispatchServerMessage(session, Loc.GetString("blob-zombie-greeting")); + _audio.PlayGlobal(component.GreetSoundNotification, session); + } } else { @@ -176,6 +192,14 @@ private void OnShutdown(EntityUid uid, ZombieBlobComponent component, ComponentS _tagSystem.RemoveTag(uid, "BlobMob"); + /* + var mindComp = EnsureComp(uid); + if (mindComp.Mind != null) + { + _roleSystem.MindTryRemoveRole(mindComp.Mind.Value); + } +*/ + _trigger.Trigger(component.BlobPodUid); QueueDel(component.BlobPodUid); EnsureComp(uid); diff --git a/Content.Server/Backmen/GameTicking/Rules/BlobRuleSystem.cs b/Content.Server/Backmen/GameTicking/Rules/BlobRuleSystem.cs index 31c32f2a160..f9424da294b 100644 --- a/Content.Server/Backmen/GameTicking/Rules/BlobRuleSystem.cs +++ b/Content.Server/Backmen/GameTicking/Rules/BlobRuleSystem.cs @@ -14,6 +14,7 @@ using Content.Server.Station.Components; using Content.Server.Station.Systems; using Content.Shared.Backmen.Blob; +using Content.Shared.Backmen.Blob.Components; using Content.Shared.Objectives.Components; using Robust.Shared.Audio; diff --git a/Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/BlobPodZombifyOperator.cs b/Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/BlobPodZombifyOperator.cs index 4690b770891..bd0e785751d 100644 --- a/Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/BlobPodZombifyOperator.cs +++ b/Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/BlobPodZombifyOperator.cs @@ -1,4 +1,5 @@ using Content.Server.Backmen.Blob.NPC.BlobPod; +using Content.Shared.Backmen.Blob.Components; using Content.Shared.Backmen.Blob.NPC.BlobPod; namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Specific; diff --git a/Content.Server/StationEvents/Events/BlobSpawn.cs b/Content.Server/StationEvents/Events/BlobSpawn.cs index e751d089449..220c458210e 100644 --- a/Content.Server/StationEvents/Events/BlobSpawn.cs +++ b/Content.Server/StationEvents/Events/BlobSpawn.cs @@ -6,6 +6,7 @@ using Content.Server.GameTicking.Rules.Components; using Content.Server.Shuttles.Components; using Content.Shared.Backmen.Blob; +using Content.Shared.Backmen.Blob.Components; using Robust.Server.Player; namespace Content.Server.StationEvents.Events; diff --git a/Content.Shared/Backmen/Blob/Components/BlobCarrerComponent.cs b/Content.Shared/Backmen/Blob/Components/BlobCarrerComponent.cs index 910a82551b3..656af1af00c 100644 --- a/Content.Shared/Backmen/Blob/Components/BlobCarrerComponent.cs +++ b/Content.Shared/Backmen/Blob/Components/BlobCarrerComponent.cs @@ -5,7 +5,7 @@ using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; -namespace Content.Shared.Backmen.Blob; +namespace Content.Shared.Backmen.Blob.Components; [RegisterComponent, NetworkedComponent] public sealed partial class BlobCarrierComponent : Component, IAntagStatusIconComponent diff --git a/Content.Shared/Backmen/Blob/Components/BlobCoreComponent.cs b/Content.Shared/Backmen/Blob/Components/BlobCoreComponent.cs index 249dfe1c739..aa2e9f02d49 100644 --- a/Content.Shared/Backmen/Blob/Components/BlobCoreComponent.cs +++ b/Content.Shared/Backmen/Blob/Components/BlobCoreComponent.cs @@ -6,7 +6,7 @@ using Robust.Shared.Serialization; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; -namespace Content.Shared.Backmen.Blob; +namespace Content.Shared.Backmen.Blob.Components; [RegisterComponent] public sealed partial class BlobCoreComponent : Component diff --git a/Content.Shared/Backmen/Blob/Components/BlobObserverComponent.cs b/Content.Shared/Backmen/Blob/Components/BlobObserverComponent.cs index 1dd8c6f76fa..e7977e7e580 100644 --- a/Content.Shared/Backmen/Blob/Components/BlobObserverComponent.cs +++ b/Content.Shared/Backmen/Blob/Components/BlobObserverComponent.cs @@ -7,7 +7,7 @@ using Robust.Shared.Prototypes; using Robust.Shared.Serialization; -namespace Content.Shared.Backmen.Blob; +namespace Content.Shared.Backmen.Blob.Components; [RegisterComponent, NetworkedComponent, AutoGenerateComponentState(false)] public sealed partial class BlobObserverComponent : Component, IAntagStatusIconComponent diff --git a/Content.Shared/Backmen/Blob/Components/BlobPodComponent.cs b/Content.Shared/Backmen/Blob/Components/BlobPodComponent.cs index b64e9f9f7ca..904bb47fc48 100644 --- a/Content.Shared/Backmen/Blob/Components/BlobPodComponent.cs +++ b/Content.Shared/Backmen/Blob/Components/BlobPodComponent.cs @@ -1,32 +1,31 @@ using Robust.Shared.Audio; using Robust.Shared.Audio.Components; +using Robust.Shared.GameStates; -namespace Content.Shared.Backmen.Blob.NPC.BlobPod +namespace Content.Shared.Backmen.Blob.Components; + +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] +public sealed partial class BlobPodComponent : Component { - [RegisterComponent] - public sealed partial class BlobPodComponent : Component - { - [ViewVariables(VVAccess.ReadOnly)] - public bool IsZombifying = false; + [AutoNetworkedField] + [ViewVariables(VVAccess.ReadOnly)] + public bool IsZombifying = false; - [ViewVariables(VVAccess.ReadOnly)] - public EntityUid? ZombifiedEntityUid = default!; + [ViewVariables(VVAccess.ReadOnly)] + public EntityUid? ZombifiedEntityUid = default!; - [ViewVariables(VVAccess.ReadWrite), DataField("zombifyDelay")] - public float ZombifyDelay = 5.00f; + [ViewVariables(VVAccess.ReadWrite), DataField("zombifyDelay")] + public float ZombifyDelay = 5.00f; - [ViewVariables(VVAccess.ReadOnly)] - public EntityUid? Core = null; + [ViewVariables(VVAccess.ReadOnly)] + public EntityUid? Core = null; - [ViewVariables(VVAccess.ReadWrite), DataField("zombifySoundPath")] - public SoundSpecifier ZombifySoundPath = new SoundPathSpecifier("/Audio/Effects/Fluids/blood1.ogg"); + [ViewVariables(VVAccess.ReadWrite), DataField("zombifySoundPath")] + public SoundSpecifier ZombifySoundPath = new SoundPathSpecifier("/Audio/Effects/Fluids/blood1.ogg"); - [ViewVariables(VVAccess.ReadWrite), DataField("zombifyFinishSoundPath")] - public SoundSpecifier ZombifyFinishSoundPath = new SoundPathSpecifier("/Audio/Effects/gib1.ogg"); + [ViewVariables(VVAccess.ReadWrite), DataField("zombifyFinishSoundPath")] + public SoundSpecifier ZombifyFinishSoundPath = new SoundPathSpecifier("/Audio/Effects/gib1.ogg"); - public Entity? ZombifyStingStream; - public EntityUid? ZombifyTarget; - } + public Entity? ZombifyStingStream; + public EntityUid? ZombifyTarget; } - - diff --git a/Content.Shared/Backmen/Blob/Components/SharedBlobbernautComponent.cs b/Content.Shared/Backmen/Blob/Components/SharedBlobbernautComponent.cs deleted file mode 100644 index 02752cee276..00000000000 --- a/Content.Shared/Backmen/Blob/Components/SharedBlobbernautComponent.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Robust.Shared.GameStates; -using Robust.Shared.Serialization; - -namespace Content.Shared.Backmen.Blob; - -[NetworkedComponent] -public abstract partial class SharedBlobbernautComponent : Component -{ - [DataField("color")] - public Color Color = Color.White; -} diff --git a/Content.Shared/Backmen/Blob/Components/ZombieBlobComponent.cs b/Content.Shared/Backmen/Blob/Components/ZombieBlobComponent.cs new file mode 100644 index 00000000000..d29aba2e223 --- /dev/null +++ b/Content.Shared/Backmen/Blob/Components/ZombieBlobComponent.cs @@ -0,0 +1,29 @@ +using Content.Shared.Antag; +using Content.Shared.Damage; +using Content.Shared.Damage.Prototypes; +using Content.Shared.StatusIcon; +using Robust.Shared.Audio; +using Robust.Shared.GameStates; +using Robust.Shared.Prototypes; + +namespace Content.Shared.Backmen.Blob.Components; + +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] +public sealed partial class ZombieBlobComponent : Component, IAntagStatusIconComponent +{ + public List OldFactions = new(); + + [AutoNetworkedField] + public EntityUid BlobPodUid = default!; + + public float? OldColdDamageThreshold = null; + + [ViewVariables] + public Dictionary DisabledFixtureMasks { get; } = new(); + + [DataField("greetSoundNotification")] + public SoundSpecifier GreetSoundNotification = new SoundPathSpecifier("/Audio/Ambience/Antag/zombie_start.ogg"); + + public ProtoId StatusIcon { get; set; } = "BlobFaction"; + public bool IconVisibleToGhost { get; set; } = true; +} diff --git a/Content.Shared/Backmen/Blob/NPC/BlobPod/SharedBlobPodSystem.cs b/Content.Shared/Backmen/Blob/NPC/BlobPod/SharedBlobPodSystem.cs index a06756df600..956802d80a4 100644 --- a/Content.Shared/Backmen/Blob/NPC/BlobPod/SharedBlobPodSystem.cs +++ b/Content.Shared/Backmen/Blob/NPC/BlobPod/SharedBlobPodSystem.cs @@ -1,7 +1,14 @@ -using Content.Shared.DoAfter; +using Content.Shared.Backmen.Blob.Components; +using Content.Shared.DoAfter; +using Content.Shared.DragDrop; +using Content.Shared.Hands.Components; using Content.Shared.Humanoid; +using Content.Shared.Interaction.Events; +using Content.Shared.Inventory.Events; +using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Systems; using Content.Shared.Verbs; +using Robust.Shared.Containers; using Robust.Shared.Serialization; namespace Content.Shared.Backmen.Blob.NPC.BlobPod; @@ -11,15 +18,66 @@ public abstract class SharedBlobPodSystem : EntitySystem [Dependency] private readonly MobStateSystem _mobs = default!; private EntityQuery _query; + public override void Initialize() { base.Initialize(); SubscribeLocalEvent>(AddDrainVerb); + SubscribeLocalEvent(OnUnequipAttempt); + + + SubscribeLocalEvent(OnCanDragDropOn); + SubscribeLocalEvent(OnBlobPodDragDrop); _query = GetEntityQuery(); } + private void OnBlobPodDragDrop(Entity ent, ref DragDropTargetEvent args) + { + if (args.Handled) + return; + + args.Handled = NpcStartZombify(ent, args.Dragged, ent); + } + + private void OnCanDragDropOn(Entity ent, ref CanDropTargetEvent args) + { + if (args.Handled) + return; + if (args.User == args.Dragged) + return; + if (!_query.HasComponent(args.Dragged)) + return; + if (_mobs.IsAlive(args.Dragged)) + return; + + args.CanDrop = true; + if (!HasComp(args.User)) + args.CanDrop = false; + + if (ent.Comp.IsZombifying) + args.CanDrop = false; + + args.Handled = true; + } + + private void OnUnequipAttempt(Entity ent, ref BeingUnequippedAttemptEvent args) + { + if (args.Unequipee == args.UnEquipTarget) + { + args.Cancel(); + return; + } + if (!TryComp(args.UnEquipTarget, out var mobStateComponent)) + return; + if (_mobs.IsDead(args.UnEquipTarget,mobStateComponent) || _mobs.IsCritical(args.UnEquipTarget,mobStateComponent)) + return; + if (!HasComp(args.UnEquipTarget)) + return; + args.Cancel(); + } + private void AddDrainVerb(EntityUid uid, BlobPodComponent component, GetVerbsEvent args) { if (args.User == args.Target) @@ -47,7 +105,6 @@ private void AddDrainVerb(EntityUid uid, BlobPodComponent component, GetVerbsEve public abstract bool NpcStartZombify(EntityUid uid, EntityUid argsTarget, BlobPodComponent component); } - [Serializable, NetSerializable] public sealed partial class BlobPodZombifyDoAfterEvent : SimpleDoAfterEvent { diff --git a/Content.Shared/Backmen/Blob/SharedBlobCarrierSystem.cs b/Content.Shared/Backmen/Blob/SharedBlobCarrierSystem.cs index 4ff752c91b1..2cc663be4f3 100644 --- a/Content.Shared/Backmen/Blob/SharedBlobCarrierSystem.cs +++ b/Content.Shared/Backmen/Blob/SharedBlobCarrierSystem.cs @@ -1,4 +1,5 @@ -using Content.Shared.Popups; +using Content.Shared.Backmen.Blob.Components; +using Content.Shared.Popups; using Robust.Shared.Timing; namespace Content.Shared.Backmen.Blob; diff --git a/Content.Shared/Backmen/Blob/SharedBlobCoreSystem.cs b/Content.Shared/Backmen/Blob/SharedBlobCoreSystem.cs index 7557d9a5dd4..b8fcfc4c917 100644 --- a/Content.Shared/Backmen/Blob/SharedBlobCoreSystem.cs +++ b/Content.Shared/Backmen/Blob/SharedBlobCoreSystem.cs @@ -1,4 +1,5 @@ using Content.Shared.Alert; +using Content.Shared.Backmen.Blob.Components; using Content.Shared.Damage; namespace Content.Shared.Backmen.Blob; diff --git a/Content.Shared/Backmen/Blob/SharedBlobObserverSystem.cs b/Content.Shared/Backmen/Blob/SharedBlobObserverSystem.cs index f991dba63af..3a87ea02e2a 100644 --- a/Content.Shared/Backmen/Blob/SharedBlobObserverSystem.cs +++ b/Content.Shared/Backmen/Blob/SharedBlobObserverSystem.cs @@ -1,4 +1,5 @@ -using Content.Shared.Movement.Events; +using Content.Shared.Backmen.Blob.Components; +using Content.Shared.Movement.Events; namespace Content.Shared.Backmen.Blob;