diff --git a/Content.Server/ADT/Heretic/Components/EldritchInfluenceComponent.cs b/Content.Server/ADT/Heretic/Components/EldritchInfluenceComponent.cs index bf425c9d719..f9799bf021b 100644 --- a/Content.Server/ADT/Heretic/Components/EldritchInfluenceComponent.cs +++ b/Content.Server/ADT/Heretic/Components/EldritchInfluenceComponent.cs @@ -1,4 +1,5 @@ using Content.Server.Heretic.EntitySystems; +using Content.Shared.Eye; namespace Content.Server.Heretic.Components; @@ -7,6 +8,5 @@ public sealed partial class EldritchInfluenceComponent : Component { [DataField] public bool Spent = false; - // make sure to update it with the prototype !!! - [NonSerialized] public static int LayerMask = 69; // 69 idk why not lolol + [NonSerialized] public static int LayerMask = (int)VisibilityFlags.Eldritch; } diff --git a/Content.Server/ADT/Heretic/EntitySystems/HereticSystem.cs b/Content.Server/ADT/Heretic/EntitySystems/HereticSystem.cs index 60327aa7cb1..0699fbb327d 100644 --- a/Content.Server/ADT/Heretic/EntitySystems/HereticSystem.cs +++ b/Content.Server/ADT/Heretic/EntitySystems/HereticSystem.cs @@ -24,6 +24,7 @@ using Content.Shared.Damage.Components; using Content.Shared.ADT.Chaplain.Components; using Robust.Shared.Utility; +using Content.Shared.Eye; namespace Content.Server.Heretic.EntitySystems; diff --git a/Content.Server/Polymorph/Components/PolymorphedEntityComponent.cs b/Content.Server/Polymorph/Components/PolymorphedEntityComponent.cs index 03ab7b6c1fd..37fe3292288 100644 --- a/Content.Server/Polymorph/Components/PolymorphedEntityComponent.cs +++ b/Content.Server/Polymorph/Components/PolymorphedEntityComponent.cs @@ -35,4 +35,9 @@ public sealed partial class PolymorphedEntityComponent : Component [DataField] public EntityUid? Action; + + // ADT-Tweak start + [DataField] + public int? ParentVisibilityMask; + // ADT-Tweak end } diff --git a/Content.Server/Polymorph/Systems/PolymorphSystem.cs b/Content.Server/Polymorph/Systems/PolymorphSystem.cs index 4d853bafef9..c237bd4276c 100644 --- a/Content.Server/Polymorph/Systems/PolymorphSystem.cs +++ b/Content.Server/Polymorph/Systems/PolymorphSystem.cs @@ -13,6 +13,7 @@ using Content.Shared.CombatMode.Pacification; using Content.Shared.Bed.Sleep; using Content.Shared.Eye.Blinding.Components; +using Robust.Shared.GameObjects; using Content.Server.Traits.Assorted; using Content.Shared.Speech.Muting; using Content.Shared.ADT.Traits; @@ -25,6 +26,7 @@ using Content.Shared.Damage.Components; using Content.Shared.Damage.Systems; using Content.Shared.Destructible; +using Content.Shared.Eye; using Content.Shared.Follower; using Content.Shared.Follower.Components; using Content.Shared.Hands.EntitySystems; @@ -69,6 +71,7 @@ public sealed partial class PolymorphSystem : EntitySystem [Dependency] private readonly SharedMindSystem _mindSystem = default!; [Dependency] private readonly MetaDataSystem _metaData = default!; [Dependency] private readonly FollowerSystem _follow = default!; // goob edit + [Dependency] private readonly SharedEyeSystem _eye = default!; // ADT-Tweak Heretic [Dependency] private readonly ISerializationManager _serialization = default!; // ADT-Changeling-Tweak private const string RevertPolymorphId = "ActionRevertPolymorph"; @@ -242,6 +245,12 @@ private void OnPolymorphedTerminating(Entity ent, re var polymorphedComp = Factory.GetComponent(); polymorphedComp.Parent = uid; polymorphedComp.Configuration = configuration; + + // ADT-Tweak start Heretic + if (TryComp(uid, out var parentEye)) + polymorphedComp.ParentVisibilityMask = parentEye.VisibilityMask; + // ADT-Tweak end + AddComp(child, polymorphedComp); var childXform = Transform(child); @@ -589,6 +598,13 @@ private void RetrievePausedEntity(EntityUid user, EntityUid target) if (TryComp(parent, out var polymorphableComponent)) polymorphableComponent.LastPolymorphEnd = _gameTiming.CurTime; + // ADT-Tweak start Heretic + if (component.ParentVisibilityMask.HasValue && TryComp(parent, out var parentEye)) + { + _eye.SetVisibilityMask(parent, component.ParentVisibilityMask.Value, parentEye); + } + // ADT-Tweak end + // if an item polymorph was picked up, put it back down after reverting _transform.AttachToGridOrMap(parent, parentXform); diff --git a/Content.Shared/Eye/VisibilityFlags.cs b/Content.Shared/Eye/VisibilityFlags.cs index 453cc0251bf..27e2a53b5eb 100644 --- a/Content.Shared/Eye/VisibilityFlags.cs +++ b/Content.Shared/Eye/VisibilityFlags.cs @@ -14,5 +14,6 @@ public enum VisibilityFlags : int Narcotic = 1 << 2, // ADT-Changeling-Tweak Schizo = 1 << 3, // ADT-Changeling-Tweak LingToxin = 1 << 4, // ADT-Changeling-Tweak + Eldritch = 1 << 5, // ADT-Tweak Heretic } } diff --git a/Resources/Prototypes/ADT/Heretic/Entities/Structures/Specific/Heretic/eldritch_influence.yml b/Resources/Prototypes/ADT/Heretic/Entities/Structures/Specific/Heretic/eldritch_influence.yml index 1061121bc08..17dcb58b26c 100644 --- a/Resources/Prototypes/ADT/Heretic/Entities/Structures/Specific/Heretic/eldritch_influence.yml +++ b/Resources/Prototypes/ADT/Heretic/Entities/Structures/Specific/Heretic/eldritch_influence.yml @@ -12,7 +12,7 @@ state: icon - type: Clickable - type: Visibility - layer: 69 + layer: 32 - type: entity id: EldritchInfluenceIntermediate