[Feat] Система лежания и снаряды теперь проходят через лежащих людей, если не целиться в них (#195)
* add: система лежания и вставания * add: теперь по-умолчанию по лежачим не попадают снаряды * add: только гуманоиды могут ложиться
This commit is contained in:
@@ -229,6 +229,9 @@ public sealed partial class GunComponent : Component
|
||||
public bool ClumsyProof = false;
|
||||
|
||||
// WD START
|
||||
|
||||
public EntityUid? Target;
|
||||
|
||||
[DataField("forceThrowingAngle")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool ForceThrowingAngle;
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace Content.Shared.Weapons.Ranged.Events;
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class RequestShootEvent : EntityEventArgs
|
||||
{
|
||||
public NetEntity? Target;
|
||||
public NetEntity Gun;
|
||||
public NetCoordinates Coordinates;
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@ public abstract partial class SharedGunSystem : EntitySystem
|
||||
return;
|
||||
|
||||
gun.ShootCoordinates = GetCoordinates(msg.Coordinates);
|
||||
gun.Target = GetEntity(msg.Target);
|
||||
Log.Debug($"Set shoot coordinates to {gun.ShootCoordinates}");
|
||||
AttemptShoot(user.Value, ent, gun);
|
||||
}
|
||||
@@ -558,6 +559,12 @@ public abstract partial class SharedGunSystem : EntitySystem
|
||||
[ByRefEvent]
|
||||
public record struct AttemptShootEvent(EntityUid User, string? Message, bool Cancelled = false, bool ThrowItems = false);
|
||||
|
||||
/// <summary>
|
||||
/// Raised when an entity is just about to be hit with a hitscan
|
||||
/// </summary>
|
||||
[ByRefEvent]
|
||||
public record struct HitscanHitAttemptEvent(EntityUid HitEntity, EntityUid? Target, bool Cancelled = false);
|
||||
|
||||
/// <summary>
|
||||
/// Raised directed on the gun after firing.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user