diff --git a/Content.Shared/Projectiles/SharedProjectileSystem.cs b/Content.Shared/Projectiles/SharedProjectileSystem.cs index 56ffc3c597..f2bd664cf8 100644 --- a/Content.Shared/Projectiles/SharedProjectileSystem.cs +++ b/Content.Shared/Projectiles/SharedProjectileSystem.cs @@ -39,7 +39,10 @@ public abstract partial class SharedProjectileSystem : EntitySystem SubscribeLocalEvent(OnEmbedActivate); SubscribeLocalEvent(OnEmbedRemove); SubscribeLocalEvent(OnAttemptPacifiedThrow); + SubscribeLocalEvent(OnLand); // WD + SubscribeLocalEvent(OnRemove); // WD + SubscribeLocalEvent(OnEntityTerminating); // WD } private void OnEmbedActivate(EntityUid uid, EmbeddableProjectileComponent component, ActivateInWorldEvent args) @@ -201,6 +204,26 @@ public abstract partial class SharedProjectileSystem : EntitySystem } // WD EDIT START + private void OnEntityTerminating(EntityUid uid, EmbeddableProjectileComponent component, + ref EntityTerminatingEvent args) + { + FreePenetrated(component); + } + + private void OnRemove(EntityUid uid, EmbeddableProjectileComponent component, ComponentRemove args) + { + FreePenetrated(component); + } + + private void FreePenetrated(EmbeddableProjectileComponent component) + { + if (component.PenetratedUid == null) + return; + + _penetratedSystem.FreePenetrated(component.PenetratedUid.Value); + component.PenetratedUid = null; + } + private void OnLand(EntityUid uid, EmbeddableProjectileComponent component, ref LandEvent args) { if (component.PenetratedUid == null) diff --git a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml index 0bffa07dc0..9ece9a39a8 100644 --- a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml +++ b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml @@ -1,4 +1,4 @@ -- type: entity +- type: entity parent: BaseMob id: BaseBorgChassis name: cyborg @@ -205,6 +205,7 @@ - type: GuideHelp guides: - Cyborgs + - type: Penetrated - type: entity id: BaseBorgChassisNT diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/argocyte.yml b/Resources/Prototypes/Entities/Mobs/NPCs/argocyte.yml index 472daed59b..30eda6af0b 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/argocyte.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/argocyte.yml @@ -1,4 +1,4 @@ -- type: entity +- type: entity save: false parent: [ BaseSimpleMob, MobCombat ] id: BaseMobArgocyte @@ -82,6 +82,7 @@ damage: types: Blunt: 3 + - type: Penetrated - type: entity parent: BaseMobArgocyte @@ -120,6 +121,7 @@ damage: types: Blunt: 3 + - type: Penetrated - type: entity parent: BaseMobArgocyte @@ -156,6 +158,7 @@ damage: types: Slash: 3 + - type: Penetrated - type: entity parent: BaseMobArgocyte @@ -179,6 +182,7 @@ 60: Dead - type: MovementSpeedModifier baseSprintSpeed : 5 + - type: Penetrated - type: entity parent: BaseMobArgocyte @@ -202,6 +206,7 @@ - type: MovementSpeedModifier baseSprintSpeed : 4 baseWalkSpeed : 3.5 + - type: Penetrated - type: entity parent: BaseMobArgocyte @@ -227,6 +232,7 @@ types: Blunt: 2.5 Slash: 7.5 + - type: Penetrated - type: entity parent: BaseMobArgocyte @@ -255,6 +261,7 @@ - type: MovementSpeedModifier baseSprintSpeed : 5 baseWalkSpeed: 4.5 + - type: Penetrated - type: entity parent: BaseMobArgocyte @@ -281,6 +288,7 @@ Blunt: 5 Slash: 10 Structural: 5 + - type: Penetrated - type: entity parent: BaseMobArgocyte @@ -311,6 +319,7 @@ - type: MovementSpeedModifier baseSprintSpeed : 6.5 baseWalkSpeed: 5 + - type: Penetrated - type: entity parent: BaseMobArgocyte @@ -340,6 +349,7 @@ - type: MovementSpeedModifier baseSprintSpeed : 3.5 baseWalkSpeed: 3 + - type: Penetrated - type: entity parent: BaseMobArgocyte diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml b/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml index 7308267473..157a0e2ef7 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml @@ -79,6 +79,7 @@ interactFailureString: petting-failure-carp interactFailureSound: path: /Audio/Effects/bite.ogg + - type: Penetrated - type: entity parent: BaseMobCarp diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml b/Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml index 483659f1c1..4da2994f88 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml @@ -73,6 +73,7 @@ - type: InputMover - type: MobMover - type: ZombieImmune + - type: Penetrated - type: entity abstract: true diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/lavaland.yml b/Resources/Prototypes/Entities/Mobs/NPCs/lavaland.yml index edbfb5bf12..eaa6a09b15 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/lavaland.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/lavaland.yml @@ -1,4 +1,4 @@ -- type: entity +- type: entity name: watcher id: MobWatcherBase parent: [ SimpleSpaceMobBase, FlyingMobBase ] @@ -69,6 +69,7 @@ interactFailureString: petting-failure-generic interactSuccessSound: path: /Audio/Animals/lizard_happy.ogg + - type: Penetrated - type: entity id: MobWatcherLavaland diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml b/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml index de20451463..2d361cb882 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml @@ -107,6 +107,7 @@ - type: TypingIndicator proto: robot - type: ZombieImmune + - type: Penetrated - type: entity parent: [ MobSiliconBase, BaseVehicle] diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/simplemob.yml b/Resources/Prototypes/Entities/Mobs/NPCs/simplemob.yml index edf89e30b4..e1b80a2771 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/simplemob.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/simplemob.yml @@ -106,4 +106,5 @@ - type: FloatingVisuals - type: Puller needsHands: True + - type: Penetrated diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml b/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml index 41fb6a5eec..22f476cebf 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml @@ -1,4 +1,4 @@ -- type: entity +- type: entity name: basic slime id: MobAdultSlimes parent: [ SimpleMobBase, MobCombat ] diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/space.yml b/Resources/Prototypes/Entities/Mobs/NPCs/space.yml index 75f717a9d1..21d9947b62 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/space.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/space.yml @@ -67,6 +67,7 @@ - type: GhostTakeoverAvailable - type: Speech speechVerb: LargeMob + - type: Penetrated - type: entity name: space bear diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/spacetick.yml b/Resources/Prototypes/Entities/Mobs/NPCs/spacetick.yml index 0a2b4f80bb..b164d05d4b 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/spacetick.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/spacetick.yml @@ -79,6 +79,7 @@ - type: Speech speechVerb: SmallMob - type: NonSpreaderZombie + - type: Penetrated - type: entity id: MobTickSalvage