cham projector fixes/rewrite (#27111)
* cant disguise to thing in a container * copy cigarette visualiser * prevent aghost throwing an error * make disguises die in space * fuck it rewrite it to not use polymorph * fix action troll * oop * add vebr * add access to the components * 2/3 * fix * relay damage from disguise to user * fix integrity * :trollface: * :trollface: * m * kill integrity * fix a bug * review * remove them from component * relay flash effect to the disguise * fix icon being weird * change method since multiple systems cant handle same network event * :trollface: * actually network Disguise real --------- Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.Polymorph.Systems;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
@@ -7,9 +8,22 @@ namespace Content.Shared.Polymorph.Components;
|
||||
/// Component added to disguise entities.
|
||||
/// Used by client to copy over appearance from the disguise's source entity.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
|
||||
[RegisterComponent, NetworkedComponent, Access(typeof(SharedChameleonProjectorSystem))]
|
||||
[AutoGenerateComponentState(true)]
|
||||
public sealed partial class ChameleonDisguiseComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The user of this disguise.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public EntityUid User;
|
||||
|
||||
/// <summary>
|
||||
/// The projector that created this disguise.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public EntityUid Projector;
|
||||
|
||||
/// <summary>
|
||||
/// The disguise source entity for copying the sprite.
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using Content.Shared.Polymorph.Systems;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Polymorph.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Added to a player when they use a chameleon projector.
|
||||
/// Handles making them invisible and revealing when damaged enough or switching hands.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, Access(typeof(SharedChameleonProjectorSystem))]
|
||||
[AutoGenerateComponentState]
|
||||
public sealed partial class ChameleonDisguisedComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The disguise entity parented to the player.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public EntityUid Disguise;
|
||||
|
||||
/// <summary>
|
||||
/// For client, whether the user's sprite was previously visible or not.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public bool WasVisible;
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
using Content.Shared.Polymorph;
|
||||
using Content.Shared.Polymorph.Systems;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Prototypes;
|
||||
@@ -25,22 +24,26 @@ public sealed partial class ChameleonProjectorComponent : Component
|
||||
public EntityWhitelist? Blacklist;
|
||||
|
||||
/// <summary>
|
||||
/// Polymorph configuration for the disguise entity.
|
||||
/// Disguise entity to spawn and use.
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public PolymorphConfiguration Polymorph = new();
|
||||
public EntProtoId DisguiseProto = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Action for disabling your disguise's rotation.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public EntProtoId NoRotAction = "ActionDisguiseNoRot";
|
||||
[DataField]
|
||||
public EntityUid? NoRotActionEntity;
|
||||
|
||||
/// <summary>
|
||||
/// Action for anchoring your disguise in place.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public EntProtoId AnchorAction = "ActionDisguiseAnchor";
|
||||
[DataField]
|
||||
public EntityUid? AnchorActionEntity;
|
||||
|
||||
/// <summary>
|
||||
/// Minimum health to give the disguise.
|
||||
@@ -55,14 +58,8 @@ public sealed partial class ChameleonProjectorComponent : Component
|
||||
public float MaxHealth = 100f;
|
||||
|
||||
/// <summary>
|
||||
/// Popup shown to the user when they try to disguise as an invalid entity.
|
||||
/// User currently disguised by this projector, if any
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public LocId InvalidPopup = "chameleon-projector-invalid";
|
||||
|
||||
/// <summary>
|
||||
/// Popup shown to the user when they disguise as a valid entity.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public LocId SuccessPopup = "chameleon-projector-success";
|
||||
public EntityUid? Disguised;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user