Change Polymorph Actions to use Polymorph Proto Id (#26419)

* polymorph changes

Adds poly proto ids to polymorph action event and checks for proto id when performing

* nullable proto id

* Replaces instances of Polymorph prototype with a proto id and tryindex

* birdup

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
keronshb
2024-03-29 02:41:09 -04:00
committed by GitHub
parent 12a384ff25
commit 06b14f30cd
3 changed files with 24 additions and 13 deletions

View File

@@ -1,18 +1,20 @@
using Content.Shared.Actions;
using Robust.Shared.Prototypes;
namespace Content.Shared.Polymorph;
public sealed partial class PolymorphActionEvent : InstantActionEvent
{
/// <summary>
/// The polymorph prototype containing all the information about
/// the specific polymorph.
/// The polymorph proto id, containing all the information about
/// the specific polymorph.
/// </summary>
public PolymorphPrototype Prototype = default!;
[DataField]
public ProtoId<PolymorphPrototype>? ProtoId;
public PolymorphActionEvent(PolymorphPrototype prototype) : this()
public PolymorphActionEvent(ProtoId<PolymorphPrototype> protoId) : this()
{
Prototype = prototype;
ProtoId = protoId;
}
}