Files
wwdpublic/Content.Server/EntityEffects/Effects/Polymorph.cs
ilmenwe 8338b0c699 Removed Duplicate Using. Removed Unused Using. (#2163)
# Description

Removed duplicate using statements, removed unused using statements.
this will decrease the number of warnings a small bit, and decrease
unused dependency references in general.
---

# TODO

- [x] Remove double references.
- [x] Remove unused references.
---

# Changelog

🆑
- remove: double references in code
- remove: unused references in code that had double references.

Co-authored-by: ilmenwe <no@mail.com>

(cherry picked from commit 9b73c88feefff68223f083893505826dc021ddee)
2025-04-18 17:04:50 +03:00

34 lines
1.3 KiB
C#

using Content.Server.Polymorph.Components;
using Content.Server.Polymorph.Systems;
using Content.Shared.EntityEffects;
using Content.Shared.Polymorph;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.EntityEffects.Effects;
public sealed partial class Polymorph : EntityEffect
{
/// <summary>
/// What polymorph prototype is used on effect
/// </summary>
[DataField("prototype", customTypeSerializer:typeof(PrototypeIdSerializer<PolymorphPrototype>))]
public string PolymorphPrototype { get; set; }
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("reagent-effect-guidebook-make-polymorph",
("chance", Probability), ("entityname",
prototype.Index<EntityPrototype>(prototype.Index<PolymorphPrototype>(PolymorphPrototype).Configuration.Entity).Name));
public override void Effect(EntityEffectBaseArgs args)
{
var entityManager = args.EntityManager;
var uid = args.TargetEntity;
var polySystem = entityManager.System<PolymorphSystem>();
// Make it into a prototype
entityManager.EnsureComponent<PolymorphableComponent>(uid);
polySystem.PolymorphEntity(uid, PolymorphPrototype);
}
}