Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Rxup committed Mar 5, 2024
1 parent 14562f2 commit 56d6e9e
Show file tree
Hide file tree
Showing 29 changed files with 207 additions and 73 deletions.
5 changes: 3 additions & 2 deletions Content.Client/Antag/AntagStatusIconSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ public override void Initialize()

//start-backmen: antag
SubscribeLocalEvent<Shared.Backmen.Flesh.FleshCultistComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<Shared.Backmen.Blob.BlobObserverComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<Shared.Backmen.Blob.BlobCarrierComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<Shared.Backmen.Blob.Components.BlobObserverComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<Shared.Backmen.Blob.Components.BlobCarrierComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<Shared.Backmen.Blob.Components.ZombieBlobComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<Shared.Backmen.Vampiric.BkmVampireComponent, GetStatusIconsEvent>(GetIcon);
//end-backmen: antag
}
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Backmen/Blob/BlobCarrierSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Shared.Backmen.Blob;
using Content.Shared.Backmen.Blob.Components;

namespace Content.Client.Backmen.Blob;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Shared.Backmen.Blob;
using Content.Shared.Backmen.Blob.Components;
using JetBrains.Annotations;
using Robust.Client.GameObjects;

Expand Down
1 change: 1 addition & 0 deletions Content.Client/Backmen/Blob/BlobChemSwapMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 5 additions & 0 deletions Content.Client/Backmen/Blob/BlobObserverSystem.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -21,6 +22,7 @@ public override void Initialize()

SubscribeLocalEvent<BlobCarrierComponent, CanDisplayStatusIconsEvent>(OnCanShowBlobIcon);
SubscribeLocalEvent<BlobObserverComponent, CanDisplayStatusIconsEvent>(OnCanShowBlobIcon);
SubscribeLocalEvent<ZombieBlobComponent, CanDisplayStatusIconsEvent>(OnCanShowBlobIcon);

SubscribeNetworkEvent<RoundRestartCleanupEvent>(RoundRestartCleanup);
}
Expand All @@ -38,6 +40,9 @@ private bool CanDisplayIcon(EntityUid? uid, bool visibleToGhost)
if (HasComp<BlobCarrierComponent>(uid))
return true;

if (HasComp<ZombieBlobComponent>(uid))
return true;

if (visibleToGhost && HasComp<GhostComponent>(uid))
return true;

Expand Down
13 changes: 13 additions & 0 deletions Content.Client/Backmen/Blob/BlobPodSystem.cs
Original file line number Diff line number Diff line change
@@ -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;
}
}
1 change: 1 addition & 0 deletions Content.Client/Backmen/LightHandleSystem.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private void AddAntagVerbs(GetVerbsEvent<Verb> args)
Icon = new SpriteSpecifier.Rsi(new("/Textures/Backmen/Interface/Actions/blob.rsi"), "blobFactory"),
Act = () =>
{
EnsureComp<Shared.Backmen.Blob.BlobCarrierComponent>(args.Target).HasMind = HasComp<ActorComponent>(args.Target);
EnsureComp<Shared.Backmen.Blob.Components.BlobCarrierComponent>(args.Target).HasMind = HasComp<ActorComponent>(args.Target);
},
Impact = LogImpact.High,
Message = Loc.GetString("admin-verb-text-make-blob"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -205,7 +206,7 @@ public bool Swap(EntityUid performer, EntityUid target, bool end = false)
return false;
}

if (HasComp<BlobCarrierComponent>(target))
if (HasComp<BlobCarrierComponent>(target) || HasComp<BlobCarrierComponent>(performer))
{
_popupSystem.PopupCursor("Ошибка! Ваша цель не стабильна!", performer);
return false;
Expand Down
1 change: 1 addition & 0 deletions Content.Server/Backmen/Blob/BlobCarrierSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions Content.Server/Backmen/Blob/BlobObserverMover.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions Content.Server/Backmen/Blob/BlobSpawnerSystem.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
22 changes: 0 additions & 22 deletions Content.Server/Backmen/Blob/Components/ZombieBlobComponent.cs

This file was deleted.

32 changes: 28 additions & 4 deletions Content.Server/Backmen/Blob/NPC/BlobPod/BlobPodSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<BlobPodComponent, BlobPodZombifyDoAfterEvent>(OnZombify);
SubscribeLocalEvent<BlobPodComponent, DestructionEventArgs>(OnDestruction);
SubscribeLocalEvent<BlobPodComponent, EntGotRemovedFromContainerMessage>(OnUnequip);

}

private void OnUnequip(Entity<BlobPodComponent> ent, ref EntGotRemovedFromContainerMessage args)
{
if(args.Container.ID != "head")
return;

if (!HasComp<HumanoidAppearanceComponent>(args.Container.Owner) || !HasComp<ZombieBlobComponent>(args.Container.Owner))
return;

RemCompDeferred<ZombieBlobComponent>(args.Container.Owner);
}

private void OnDestruction(EntityUid uid, BlobPodComponent component, DestructionEventArgs args)
Expand Down Expand Up @@ -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<CombatModeComponent>(uid);
RemComp<HTNComponent>(uid);
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions Content.Server/Backmen/Blob/Rule/BlobRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
32 changes: 28 additions & 4 deletions Content.Server/Backmen/Blob/ZombieBlobSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand Down Expand Up @@ -140,11 +145,22 @@ private void OnStartup(EntityUid uid, ZombieBlobComponent component, ComponentSt
}

var mindComp = EnsureComp<MindContainerComponent>(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<BlobRoleComponent>(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
{
Expand Down Expand Up @@ -176,6 +192,14 @@ private void OnShutdown(EntityUid uid, ZombieBlobComponent component, ComponentS

_tagSystem.RemoveTag(uid, "BlobMob");

/*
var mindComp = EnsureComp<MindContainerComponent>(uid);
if (mindComp.Mind != null)
{
_roleSystem.MindTryRemoveRole<BlobRoleComponent>(mindComp.Mind.Value);
}
*/
_trigger.Trigger(component.BlobPodUid);
QueueDel(component.BlobPodUid);

EnsureComp<NpcFactionMemberComponent>(uid);
Expand Down
1 change: 1 addition & 0 deletions Content.Server/Backmen/GameTicking/Rules/BlobRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 1 addition & 0 deletions Content.Server/StationEvents/Events/BlobSpawn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 56d6e9e

Please sign in to comment.