[Feat] Система лежания и снаряды теперь проходят через лежащих людей, если не целиться в них (#195)

* add: система лежания и вставания

* add: теперь по-умолчанию по лежачим не попадают снаряды

* add: только гуманоиды могут ложиться
This commit is contained in:
Remuchi
2024-03-21 09:54:11 +07:00
committed by GitHub
parent 1b2b313804
commit 673d26f918
17 changed files with 411 additions and 158 deletions

View File

@@ -42,9 +42,19 @@ public sealed class ProjectileSystem : SharedProjectileSystem
// This is so entities that shouldn't get a collision are ignored.
if (args.OurFixtureId != ProjectileFixture || !args.OtherFixture.Hard
|| component.DamagedEntity || component is { Weapon: null, OnlyCollideWhenShot: true })
{
return;
}
var target = args.OtherEntity;
var collideAttemptEv = new ProjectileCollideAttemptEvent(uid, component, false);
RaiseLocalEvent(target, ref collideAttemptEv);
if (collideAttemptEv.Cancelled)
{
return;
}
// it's here so this check is only done once before possible hit
var attemptEv = new ProjectileReflectAttemptEvent(uid, component, false);
RaiseLocalEvent(target, ref attemptEv);