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)
|
||||
{
|
||||
if (TryComp<PhysicsComponent>(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);
|
||||
|
||||
@@ -25,6 +25,12 @@ public sealed class GlassTableComponent : Component
|
||||
[DataField("tableDamage")]
|
||||
public DamageSpecifier TableDamage = default!;
|
||||
|
||||
/// <summary>
|
||||
/// How much mass should be needed to break the table?
|
||||
/// </summary>
|
||||
[DataField("tableMassLimit")]
|
||||
public float MassLimit;
|
||||
|
||||
/// <summary>
|
||||
/// How long should someone who climbs on this table be stunned for?
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user