From 7d65e16649c919ed9992f05d5e2179daaa070b05 Mon Sep 17 00:00:00 2001 From: Roudenn Date: Thu, 9 Jan 2025 20:07:23 +0300 Subject: [PATCH] Hotfix Healing --- .../Backmen/Blob/Systems/BlobTileSystem.cs | 13 ++++++++----- .../Backmen/Blob/SharedBlobTileSystem.cs | 18 +++++++++++++++++- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Content.Server/Backmen/Blob/Systems/BlobTileSystem.cs b/Content.Server/Backmen/Blob/Systems/BlobTileSystem.cs index 63b1c8f3efd..fc5b7ad2455 100644 --- a/Content.Server/Backmen/Blob/Systems/BlobTileSystem.cs +++ b/Content.Server/Backmen/Blob/Systems/BlobTileSystem.cs @@ -169,14 +169,17 @@ private void OnPulsed(EntityUid uid, BlobTileComponent component, BlobTileGetPul private void HealTile(Entity ent, Entity core) { - var healCore = ent.Comp.HealthOfPulse; + var healCore = new DamageSpecifier(); + var modifier = 1.0f; if (core.Comp.CurrentChem == BlobChemType.RegenerativeMateria) { - foreach (var keyValuePair in ent.Comp.HealthOfPulse.DamageDict) - { - healCore.DamageDict.Add(keyValuePair.Key, keyValuePair.Value * 2); - } + modifier = 2.0f; + } + + foreach (var keyValuePair in ent.Comp.HealthOfPulse.DamageDict) + { + healCore.DamageDict.TryAdd(keyValuePair.Key, keyValuePair.Value * modifier); } _damageableSystem.TryChangeDamage(ent, healCore); diff --git a/Content.Shared/Backmen/Blob/SharedBlobTileSystem.cs b/Content.Shared/Backmen/Blob/SharedBlobTileSystem.cs index 2e79aa9164a..fceefc872b3 100644 --- a/Content.Shared/Backmen/Blob/SharedBlobTileSystem.cs +++ b/Content.Shared/Backmen/Blob/SharedBlobTileSystem.cs @@ -1,10 +1,14 @@ -using Content.Shared.Backmen.Blob.Components; +using System.Numerics; +using Content.Shared.Backmen.Blob.Components; using Content.Shared.Verbs; +using Robust.Shared.Player; namespace Content.Shared.Backmen.Blob; public abstract class SharedBlobTileSystem : EntitySystem { + [Dependency] private readonly SharedTransformSystem _transform = default!; + protected EntityQuery ObserverQuery; protected EntityQuery CoreQuery; protected EntityQuery TransformQuery; @@ -42,4 +46,16 @@ private void AddUpgradeVerb(EntityUid uid, BlobUpgradeableTileComponent comp, Ge }; args.Verbs.Add(verb); } + + public void DoLunge(EntityUid from, EntityUid target) + { + if(!TransformQuery.TryComp(from, out var userXform)) + return; + + var targetPos = _transform.GetWorldPosition(target); + var localPos = Vector2.Transform(targetPos, _transform.GetInvWorldMatrix(userXform)); + localPos = userXform.LocalRotation.RotateVec(localPos); + + RaiseNetworkEvent(new BlobAttackEvent(GetNetEntity(from), GetNetEntity(target), localPos), Filter.Pvs(from)); + } }