disallow stacking polymorphs by default (#9845)

Co-authored-by: Kara <lunarautomaton6@gmail.com>
This commit is contained in:
Nemanja
2022-08-07 21:34:20 -04:00
committed by GitHub
parent b8045c3f29
commit 1783dd82e7
3 changed files with 13 additions and 4 deletions

View File

@@ -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<PolymorphedEntityComponent>(target))
return null;
// mostly just for vehicles
if (TryComp<BuckleComponent>(target, out var buckle))
buckle.TryUnbuckle(target, true);

View File

@@ -88,6 +88,9 @@ namespace Content.Shared.Polymorph
/// </summary>
[DataField("revertOnDeath", serverOnly: true)]
public bool RevertOnDeath = true;
[DataField("allowRepeatedMorphs", serverOnly: true)]
public bool AllowRepeatedMorphs = false;
}
public enum PolymorphInventoryChange : byte

View File

@@ -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