Check mass on climb glass table (#6959)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -72,6 +72,8 @@ namespace Content.Server.Climbing
|
|||||||
|
|
||||||
private void OnGlassClimbed(EntityUid uid, GlassTableComponent component, ClimbedOnEvent args)
|
private void OnGlassClimbed(EntityUid uid, GlassTableComponent component, ClimbedOnEvent args)
|
||||||
{
|
{
|
||||||
|
if (TryComp<PhysicsComponent>(args.Climber, out var physics) && physics.Mass <= component.MassLimit)
|
||||||
|
return;
|
||||||
_damageableSystem.TryChangeDamage(args.Climber, component.ClimberDamage);
|
_damageableSystem.TryChangeDamage(args.Climber, component.ClimberDamage);
|
||||||
_damageableSystem.TryChangeDamage(uid, component.TableDamage);
|
_damageableSystem.TryChangeDamage(uid, component.TableDamage);
|
||||||
_stunSystem.TryParalyze(args.Climber, TimeSpan.FromSeconds(component.StunTime), true);
|
_stunSystem.TryParalyze(args.Climber, TimeSpan.FromSeconds(component.StunTime), true);
|
||||||
|
|||||||
@@ -25,6 +25,12 @@ public sealed class GlassTableComponent : Component
|
|||||||
[DataField("tableDamage")]
|
[DataField("tableDamage")]
|
||||||
public DamageSpecifier TableDamage = default!;
|
public DamageSpecifier TableDamage = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// How much mass should be needed to break the table?
|
||||||
|
/// </summary>
|
||||||
|
[DataField("tableMassLimit")]
|
||||||
|
public float MassLimit;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// How long should someone who climbs on this table be stunned for?
|
/// How long should someone who climbs on this table be stunned for?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -136,6 +136,7 @@
|
|||||||
tableDamage:
|
tableDamage:
|
||||||
types:
|
types:
|
||||||
Blunt: 25
|
Blunt: 25
|
||||||
|
tableMassLimit: 60
|
||||||
- type: Destructible
|
- type: Destructible
|
||||||
thresholds:
|
thresholds:
|
||||||
- trigger:
|
- trigger:
|
||||||
@@ -175,6 +176,7 @@
|
|||||||
tableDamage:
|
tableDamage:
|
||||||
types:
|
types:
|
||||||
Blunt: 40
|
Blunt: 40
|
||||||
|
tableMassLimit: 120
|
||||||
- type: Destructible
|
- type: Destructible
|
||||||
thresholds:
|
thresholds:
|
||||||
- trigger:
|
- trigger:
|
||||||
@@ -223,6 +225,7 @@
|
|||||||
tableDamage:
|
tableDamage:
|
||||||
types:
|
types:
|
||||||
Blunt: 100
|
Blunt: 100
|
||||||
|
tableMassLimit: 240
|
||||||
- type: Destructible
|
- type: Destructible
|
||||||
thresholds:
|
thresholds:
|
||||||
- trigger:
|
- trigger:
|
||||||
|
|||||||
Reference in New Issue
Block a user