Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Content.Server/Damage/Systems/DamageOnLandSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
//
// SPDX-License-Identifier: AGPL-3.0-or-later

using Content.Shared._Adventure.Bartender.Systems; // Adventure
using Content.Server.Damage.Components;
using Content.Shared.Damage;
using Content.Shared.Throwing;
using Content.Shared.Chemistry.EntitySystems; // Omu - Make Beer Goggles Cool Again (MBGCA)

namespace Content.Server.Damage.Systems
{
Expand All @@ -20,6 +22,8 @@ namespace Content.Server.Damage.Systems
public sealed class DamageOnLandSystem : EntitySystem
{
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly SpillProofThrowerSystem _nonspillthrower = default!; // Adventure
[Dependency] private readonly SharedSolutionContainerSystem _solutions = default!; // Omu (MBGCA)

public override void Initialize()
{
Expand All @@ -29,7 +33,15 @@ public override void Initialize()

private void DamageOnLand(EntityUid uid, DamageOnLandComponent component, ref LandEvent args)
{
// Adventure start: Drinks thrown while wearing beer goggles do not take damage
if (args.User is { } user
&& _nonspillthrower.GetSpillProofThrow(user)
&& _solutions.TryGetSolution(uid, "drink", out _))
{
return;
}
// Adventure end
_damageableSystem.TryChangeDamage(uid, component.Damage, component.IgnoreResistances);
}
}
}
}
20 changes: 20 additions & 0 deletions Content.Server/Damage/Systems/DamageOtherOnHitSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Physics.Components;
using Robust.Shared.Player;
using Content.Shared._Adventure.Bartender.Systems; // GabyStation (Adventure)
using Content.Shared.Chemistry.EntitySystems; // Omu - Make Beer Goggles Cool Again (MBGCA)

