From 78a06c85355c620b8753ea3f59424fa70c6636b1 Mon Sep 17 00:00:00 2001 From: Zack Backmen Date: Mon, 18 Mar 2024 19:10:21 +0300 Subject: [PATCH] fix --- .../PsionicRegenerationPowerSystem.cs | 3 +- .../Backmen/Arachne/ArachneSystem.cs | 11 ++++--- .../Backmen/Blob/ZombieBlobSystem.cs | 4 ++- .../Backmen/Fugitive/FugitiveSystem.cs | 4 ++- .../Invisbility/PsionicInvisibilitySystem.cs | 29 ++++++++++++++----- .../ShadowkinDarkSwapPowerComponent.cs | 1 + .../Systems/ShadowkinPowerSystem.DarkSwap.cs | 2 +- .../Events/GlimmerWispSpawnRule.cs | 1 + .../Objects/Misc/spider_web_arache.yml | 4 +-- .../Structures/Webbing/Webbing/webs.yml | 2 +- 10 files changed, 42 insertions(+), 19 deletions(-) diff --git a/Content.Server/Backmen/Abilities/Psionics/Abilities/PsionicRegenerationPowerSystem.cs b/Content.Server/Backmen/Abilities/Psionics/Abilities/PsionicRegenerationPowerSystem.cs index 3a0c3f7074b..2ece17bf9d5 100644 --- a/Content.Server/Backmen/Abilities/Psionics/Abilities/PsionicRegenerationPowerSystem.cs +++ b/Content.Server/Backmen/Abilities/Psionics/Abilities/PsionicRegenerationPowerSystem.cs @@ -27,6 +27,7 @@ public sealed class PsionicRegenerationPowerSystem : EntitySystem [Dependency] private readonly SharedPopupSystem _popupSystem = default!; [Dependency] private readonly SharedPsionicAbilitiesSystem _psionics = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private readonly ExamineSystemShared _examine = default!; public override void Initialize() @@ -66,7 +67,7 @@ private void OnPowerUsed(EntityUid uid, PsionicRegenerationPowerComponent compon _popupSystem.PopupEntity(Loc.GetString("psionic-regeneration-begin", ("entity", uid)), uid, // TODO: Use LoS-based Filter when one is available. - Filter.Pvs(uid).RemoveWhereAttachedEntity(entity => !ExamineSystemShared.InRangeUnOccluded(uid, entity, ExamineRange, null)), + Filter.Pvs(uid).RemoveWhereAttachedEntity(entity => !_examine.InRangeUnOccluded(uid, entity, ExamineRange, null)), true, PopupType.Medium); diff --git a/Content.Server/Backmen/Arachne/ArachneSystem.cs b/Content.Server/Backmen/Arachne/ArachneSystem.cs index 49f04c55c83..e32a0a3fe7e 100644 --- a/Content.Server/Backmen/Arachne/ArachneSystem.cs +++ b/Content.Server/Backmen/Arachne/ArachneSystem.cs @@ -56,6 +56,8 @@ public sealed class ArachneSystem : EntitySystem [Dependency] private readonly InventorySystem _inventorySystem = default!; [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!; [Dependency] private readonly SharedContainerSystem _containerSystem = default!; + [Dependency] private readonly ExamineSystemShared _examine = default!; + private const string BodySlot = "body_slot"; @@ -126,7 +128,8 @@ private void OnCocEntInserted(EntityUid uid, CocoonComponent component, EntInser component.WasReplacementAccent = true; component.OldAccent = currentAccent.Accent; currentAccent.Accent = "mumble"; - } else + } + else { component.WasReplacementAccent = false; var replacement = EnsureComp(args.Entity); @@ -251,7 +254,7 @@ private void OnSpinWeb(SpinWebActionEvent args) } _popupSystem.PopupEntity(Loc.GetString("spin-web-start-third-person", ("spider", Identity.Entity(args.Performer, EntityManager))), args.Performer, - Filter.PvsExcept(args.Performer).RemoveWhereAttachedEntity(entity => !ExamineSystemShared.InRangeUnOccluded(args.Performer, entity, ExamineRange, null)), + Filter.PvsExcept(args.Performer).RemoveWhereAttachedEntity(entity => !_examine.InRangeUnOccluded(args.Performer, entity, ExamineRange, null)), true, Shared.Popups.PopupType.MediumCaution); _popupSystem.PopupEntity(Loc.GetString("spin-web-start-second-person"), args.Performer, args.Performer, Shared.Popups.PopupType.Medium); @@ -269,7 +272,7 @@ private void StartCocooning(EntityUid uid, ArachneComponent component, EntityUid { _popupSystem.PopupEntity(Loc.GetString("cocoon-start-third-person", ("target", Identity.Entity(target, EntityManager)), ("spider", Identity.Entity(uid, EntityManager))), uid, // TODO: We need popup occlusion lmao - Filter.PvsExcept(uid).RemoveWhereAttachedEntity(entity => !ExamineSystemShared.InRangeUnOccluded(uid, entity, ExamineRange, null)), + Filter.PvsExcept(uid).RemoveWhereAttachedEntity(entity => !_examine.InRangeUnOccluded(uid, entity, ExamineRange, null)), true, Shared.Popups.PopupType.MediumCaution); @@ -305,7 +308,7 @@ private void OnWebDoAfter(EntityUid uid, ArachneComponent component, ArachneWebD Spawn(ArachneWeb, GetCoordinates(args.Coords).SnapToGrid()); _popupSystem.PopupEntity(Loc.GetString("spun-web-third-person", ("spider", Identity.Entity(uid, EntityManager))), uid, - Filter.PvsExcept(uid).RemoveWhereAttachedEntity(entity => !ExamineSystemShared.InRangeUnOccluded(uid, entity, ExamineRange, null)), + Filter.PvsExcept(uid).RemoveWhereAttachedEntity(entity => !_examine.InRangeUnOccluded(uid, entity, ExamineRange, null)), true, Shared.Popups.PopupType.MediumCaution); _popupSystem.PopupEntity(Loc.GetString("spun-web-second-person"), uid, uid, Shared.Popups.PopupType.Medium); diff --git a/Content.Server/Backmen/Blob/ZombieBlobSystem.cs b/Content.Server/Backmen/Blob/ZombieBlobSystem.cs index 18a00ea4c7c..5837ca000d5 100644 --- a/Content.Server/Backmen/Blob/ZombieBlobSystem.cs +++ b/Content.Server/Backmen/Blob/ZombieBlobSystem.cs @@ -20,12 +20,14 @@ using Content.Shared.Mind.Components; using Content.Shared.Mobs; using Content.Shared.NPC.Components; +using Content.Shared.NPC.Prototypes; using Content.Shared.NPC.Systems; using Content.Shared.Physics; using Content.Shared.Tag; using Robust.Shared.Audio.Systems; using Robust.Shared.Physics; using Robust.Shared.Physics.Systems; +using Robust.Shared.Prototypes; namespace Content.Server.Backmen.Blob; @@ -119,7 +121,7 @@ private void OnStartup(EntityUid uid, ZombieBlobComponent component, ComponentSt var oldFactions = new List(); var factionComp = EnsureComp(uid); - foreach (var factionId in new List(factionComp.Factions)) + foreach (var factionId in new List>(factionComp.Factions)) { oldFactions.Add(factionId); _faction.RemoveFaction(uid, factionId); diff --git a/Content.Server/Backmen/Fugitive/FugitiveSystem.cs b/Content.Server/Backmen/Fugitive/FugitiveSystem.cs index 051e862be8f..5cca9011586 100644 --- a/Content.Server/Backmen/Fugitive/FugitiveSystem.cs +++ b/Content.Server/Backmen/Fugitive/FugitiveSystem.cs @@ -6,6 +6,7 @@ using Content.Server.Objectives; using Content.Server.Chat.Systems; using Content.Server.Communications; +using Content.Server.Examine; using Content.Server.Paper; using Content.Server.Popups; using Content.Server.Stunnable; @@ -70,6 +71,7 @@ public sealed class FugitiveSystem : EntitySystem [Dependency] private readonly FugitiveSystem _fugitiveSystem = default!; [Dependency] private readonly ObjectivesSystem _objectivesSystem = default!; [Dependency] private readonly RandomHelperSystem _randomHelper = default!; + [Dependency] private readonly ExamineSystem _examine = default!; public override void Initialize() { @@ -284,7 +286,7 @@ private void DoSpawnEffects(EntityUid uid, FugitiveComponent? component = null) _popupSystem.PopupEntity(Loc.GetString("fugitive-spawn", ("name", uid)), uid, Filter.Pvs(uid).RemoveWhereAttachedEntity(entity => - !ExamineSystemShared.InRangeUnOccluded(uid, entity, ExamineRange, null)), true, + !_examine.InRangeUnOccluded(uid, entity, ExamineRange, null)), true, Shared.Popups.PopupType.LargeCaution); _stun.TryParalyze(uid, TimeSpan.FromSeconds(2), false); diff --git a/Content.Server/Backmen/Psionics/Invisbility/PsionicInvisibilitySystem.cs b/Content.Server/Backmen/Psionics/Invisbility/PsionicInvisibilitySystem.cs index 6add06c5573..1dcd41ef617 100644 --- a/Content.Server/Backmen/Psionics/Invisbility/PsionicInvisibilitySystem.cs +++ b/Content.Server/Backmen/Psionics/Invisbility/PsionicInvisibilitySystem.cs @@ -3,6 +3,8 @@ using Content.Server.NPC.Systems; using Content.Shared.Backmen.Abilities.Psionics; using Content.Shared.Eye; +using Content.Shared.NPC.Components; +using Content.Shared.NPC.Prototypes; using Content.Shared.NPC.Systems; using Robust.Shared.Containers; using Robust.Server.GameObjects; @@ -38,6 +40,12 @@ private void OnInit(EntityUid uid, PotentialPsionicComponent component, Componen SetCanSeePsionicInvisiblity(uid, false); } + [ValidatePrototypeId] + private const string PsionicInterloper = "PsionicInterloper"; + + [ValidatePrototypeId] + private const string GlimmerMonster = "GlimmerMonster"; + private void OnInsulInit(EntityUid uid, PsionicInsulationComponent component, ComponentInit args) { if (!HasComp(uid)) @@ -46,17 +54,22 @@ private void OnInsulInit(EntityUid uid, PsionicInsulationComponent component, Co if (HasComp(uid)) _invisSystem.ToggleInvisibility(uid); - if (_npcFactonSystem.ContainsFaction(uid, "PsionicInterloper")) + if (TryComp(uid, out var npcFactionMemberComponent)) { - component.SuppressedFactions.Add("PsionicInterloper"); - _npcFactonSystem.RemoveFaction(uid, "PsionicInterloper"); + Entity ent = (uid, npcFactionMemberComponent); + if (_npcFactonSystem.IsMember(ent, "PsionicInterloper")) + { + component.SuppressedFactions.Add("PsionicInterloper"); + _npcFactonSystem.RemoveFaction(ent, "PsionicInterloper"); + } + + if (_npcFactonSystem.IsMember(ent, "GlimmerMonster")) + { + component.SuppressedFactions.Add("GlimmerMonster"); + _npcFactonSystem.RemoveFaction(ent, "GlimmerMonster"); + } } - if (_npcFactonSystem.ContainsFaction(uid, "GlimmerMonster")) - { - component.SuppressedFactions.Add("GlimmerMonster"); - _npcFactonSystem.RemoveFaction(uid, "GlimmerMonster"); - } SetCanSeePsionicInvisiblity(uid, true); } diff --git a/Content.Server/Backmen/Species/Shadowkin/Components/ShadowkinDarkSwapPowerComponent.cs b/Content.Server/Backmen/Species/Shadowkin/Components/ShadowkinDarkSwapPowerComponent.cs index 6cc21ba1f1a..e97f96012a6 100644 --- a/Content.Server/Backmen/Species/Shadowkin/Components/ShadowkinDarkSwapPowerComponent.cs +++ b/Content.Server/Backmen/Species/Shadowkin/Components/ShadowkinDarkSwapPowerComponent.cs @@ -1,5 +1,6 @@ using Content.Server.NPC.Components; using Content.Shared.NPC.Prototypes; +using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; namespace Content.Server.Backmen.Species.Shadowkin.Components; diff --git a/Content.Server/Backmen/Species/Shadowkin/Systems/ShadowkinPowerSystem.DarkSwap.cs b/Content.Server/Backmen/Species/Shadowkin/Systems/ShadowkinPowerSystem.DarkSwap.cs index 6037d18ed74..7b756129e08 100644 --- a/Content.Server/Backmen/Species/Shadowkin/Systems/ShadowkinPowerSystem.DarkSwap.cs +++ b/Content.Server/Backmen/Species/Shadowkin/Systems/ShadowkinPowerSystem.DarkSwap.cs @@ -319,7 +319,7 @@ public void SuppressFactions(EntityUid uid, bool set) return; // Copy the suppressed factions to the power component - component.SuppressedFactions = factions.Factions.ToList(); + component.SuppressedFactions = factions.Factions.Select(x=>x.Id).ToList(); // Remove the factions from the entity foreach (var faction in factions.Factions) diff --git a/Content.Server/Backmen/StationEvents/Events/GlimmerWispSpawnRule.cs b/Content.Server/Backmen/StationEvents/Events/GlimmerWispSpawnRule.cs index 2bb1dcf19d3..248b21f60ba 100644 --- a/Content.Server/Backmen/StationEvents/Events/GlimmerWispSpawnRule.cs +++ b/Content.Server/Backmen/StationEvents/Events/GlimmerWispSpawnRule.cs @@ -9,6 +9,7 @@ using Content.Server.StationEvents.Events; using Content.Shared.Backmen.Psionics.Glimmer; using Content.Shared.Backmen.Abilities.Psionics; +using Content.Shared.NPC.Components; using Robust.Shared.Map; using Robust.Shared.Prototypes; diff --git a/Resources/Prototypes/Backmen/Entities/Objects/Misc/spider_web_arache.yml b/Resources/Prototypes/Backmen/Entities/Objects/Misc/spider_web_arache.yml index 6bd22bf143c..bf9195bd95c 100644 --- a/Resources/Prototypes/Backmen/Entities/Objects/Misc/spider_web_arache.yml +++ b/Resources/Prototypes/Backmen/Entities/Objects/Misc/spider_web_arache.yml @@ -11,9 +11,9 @@ map: ["spiderWebLayer"] drawdepth: WallMountedItems netsync: false - - type: SlowContacts + - type: SpeedModifierContacts walkSpeedModifier: 0.5 sprintSpeedModifier: 0.5 ignoreWhitelist: components: - - IgnoreSpiderWebArachneClassic \ No newline at end of file + - IgnoreSpiderWebArachneClassic diff --git a/Resources/Prototypes/Backmen/Entities/Structures/Webbing/Webbing/webs.yml b/Resources/Prototypes/Backmen/Entities/Structures/Webbing/Webbing/webs.yml index 7d81c1d5637..2be8f3cd6fc 100644 --- a/Resources/Prototypes/Backmen/Entities/Structures/Webbing/Webbing/webs.yml +++ b/Resources/Prototypes/Backmen/Entities/Structures/Webbing/Webbing/webs.yml @@ -18,7 +18,7 @@ web1: "" - enum.DamageStateVisualLayers.Base: #your guess for why randomsprite requires an arbitrary layer is as good as mine friend web2: "" - - type: SlowContacts + - type: SpeedModifierContacts walkSpeedModifier: 0.2 sprintSpeedModifier: 0.2 ignoreWhitelist: