Chain link fencing (#18956)

This commit is contained in:
Kara
2023-08-10 07:16:25 -07:00
committed by GitHub
parent c10b01c465
commit baddcf1b26
21 changed files with 587 additions and 4 deletions

View File

@@ -20,6 +20,7 @@ using Content.Shared.Physics;
using Content.Shared.Popups;
using Content.Shared.Verbs;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Collision.Shapes;
@@ -35,6 +36,7 @@ namespace Content.Server.Climbing;
public sealed class ClimbSystem : SharedClimbSystem
{
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
[Dependency] private readonly AudioSystem _audio = default!;
[Dependency] private readonly BodySystem _bodySystem = default!;
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
@@ -133,6 +135,7 @@ public sealed class ClimbSystem : SharedClimbSystem
BreakOnDamage = true
};
_audio.PlayPvs(comp.StartClimbSound, climbable);
_doAfterSystem.TryStartDoAfter(args, out id);
return true;
}
@@ -148,17 +151,21 @@ public sealed class ClimbSystem : SharedClimbSystem
}
private void Climb(EntityUid uid, EntityUid user, EntityUid instigator, EntityUid climbable, bool silent = false, ClimbingComponent? climbing = null,
PhysicsComponent? physics = null, FixturesComponent? fixtures = null)
PhysicsComponent? physics = null, FixturesComponent? fixtures = null, ClimbableComponent? comp = null)
{
if (!Resolve(uid, ref climbing, ref physics, ref fixtures, false))
return;
if (!Resolve(climbable, ref comp))
return;
if (!ReplaceFixtures(climbing, fixtures))
return;
climbing.IsClimbing = true;
Dirty(climbing);
_audio.PlayPvs(comp.FinishClimbSound, climbable);
MoveEntityToward(uid, climbable, physics, climbing);
// we may potentially need additional logic since we're forcing a player onto a climbable
// there's also the cases where the user might collide with the person they are forcing onto the climbable that i haven't accounted for