Files
Delta-v/Content.Server/Damage/Systems/DamageOnLandSystem.cs
T
0vrseerandpre-commit-ci[bot] cb8f11b1eb Beer googles function as their description states. (#4091)
* SafeSolutionThrower Component

* Edge cases + poor attempt at angle fixing

* PhysicsSystem to fix rotation

* newline accidental

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* I hope the dv init relay isn't slop

* fix spacing

* RefRelayInventoryEvent is a protected method

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-08-03 08:35:20 +00:00

36 lines
1.4 KiB
C#

using Content.Server.Damage.Components;
using Content.Shared.Damage;
using Content.Shared.Throwing;
using Content.Shared._DV.Chemistry.Systems; // DeltaV - Beergoggles enable safe throw
using Content.Shared.Nutrition.Components; // DeltaV - Beergoggles enable safe throw
namespace Content.Server.Damage.Systems
{
/// <summary>
/// Damages the thrown item when it lands.
/// </summary>
public sealed class DamageOnLandSystem : EntitySystem
{
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly SafeSolutionThrowerSystem _safesolthrower = default!; // DeltaV - Beergoggles enable safe throw
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<DamageOnLandComponent, LandEvent>(DamageOnLand);
}
private void DamageOnLand(EntityUid uid, DamageOnLandComponent component, ref LandEvent args)
{
// DeltaV - start of Beergoggles enable safe throw
if (args.User is { } user && HasComp<DrinkComponent>(uid))
{
if (_safesolthrower.GetSafeThrow(user))
return;
}
// DeltaV - end of Beergoggles enable safe throw
_damageableSystem.TryChangeDamage(uid, component.Damage, component.IgnoreResistances);
}
}
}