From 075f18c2777b6f7a0a49a821209f37966c646ac3 Mon Sep 17 00:00:00 2001 From: wrexbe <81056464+wrexbe@users.noreply.github.com> Date: Wed, 2 Mar 2022 06:07:48 -0800 Subject: [PATCH] Check mass on climb glass table (#6959) Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> --- Content.Server/Climbing/ClimbSystem.cs | 2 ++ Content.Server/Climbing/Components/GlassTableComponent.cs | 6 ++++++ .../Entities/Structures/Furniture/Tables/tables.yml | 3 +++ 3 files changed, 11 insertions(+) diff --git a/Content.Server/Climbing/ClimbSystem.cs b/Content.Server/Climbing/ClimbSystem.cs index f25fa1a373..104c0f7314 100644 --- a/Content.Server/Climbing/ClimbSystem.cs +++ b/Content.Server/Climbing/ClimbSystem.cs @@ -72,6 +72,8 @@ namespace Content.Server.Climbing private void OnGlassClimbed(EntityUid uid, GlassTableComponent component, ClimbedOnEvent args) { + if (TryComp(args.Climber, out var physics) && physics.Mass <= component.MassLimit) + return; _damageableSystem.TryChangeDamage(args.Climber, component.ClimberDamage); _damageableSystem.TryChangeDamage(uid, component.TableDamage); _stunSystem.TryParalyze(args.Climber, TimeSpan.FromSeconds(component.StunTime), true); diff --git a/Content.Server/Climbing/Components/GlassTableComponent.cs b/Content.Server/Climbing/Components/GlassTableComponent.cs index a61c81ca1e..10a3445d21 100644 --- a/Content.Server/Climbing/Components/GlassTableComponent.cs +++ b/Content.Server/Climbing/Components/GlassTableComponent.cs @@ -25,6 +25,12 @@ public sealed class GlassTableComponent : Component [DataField("tableDamage")] public DamageSpecifier TableDamage = default!; + /// + /// How much mass should be needed to break the table? + /// + [DataField("tableMassLimit")] + public float MassLimit; + /// /// How long should someone who climbs on this table be stunned for? /// diff --git a/Resources/Prototypes/Entities/Structures/Furniture/Tables/tables.yml b/Resources/Prototypes/Entities/Structures/Furniture/Tables/tables.yml index 983bcaca83..97bf8e87d8 100644 --- a/Resources/Prototypes/Entities/Structures/Furniture/Tables/tables.yml +++ b/Resources/Prototypes/Entities/Structures/Furniture/Tables/tables.yml @@ -136,6 +136,7 @@ tableDamage: types: Blunt: 25 + tableMassLimit: 60 - type: Destructible thresholds: - trigger: @@ -175,6 +176,7 @@ tableDamage: types: Blunt: 40 + tableMassLimit: 120 - type: Destructible thresholds: - trigger: @@ -223,6 +225,7 @@ tableDamage: types: Blunt: 100 + tableMassLimit: 240 - type: Destructible thresholds: - trigger: