Transform sting nerf (#269)
* - add: 10 minutes of suffering. * - fix: No monkey evolution. * - fix: Remove Absorb on rejuvenate. * - tweak: Less thick armor. * - fix: Transfer uncloneable on transform.
This commit is contained in:
@@ -424,7 +424,19 @@ public sealed partial class ChangelingSystem
|
|||||||
_pullingSystem.TryStopPull(pullable);
|
_pullingSystem.TryStopPull(pullable);
|
||||||
}
|
}
|
||||||
|
|
||||||
TransformPerson(target, humanData);
|
var oldData = CompOrNull<TransformStungComponent>(target)?.OriginalHumanoidData;
|
||||||
|
|
||||||
|
var transformed = TransformPerson(target, humanData);
|
||||||
|
|
||||||
|
if (transformed != null)
|
||||||
|
{
|
||||||
|
oldData ??= GetHumanoidData(target);
|
||||||
|
if (oldData != null)
|
||||||
|
{
|
||||||
|
var transformStung = EnsureComp<TransformStungComponent>(transformed.Value);
|
||||||
|
transformStung.OriginalHumanoidData = oldData.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_ui.CloseUi(bui, actorComponent.PlayerSession);
|
_ui.CloseUi(bui, actorComponent.PlayerSession);
|
||||||
|
|
||||||
@@ -889,19 +901,9 @@ public sealed partial class ChangelingSystem
|
|||||||
|
|
||||||
private void CopyHumanoidData(EntityUid uid, EntityUid target, ChangelingComponent component)
|
private void CopyHumanoidData(EntityUid uid, EntityUid target, ChangelingComponent component)
|
||||||
{
|
{
|
||||||
if (!TryComp<MetaDataComponent>(target, out var targetMeta))
|
var data = GetHumanoidData(target, component);
|
||||||
return;
|
|
||||||
|
|
||||||
if (!TryComp<HumanoidAppearanceComponent>(target, out var targetAppearance))
|
if (data == null)
|
||||||
return;
|
|
||||||
|
|
||||||
if (!TryComp<DnaComponent>(target, out var targetDna))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!TryPrototype(target, out var prototype, targetMeta))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (component.AbsorbedEntities.ContainsKey(targetDna.DNA))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*if (component.AbsorbedEntities.Count == 7)
|
/*if (component.AbsorbedEntities.Count == 7)
|
||||||
@@ -909,6 +911,28 @@ public sealed partial class ChangelingSystem
|
|||||||
component.AbsorbedEntities.Remove(component.AbsorbedEntities.ElementAt(2).Key);
|
component.AbsorbedEntities.Remove(component.AbsorbedEntities.ElementAt(2).Key);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
component.AbsorbedEntities.Add(data.Value.Dna, data.Value);
|
||||||
|
|
||||||
|
Dirty(uid, component);
|
||||||
|
}
|
||||||
|
|
||||||
|
public HumanoidData? GetHumanoidData(EntityUid target, ChangelingComponent? absorberComponent = null)
|
||||||
|
{
|
||||||
|
if (!TryComp<MetaDataComponent>(target, out var targetMeta))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
if (!TryComp<HumanoidAppearanceComponent>(target, out var targetAppearance))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
if (!TryComp<DnaComponent>(target, out var targetDna))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
if (!TryPrototype(target, out var prototype, targetMeta))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
if (absorberComponent != null && absorberComponent.AbsorbedEntities.ContainsKey(targetDna.DNA))
|
||||||
|
return null;
|
||||||
|
|
||||||
var appearance = _serializationManager.CreateCopy(targetAppearance, notNullableOverride: true);
|
var appearance = _serializationManager.CreateCopy(targetAppearance, notNullableOverride: true);
|
||||||
var meta = _serializationManager.CreateCopy(targetMeta, notNullableOverride: true);
|
var meta = _serializationManager.CreateCopy(targetMeta, notNullableOverride: true);
|
||||||
|
|
||||||
@@ -916,16 +940,14 @@ public sealed partial class ChangelingSystem
|
|||||||
? Loc.GetString("changeling-unknown-creature")
|
? Loc.GetString("changeling-unknown-creature")
|
||||||
: meta.EntityName;
|
: meta.EntityName;
|
||||||
|
|
||||||
component.AbsorbedEntities.Add(targetDna.DNA, new HumanoidData
|
return new HumanoidData
|
||||||
{
|
{
|
||||||
EntityPrototype = prototype,
|
EntityPrototype = prototype,
|
||||||
MetaDataComponent = meta,
|
MetaDataComponent = meta,
|
||||||
AppearanceComponent = appearance,
|
AppearanceComponent = appearance,
|
||||||
Name = name,
|
Name = name,
|
||||||
Dna = targetDna.DNA
|
Dna = targetDna.DNA
|
||||||
});
|
};
|
||||||
|
|
||||||
Dirty(uid, component);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -935,7 +957,7 @@ public sealed partial class ChangelingSystem
|
|||||||
/// <param name="transformData">Transform data</param>
|
/// <param name="transformData">Transform data</param>
|
||||||
/// <param name="humanoidOverride">Override first check on HumanoidAppearanceComponent</param>
|
/// <param name="humanoidOverride">Override first check on HumanoidAppearanceComponent</param>
|
||||||
/// <returns>Id of the transformed entity</returns>
|
/// <returns>Id of the transformed entity</returns>
|
||||||
private EntityUid? TransformPerson(EntityUid target, HumanoidData transformData, bool humanoidOverride = false)
|
public EntityUid? TransformPerson(EntityUid target, HumanoidData transformData, bool humanoidOverride = false)
|
||||||
{
|
{
|
||||||
if (!HasComp<HumanoidAppearanceComponent>(target) && !humanoidOverride)
|
if (!HasComp<HumanoidAppearanceComponent>(target) && !humanoidOverride)
|
||||||
return null;
|
return null;
|
||||||
@@ -1005,6 +1027,9 @@ public sealed partial class ChangelingSystem
|
|||||||
if (HasComp<AbsorbedComponent>(from))
|
if (HasComp<AbsorbedComponent>(from))
|
||||||
EnsureComp<AbsorbedComponent>(to);
|
EnsureComp<AbsorbedComponent>(to);
|
||||||
|
|
||||||
|
if (HasComp<UncloneableComponent>(from))
|
||||||
|
EnsureComp<UncloneableComponent>(to);
|
||||||
|
|
||||||
if (HasComp<BibleUserComponent>(from))
|
if (HasComp<BibleUserComponent>(from))
|
||||||
EnsureComp<BibleUserComponent>(to);
|
EnsureComp<BibleUserComponent>(to);
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using Content.Shared.Examine;
|
|||||||
using Content.Shared.IdentityManagement;
|
using Content.Shared.IdentityManagement;
|
||||||
using Content.Shared.Implants;
|
using Content.Shared.Implants;
|
||||||
using Content.Shared.Implants.Components;
|
using Content.Shared.Implants.Components;
|
||||||
|
using Content.Shared.Rejuvenate;
|
||||||
|
|
||||||
namespace Content.Server.Changeling;
|
namespace Content.Server.Changeling;
|
||||||
|
|
||||||
@@ -23,6 +24,7 @@ public sealed partial class ChangelingSystem : EntitySystem
|
|||||||
SubscribeLocalEvent<ChangelingComponent, ComponentInit>(OnInit);
|
SubscribeLocalEvent<ChangelingComponent, ComponentInit>(OnInit);
|
||||||
|
|
||||||
SubscribeLocalEvent<AbsorbedComponent, ExaminedEvent>(OnExamine);
|
SubscribeLocalEvent<AbsorbedComponent, ExaminedEvent>(OnExamine);
|
||||||
|
SubscribeLocalEvent<AbsorbedComponent, RejuvenateEvent>(OnRejuvenate);
|
||||||
|
|
||||||
InitializeAbilities();
|
InitializeAbilities();
|
||||||
InitializeShop();
|
InitializeShop();
|
||||||
@@ -45,6 +47,12 @@ public sealed partial class ChangelingSystem : EntitySystem
|
|||||||
args.PushMarkup(Loc.GetString("changeling-juices-sucked-up", ("target", Identity.Entity(uid, EntityManager))));
|
args.PushMarkup(Loc.GetString("changeling-juices-sucked-up", ("target", Identity.Entity(uid, EntityManager))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnRejuvenate(Entity<AbsorbedComponent> ent, ref RejuvenateEvent args)
|
||||||
|
{
|
||||||
|
RemCompDeferred<AbsorbedComponent>(ent);
|
||||||
|
RemCompDeferred<UncloneableComponent>(ent);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Helpers
|
#region Helpers
|
||||||
|
|||||||
16
Content.Server/Changeling/TransformStungComponent.cs
Normal file
16
Content.Server/Changeling/TransformStungComponent.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
using Content.Shared.Changeling;
|
||||||
|
|
||||||
|
namespace Content.Server.Changeling;
|
||||||
|
|
||||||
|
[RegisterComponent]
|
||||||
|
public sealed partial class TransformStungComponent : Component
|
||||||
|
{
|
||||||
|
[ViewVariables]
|
||||||
|
public HumanoidData OriginalHumanoidData;
|
||||||
|
|
||||||
|
[DataField]
|
||||||
|
public TimeSpan Duration = TimeSpan.FromMinutes(10);
|
||||||
|
|
||||||
|
[ViewVariables]
|
||||||
|
public float Accumulator;
|
||||||
|
}
|
||||||
39
Content.Server/Changeling/TransformStungSystem.cs
Normal file
39
Content.Server/Changeling/TransformStungSystem.cs
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
using Content.Server.Forensics;
|
||||||
|
using Content.Shared.Mobs;
|
||||||
|
using Content.Shared.Mobs.Components;
|
||||||
|
|
||||||
|
namespace Content.Server.Changeling;
|
||||||
|
|
||||||
|
public sealed class TransformStungSystem : EntitySystem
|
||||||
|
{
|
||||||
|
[Dependency] private readonly ChangelingSystem _ling = default!;
|
||||||
|
|
||||||
|
public override void Update(float frameTime)
|
||||||
|
{
|
||||||
|
base.Update(frameTime);
|
||||||
|
|
||||||
|
var query = EntityQueryEnumerator<TransformStungComponent, MobStateComponent, DnaComponent>();
|
||||||
|
while (query.MoveNext(out var uid, out var stung, out var state, out var dna))
|
||||||
|
{
|
||||||
|
if (dna.DNA == stung.OriginalHumanoidData.Dna)
|
||||||
|
{
|
||||||
|
RemCompDeferred<TransformStungComponent>(uid);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state.CurrentState != MobState.Alive)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
stung.Accumulator += frameTime;
|
||||||
|
|
||||||
|
if (stung.Accumulator < stung.Duration.TotalSeconds)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
stung.Accumulator = 0f;
|
||||||
|
|
||||||
|
_ling.TransformPerson(uid, stung.OriginalHumanoidData);
|
||||||
|
|
||||||
|
RemCompDeferred<TransformStungComponent>(uid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,10 +5,12 @@ using Content.Shared.Interaction;
|
|||||||
using Content.Shared.Interaction.Events;
|
using Content.Shared.Interaction.Events;
|
||||||
using Content.Shared.Mindshield.Components;
|
using Content.Shared.Mindshield.Components;
|
||||||
using Content.Shared.Mobs;
|
using Content.Shared.Mobs;
|
||||||
|
using Content.Shared.Store;
|
||||||
using Content.Shared.Tag;
|
using Content.Shared.Tag;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.Network;
|
using Robust.Shared.Network;
|
||||||
|
using Robust.Shared.Player;
|
||||||
|
|
||||||
namespace Content.Shared.Implants;
|
namespace Content.Shared.Implants;
|
||||||
|
|
||||||
@@ -18,6 +20,7 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem
|
|||||||
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
|
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
|
||||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||||
[Dependency] private readonly TagSystem _tag = default!;
|
[Dependency] private readonly TagSystem _tag = default!;
|
||||||
|
[Dependency] private readonly SharedUserInterfaceSystem _ui = default!; // WD
|
||||||
|
|
||||||
public const string BaseStorageId = "storagebase";
|
public const string BaseStorageId = "storagebase";
|
||||||
|
|
||||||
@@ -225,6 +228,9 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem
|
|||||||
|
|
||||||
// Insert the implant into the recipient's implant container
|
// Insert the implant into the recipient's implant container
|
||||||
ForceImplant(recipient, donorImplant, subdermal, true);
|
ForceImplant(recipient, donorImplant, subdermal, true);
|
||||||
|
|
||||||
|
if (TryComp(recipient, out ActorComponent? actor))
|
||||||
|
_ui.TryClose(donorImplant, StoreUiKey.Key, actor.PlayerSession);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -165,16 +165,13 @@
|
|||||||
- type: Armor
|
- type: Armor
|
||||||
modifiers:
|
modifiers:
|
||||||
coefficients:
|
coefficients:
|
||||||
Blunt: 0.4
|
Blunt: 0.5
|
||||||
Slash: 0.4
|
Slash: 0.5
|
||||||
Piercing: 0.5
|
Piercing: 0.6
|
||||||
Heat: 0.4
|
Heat: 0.5
|
||||||
- type: ExplosionResistance
|
- type: ExplosionResistance
|
||||||
damageCoefficient: 0.5
|
damageCoefficient: 0.5
|
||||||
- type: GroupExamine
|
- type: GroupExamine
|
||||||
- type: ClothingSpeedModifier
|
|
||||||
walkModifier: 0.85
|
|
||||||
sprintModifier: 0.85
|
|
||||||
- type: Unremoveable
|
- type: Unremoveable
|
||||||
deleteOnDrop: true
|
deleteOnDrop: true
|
||||||
- type: ClothingModifyChemicalRegen
|
- type: ClothingModifyChemicalRegen
|
||||||
|
|||||||
Reference in New Issue
Block a user