namespace Content.Server.Damage.Systems
{
Expand All @@ -83,6 +85,8 @@ public sealed class DamageOtherOnHitSystem : EntitySystem
[Dependency] private readonly DamageExamineSystem _damageExamine = default!;
[Dependency] private readonly SharedCameraRecoilSystem _sharedCameraRecoil = default!;
[Dependency] private readonly SharedColorFlashEffectSystem _color = default!;
[Dependency] private readonly SpillProofThrowerSystem _nonspillthrower = default!; // GabyStation (Adventure)
[Dependency] private readonly SharedSolutionContainerSystem _solutions = default!; // Omu (MBGCA)

public override void Initialize()
{
Expand All @@ -99,6 +103,15 @@ private void OnDoHit(EntityUid uid, DamageOtherOnHitComponent component, ThrowDo
if(args.Target == args.Component.Thrower) // Goobstation - Mjolnir
return;

// Omu Starts - Prevents thrown drinks from dealing damage when the thrower is wearing beer goggles (MBGCA)
if (args.Component.Thrower is { } thrower
&& _nonspillthrower.GetSpillProofThrow(thrower)
&& _solutions.TryGetSolution(uid, "drink", out _))
{
return;
}
// Omu ends

var dmg = _damageable.TryChangeDamage(args.Target, component.Damage * _damageable.UniversalThrownDamageModifier, component.IgnoreResistances, origin: args.Component.Thrower);

// For stuff that cares about it being attacked.
Expand Down Expand Up @@ -132,6 +145,13 @@ private void OnDamageExamine(EntityUid uid, DamageOtherOnHitComponent component,
/// </summary>
private void OnAttemptPacifiedThrow(Entity<DamageOtherOnHitComponent> ent, ref AttemptPacifiedThrowEvent args)
{
// GabyStation start - Pacified players wearing beer goggles can now perform throws.
if (_nonspillthrower.GetSpillProofThrow(args.PlayerUid)
&& _solutions.TryGetSolution(ent.Owner, "drink", out _)) // Omu - Pacified players are restricted to throwing only drinks.
{
return;
}
// GabyStation end
args.Cancel("pacified-cannot-throw");
}
}
Expand Down
12 changes: 12 additions & 0 deletions Content.Server/Fluids/EntitySystems/PuddleSystem.Spillable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@

using Content.Goobstation.Common.Solutions;
using Content.Shared.Chemistry.Components;
using Content.Shared._Adventure.Bartender.Systems; // Adventure
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Chemistry.Reaction;
using Content.Shared.Chemistry;
Expand All @@ -70,11 +71,14 @@
using Content.Shared.Throwing;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Player;
using Robust.Shared.Physics.Systems; // Adventure

namespace Content.Server.Fluids.EntitySystems;

public sealed partial class PuddleSystem
{
[Dependency] private readonly SharedPhysicsSystem _physics = default!; // Adventure
[Dependency] private readonly SpillProofThrowerSystem _nonspillthrower = default!; // Adventure
protected override void InitializeSpillable()
{
base.InitializeSpillable();
Expand Down Expand Up @@ -175,6 +179,14 @@ private void SpillOnLand(Entity<SpillableComponent> entity, ref LandEvent args)

if (args.User != null)
{
// Adventure start
if (_nonspillthrower.GetSpillProofThrow(args.User.Value))
{
_physics.SetAngularVelocity(entity, 0);
Transform(entity).LocalRotation = Angle.Zero;
return;
}
// Adventure end
_adminLogger.Add(LogType.Landed,
$"{ToPrettyString(entity.Owner):entity} spilled a solution {SharedSolutionContainerSystem.ToPrettyString(solution):solution} on landing");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Robust.Shared.Network;
using Content.Shared.Fluids;
using Content.Shared.Popups;
using Content.Shared._Adventure.Bartender.Systems; // Omu - Make Beer Goggles Cool Again (MBGCA)

namespace Content.Shared.Nutrition.EntitySystems;

Expand All @@ -33,6 +34,7 @@ public sealed partial class PressurizedSolutionSystem : EntitySystem
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SpillProofThrowerSystem _nonspillthrower = default!; // Omu (MBGCA)
public override void Initialize()
{
base.Initialize();
Expand Down Expand Up @@ -269,6 +271,13 @@ private void OnShake(Entity<PressurizedSolutionComponent> entity, ref ShakeEvent

private void OnLand(Entity<PressurizedSolutionComponent> entity, ref LandEvent args)
{
// Omu start: Allows players wearing beer goggles to throw drinks without causing sprays or increasing fizziness (MBGCA)
if (args.User is { } user && _nonspillthrower.GetSpillProofThrow(user))
{
TryClearFizziness(new Entity<PressurizedSolutionComponent?>(entity.Owner, entity.Comp));
return;
}
// Omu end
SprayOrAddFizziness(entity, entity.Comp.SprayChanceModOnLand, entity.Comp.FizzinessAddedOnLand);
}

Expand All @@ -289,4 +298,4 @@ private void OnSolutionUpdate(Entity<PressurizedSolutionComponent> entity, ref S
public record struct AttemptAddFizzinessEvent(Entity<PressurizedSolutionComponent> Entity, float Amount)
{
public bool Cancelled;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// SPDX-FileCopyrightText: 2026 Space Station 14 Contributors
//
// SPDX-License-Identifier: AGPL-3.0-or-later

using Robust.Shared.GameStates;

namespace Content.Shared._Adventure.Bartender.Components;

[RegisterComponent, NetworkedComponent]
public sealed partial class SpillProofThrowerComponent : Component;
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// SPDX-FileCopyrightText: 2026 Space Station 14 Contributors
//
// SPDX-License-Identifier: AGPL-3.0-or-later

using Content.Shared.Inventory;
using Content.Shared._Adventure.Bartender.Components;

namespace Content.Shared._Adventure.Bartender.Systems;

public sealed class SpillProofThrowerSystem : EntitySystem
{
[Dependency] private readonly InventorySystem _inventory = default!;

public override void Initialize()
{
base.Initialize();

Subs.SubscribeWithRelay<SpillProofThrowerComponent, SpillProofThrowEvent>(OnSpillProofThrowAttempt);
SubscribeLocalEvent<InventoryComponent, SpillProofThrowEvent>(_inventory.RelayEvent);
}

public bool GetSpillProofThrow(EntityUid playeruid)
{
var nonSpillThrowEvent = new SpillProofThrowEvent();
RaiseLocalEvent(playeruid, ref nonSpillThrowEvent);
return nonSpillThrowEvent.NonSpillThrow;
}

private void OnSpillProofThrowAttempt(Entity<SpillProofThrowerComponent> ent, ref SpillProofThrowEvent args)
{
args.NonSpillThrow = true;
}
}

[ByRefEvent]
public record struct SpillProofThrowEvent(bool NonSpillThrow = false) : IInventoryRelayEvent
{
SlotFlags IInventoryRelayEvent.TargetSlots => SlotFlags.HEAD | SlotFlags.MASK | SlotFlags.EYES;
}
1 change: 1 addition & 0 deletions Resources/Prototypes/Entities/Clothing/Eyes/hud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
- type: ShowThirstIcons
- type: StealTarget
stealGroup: ClothingEyesHudBeer
- type: SpillProofThrower # Adventure
- type: SolutionScanner
- type: Tag
tags:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@
- state: icon-front
map: [ "enum.SolutionContainerLayers.Overlay" ]
- type: Appearance
- type: Drink # Adventure
- type: SolutionContainerManager
solutions:
drink:
Expand Down
Loading