Skip to content

Commit

Permalink
Hotfix Healing
Browse files Browse the repository at this point in the history
  • Loading branch information
Roudenn committed Jan 9, 2025
1 parent ec2e67f commit 7d65e16
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
13 changes: 8 additions & 5 deletions Content.Server/Backmen/Blob/Systems/BlobTileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,17 @@ private void OnPulsed(EntityUid uid, BlobTileComponent component, BlobTileGetPul

private void HealTile(Entity<BlobTileComponent> ent, Entity<BlobCoreComponent> 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);
Expand Down
18 changes: 17 additions & 1 deletion Content.Shared/Backmen/Blob/SharedBlobTileSystem.cs
Original file line number Diff line number Diff line change
@@ -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<BlobObserverComponent> ObserverQuery;
protected EntityQuery<BlobCoreComponent> CoreQuery;
protected EntityQuery<TransformComponent> TransformQuery;
Expand Down Expand Up @@ -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));
}
}

0 comments on commit 7d65e16

Please sign in to comment.