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:
Aviu00
2024-04-04 22:45:03 +09:00
committed by GitHub
parent 4938553945
commit e3ee4a8d3b
6 changed files with 116 additions and 25 deletions

View File

@@ -424,7 +424,19 @@ public sealed partial class ChangelingSystem
_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);
@@ -889,19 +901,9 @@ public sealed partial class ChangelingSystem
private void CopyHumanoidData(EntityUid uid, EntityUid target, ChangelingComponent component)
{
if (!TryComp<MetaDataComponent>(target, out var targetMeta))
return;
var data = GetHumanoidData(target, component);
if (!TryComp<HumanoidAppearanceComponent>(target, out var targetAppearance))
return;
if (!TryComp<DnaComponent>(target, out var targetDna))
return;
if (!TryPrototype(target, out var prototype, targetMeta))
return;
if (component.AbsorbedEntities.ContainsKey(targetDna.DNA))
if (data == null)
return;
/*if (component.AbsorbedEntities.Count == 7)
@@ -909,6 +911,28 @@ public sealed partial class ChangelingSystem
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 meta = _serializationManager.CreateCopy(targetMeta, notNullableOverride: true);
@@ -916,16 +940,14 @@ public sealed partial class ChangelingSystem
? Loc.GetString("changeling-unknown-creature")
: meta.EntityName;
component.AbsorbedEntities.Add(targetDna.DNA, new HumanoidData
return new HumanoidData
{
EntityPrototype = prototype,
MetaDataComponent = meta,
AppearanceComponent = appearance,
Name = name,
Dna = targetDna.DNA
});
Dirty(uid, component);
};
}
/// <summary>
@@ -935,7 +957,7 @@ public sealed partial class ChangelingSystem
/// <param name="transformData">Transform data</param>
/// <param name="humanoidOverride">Override first check on HumanoidAppearanceComponent</param>
/// <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)
return null;
@@ -1005,6 +1027,9 @@ public sealed partial class ChangelingSystem
if (HasComp<AbsorbedComponent>(from))
EnsureComp<AbsorbedComponent>(to);
if (HasComp<UncloneableComponent>(from))
EnsureComp<UncloneableComponent>(to);
if (HasComp<BibleUserComponent>(from))
EnsureComp<BibleUserComponent>(to);

View File

@@ -6,6 +6,7 @@ using Content.Shared.Examine;
using Content.Shared.IdentityManagement;
using Content.Shared.Implants;
using Content.Shared.Implants.Components;
using Content.Shared.Rejuvenate;
namespace Content.Server.Changeling;
@@ -23,6 +24,7 @@ public sealed partial class ChangelingSystem : EntitySystem
SubscribeLocalEvent<ChangelingComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<AbsorbedComponent, ExaminedEvent>(OnExamine);
SubscribeLocalEvent<AbsorbedComponent, RejuvenateEvent>(OnRejuvenate);
InitializeAbilities();
InitializeShop();
@@ -45,6 +47,12 @@ public sealed partial class ChangelingSystem : EntitySystem
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
#region Helpers

View 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;
}

View 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);
}
}
}

View File

@@ -5,10 +5,12 @@ using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.Mindshield.Components;
using Content.Shared.Mobs;
using Content.Shared.Store;
using Content.Shared.Tag;
using JetBrains.Annotations;
using Robust.Shared.Containers;
using Robust.Shared.Network;
using Robust.Shared.Player;
namespace Content.Shared.Implants;
@@ -18,6 +20,7 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
[Dependency] private readonly SharedContainerSystem _container = default!;
[Dependency] private readonly TagSystem _tag = default!;
[Dependency] private readonly SharedUserInterfaceSystem _ui = default!; // WD
public const string BaseStorageId = "storagebase";
@@ -225,6 +228,9 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem
// Insert the implant into the recipient's implant container
ForceImplant(recipient, donorImplant, subdermal, true);
if (TryComp(recipient, out ActorComponent? actor))
_ui.TryClose(donorImplant, StoreUiKey.Key, actor.PlayerSession);
}
}

View File

@@ -165,16 +165,13 @@
- type: Armor
modifiers:
coefficients:
Blunt: 0.4
Slash: 0.4
Piercing: 0.5
Heat: 0.4
Blunt: 0.5
Slash: 0.5
Piercing: 0.6
Heat: 0.5
- type: ExplosionResistance
damageCoefficient: 0.5
- type: GroupExamine
- type: ClothingSpeedModifier
walkModifier: 0.85
sprintModifier: 0.85
- type: Unremoveable
deleteOnDrop: true
- type: ClothingModifyChemicalRegen