@@ -204,6 +204,12 @@ public sealed partial class PolymorphSystem : EntitySystem
|
|||||||
|
|
||||||
var child = Spawn(configuration.Entity, _transform.GetMapCoordinates(uid, targetTransformComp), rotation: _transform.GetWorldRotation(uid));
|
var child = Spawn(configuration.Entity, _transform.GetMapCoordinates(uid, targetTransformComp), rotation: _transform.GetWorldRotation(uid));
|
||||||
|
|
||||||
|
if (configuration.PolymorphPopup != null)
|
||||||
|
_popup.PopupEntity(Loc.GetString(configuration.PolymorphPopup,
|
||||||
|
("parent", Identity.Entity(uid, EntityManager)),
|
||||||
|
("child", Identity.Entity(child, EntityManager))),
|
||||||
|
child);
|
||||||
|
|
||||||
MakeSentientCommand.MakeSentient(child, EntityManager);
|
MakeSentientCommand.MakeSentient(child, EntityManager);
|
||||||
|
|
||||||
var polymorphedComp = _compFact.GetComponent<PolymorphedEntityComponent>();
|
var polymorphedComp = _compFact.GetComponent<PolymorphedEntityComponent>();
|
||||||
@@ -347,7 +353,8 @@ public sealed partial class PolymorphSystem : EntitySystem
|
|||||||
var ev = new PolymorphedEvent(uid, parent, true);
|
var ev = new PolymorphedEvent(uid, parent, true);
|
||||||
RaiseLocalEvent(uid, ref ev);
|
RaiseLocalEvent(uid, ref ev);
|
||||||
|
|
||||||
_popup.PopupEntity(Loc.GetString("polymorph-revert-popup-generic",
|
if (component.Configuration.ExitPolymorphPopup != null)
|
||||||
|
_popup.PopupEntity(Loc.GetString(component.Configuration.ExitPolymorphPopup,
|
||||||
("parent", Identity.Entity(uid, EntityManager)),
|
("parent", Identity.Entity(uid, EntityManager)),
|
||||||
("child", Identity.Entity(parent, EntityManager))),
|
("child", Identity.Entity(parent, EntityManager))),
|
||||||
parent);
|
parent);
|
||||||
|
|||||||
@@ -416,7 +416,7 @@ public abstract partial class SharedBuckleSystem
|
|||||||
|
|
||||||
public bool TryUnbuckle(Entity<BuckleComponent?> buckle, EntityUid? user, bool popup)
|
public bool TryUnbuckle(Entity<BuckleComponent?> buckle, EntityUid? user, bool popup)
|
||||||
{
|
{
|
||||||
if (!Resolve(buckle.Owner, ref buckle.Comp))
|
if (!Resolve(buckle.Owner, ref buckle.Comp, false))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!CanUnbuckle(buckle, user, popup, out var strap))
|
if (!CanUnbuckle(buckle, user, popup, out var strap))
|
||||||
|
|||||||
@@ -128,6 +128,18 @@ public sealed partial record PolymorphConfiguration
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField]
|
[DataField]
|
||||||
public SoundSpecifier? ExitPolymorphSound;
|
public SoundSpecifier? ExitPolymorphSound;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// If not null, this popup will be displayed when being polymorphed into something.
|
||||||
|
/// </summary>
|
||||||
|
[DataField]
|
||||||
|
public LocId? PolymorphPopup = "polymorph-popup-generic";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// If not null, this popup will be displayed when when being reverted from a polymorph.
|
||||||
|
/// </summary>
|
||||||
|
[DataField]
|
||||||
|
public LocId? ExitPolymorphPopup = "polymorph-revert-popup-generic";
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum PolymorphInventoryChange : byte
|
public enum PolymorphInventoryChange : byte
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
polymorph-self-action-name = Polymorph ({CAPITALIZE($target)})
|
polymorph-self-action-name = Polymorph ({CAPITALIZE($target)})
|
||||||
polymorph-self-action-description = Instantly polymorph yourself into {$target}.
|
polymorph-self-action-description = Instantly polymorph yourself into {$target}.
|
||||||
|
|
||||||
polymorph-popup-generic = {CAPITALIZE($parent)} turned into {$child}.
|
polymorph-popup-generic = {CAPITALIZE(THE($parent))} turned into {$child}.
|
||||||
polymorph-revert-popup-generic = {CAPITALIZE($parent)} reverted back into {$child}.
|
polymorph-revert-popup-generic = {CAPITALIZE(THE($parent))} reverted back into {$child}.
|
||||||
|
|||||||
Reference in New Issue
Block a user