diff --git a/Content.Server/Polymorph/Systems/PolymorphableSystem.cs b/Content.Server/Polymorph/Systems/PolymorphableSystem.cs index 5a4553cbff..2c50bbfcb7 100644 --- a/Content.Server/Polymorph/Systems/PolymorphableSystem.cs +++ b/Content.Server/Polymorph/Systems/PolymorphableSystem.cs @@ -1,5 +1,4 @@ using Content.Server.Actions; -using Content.Server.Body.Components; using Content.Server.Buckle.Components; using Content.Server.Inventory; using Content.Server.Mind.Commands; @@ -13,11 +12,8 @@ using Content.Shared.Damage; using Content.Shared.Hands.EntitySystems; using Content.Shared.Polymorph; using Robust.Server.Containers; -using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.Map; -using Robust.Shared.Physics.Dynamics; -using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Utility; @@ -90,6 +86,10 @@ namespace Content.Server.Polymorph.Systems /// logic and conditions specified in the prototype, and everything else that may be needed. /// I am clinically insane - emo + // if it's already morphed, don't allow it again with this condition active. + if (!proto.AllowRepeatedMorphs && HasComp(target)) + return null; + // mostly just for vehicles if (TryComp(target, out var buckle)) buckle.TryUnbuckle(target, true); diff --git a/Content.Shared/Polymorph/PolymorphPrototype.cs b/Content.Shared/Polymorph/PolymorphPrototype.cs index a4598fa0bb..5c02c51fd9 100644 --- a/Content.Shared/Polymorph/PolymorphPrototype.cs +++ b/Content.Shared/Polymorph/PolymorphPrototype.cs @@ -88,6 +88,9 @@ namespace Content.Shared.Polymorph /// [DataField("revertOnDeath", serverOnly: true)] public bool RevertOnDeath = true; + + [DataField("allowRepeatedMorphs", serverOnly: true)] + public bool AllowRepeatedMorphs = false; } public enum PolymorphInventoryChange : byte diff --git a/Resources/Prototypes/Polymorphs/admin.yml b/Resources/Prototypes/Polymorphs/admin.yml index 70dd9b5656..0ae5426244 100644 --- a/Resources/Prototypes/Polymorphs/admin.yml +++ b/Resources/Prototypes/Polymorphs/admin.yml @@ -5,33 +5,39 @@ transferName: true transferHumanoidAppearance: true inventory: Transfer + allowRepeatedMorphs: true - type: polymorph id: AdminMonkeySmite entity: MobMonkey forced: true inventory: Drop + allowRepeatedMorphs: true - type: polymorph id: AdminBreadSmite entity: FoodBreadPlain forced: true inventory: Drop + allowRepeatedMorphs: true - type: polymorph id: AdminInstrumentSmite entity: SuperSynthesizerInstrument forced: true inventory: Drop + allowRepeatedMorphs: true - type: polymorph id: AdminMouseSmite entity: MobMouse forced: true inventory: Drop + allowRepeatedMorphs: true - type: polymorph id: AdminDisposalsSmite entity: DisposalUnit forced: true inventory: Drop + allowRepeatedMorphs: true