mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-18 14:07:53 +03:00
* Уэээээээ * Почти настрадались * Скоро конец.... * СКОРО * Мышки плакали, кололись, но продолжали упорно жрать кактус * Все ближе! * Это такой конец? * Книжка говна * фиксики * ОНО ЖИВОЕ * Телепорт * разное * Added byond * ивенты теперь работают * Разфикс телепорта * Свет мой зеркальце скажи, да всю правду доложи - Я ль робастней всех на свете? * Разное * Еще многа всего * Многа разнава * Скоро конец.... * ЭТО КОНЕЦ * Фикс линтера (ну, или я на это надеюсь) * Еще один фикс линтера * Победа! * фиксики * пу пу пу * Фикс подмастерья * Мисклик * Высокочастотный меч * Неймспейсы * Пул способностей мага
38 lines
1.5 KiB
C#
38 lines
1.5 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) // Goob edit
|
|
{
|
|
var entProto = prototype.Index<PolymorphPrototype>(PolymorphPrototype).Configuration.Entity;
|
|
if (entProto == null)
|
|
return null;
|
|
var ent = prototype.Index<EntityPrototype>(entProto.Value);
|
|
return Loc.GetString("reagent-effect-guidebook-make-polymorph", ("chance", Probability), ("entityname", ent.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);
|
|
}
|
|
}
|