Being grappled with a grapple gun allows you to cross chasms (#39983)
* Being grappled with a grapple gun allows you to cross chasms Closes #31698 * Update Content.Shared/Weapons/Misc/SharedGrapplingGunSystem.cs * AAAAAAAAAAAAAAAAA --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
@@ -40,6 +40,7 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
|
||||
SubscribeLocalEvent<CanWeightlessMoveEvent>(OnWeightlessMove);
|
||||
SubscribeAllEvent<RequestGrapplingReelMessage>(OnGrapplingReel);
|
||||
|
||||
// TODO: After step trigger refactor, dropping a grappling gun should manually try and activate step triggers it's suppressing.
|
||||
SubscribeLocalEvent<GrapplingGunComponent, GunShotEvent>(OnGrapplingShot);
|
||||
SubscribeLocalEvent<GrapplingGunComponent, ActivateInWorldEvent>(OnGunActivate);
|
||||
SubscribeLocalEvent<GrapplingGunComponent, HandDeselectedEvent>(OnGrapplingDeselected);
|
||||
@@ -203,6 +204,25 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether the entity is hooked to something via grappling gun.
|
||||
/// </summary>
|
||||
/// <param name="entity">Entity to check.</param>
|
||||
/// <returns>True if hooked, false otherwise.</returns>
|
||||
public bool IsEntityHooked(Entity<JointRelayTargetComponent?> entity)
|
||||
{
|
||||
if (!Resolve(entity, ref entity.Comp))
|
||||
return false;
|
||||
|
||||
foreach (var uid in entity.Comp.Relayed)
|
||||
{
|
||||
if (HasComp<GrapplingGunComponent>(uid))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void OnGrappleCollide(EntityUid uid, GrapplingProjectileComponent component, ref ProjectileEmbedEvent args)
|
||||
{
|
||||
if (!Timing.IsFirstTimePredicted)
|
||||
|
||||
Reference in New Issue
Block a user