From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Sat, 3 Feb 2024 01:51:05 +0000 (+1100) Subject: Add puller sanity test (#24885) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=641fb665b7831b76aeb7ee3d22da8d947be2c5a8;p=space-station-14.git Add puller sanity test (#24885) * Add puller sanity test * weh * NRTs --- diff --git a/Content.IntegrationTests/Tests/Puller/PullerTest.cs b/Content.IntegrationTests/Tests/Puller/PullerTest.cs new file mode 100644 index 0000000000..ba91f54ff7 --- /dev/null +++ b/Content.IntegrationTests/Tests/Puller/PullerTest.cs @@ -0,0 +1,45 @@ +using Content.Shared.Hands.Components; +using Content.Shared.Prototypes; +using Content.Shared.Pulling.Components; +using Robust.Shared.GameObjects; +using Robust.Shared.Prototypes; + +namespace Content.IntegrationTests.Tests.Puller; + +#nullable enable + +[TestFixture] +public sealed class PullerTest +{ + /// + /// Checks that needsHands on PullerComponent is not set on mobs that don't even have hands. + /// + [Test] + public async Task PullerSanityTest() + { + await using var pair = await PoolManager.GetServerClient(); + var server = pair.Server; + + var compFactory = server.ResolveDependency(); + var protoManager = server.ResolveDependency(); + + await server.WaitAssertion(() => + { + Assert.Multiple(() => + { + foreach (var proto in protoManager.EnumeratePrototypes()) + { + if (!proto.TryGetComponent(out SharedPullerComponent? puller)) + continue; + + if (!puller.NeedsHands) + continue; + + Assert.That(proto.HasComponent(compFactory), $"Found puller {proto} with NeedsHand pulling but has no hands?"); + } + }); + }); + + await pair.CleanReturnAsync(); + } +} diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index 07df41119a..6087123b43 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -58,8 +58,6 @@ damage: types: Piercing: 5 - - type: Puller - needsHands: true - type: Tag tags: - VimPilot @@ -122,8 +120,6 @@ - type: HTN rootTask: task: SimpleHostileCompound - - type: Puller - needsHands: true - type: ZombieImmune - type: entity @@ -229,12 +225,10 @@ accent: chicken - type: SentienceTarget flavorKind: station-event-random-sentience-flavor-organic - - type: Puller - needsHands: true - type: NpcFactionMember factions: - Passive - + - type: entity parent: MobChicken id: MobChicken1 @@ -259,7 +253,7 @@ Base: dead-1 Dead: Base: dead-1 - + - type: entity parent: MobChicken id: MobChicken2 @@ -524,8 +518,6 @@ prototype: Mothroach - type: TypingIndicator proto: moth - - type: Puller - needsHands: true - type: Destructible thresholds: - trigger: @@ -701,8 +693,6 @@ bloodMaxVolume: 0.1 - type: MobPrice price: 50 - - type: Puller - needsHands: true - type: entity name: cow @@ -985,7 +975,6 @@ path: /Audio/Animals/goose_honk.ogg - type: Bloodstream bloodMaxVolume: 100 - - type: Puller - type: NpcFactionMember factions: - Passive @@ -1042,7 +1031,6 @@ - type: HTN rootTask: task: SimpleHostileCompound - - type: Puller - type: entity name: kangaroo @@ -1301,7 +1289,7 @@ - type: GhostTakeoverAvailable - type: Loadout prototypes: [SyndicateOperativeGearMonkey] - + - type: entity id: MobMonkeySyndicateAgent parent: MobBaseSyndicateMonkey @@ -1589,8 +1577,6 @@ - type: CanEscapeInventory - type: MobPrice price: 50 - - type: Puller - needsHands: true - type: BadFood - type: NonSpreaderZombie - type: PreventSpiller @@ -1723,8 +1709,6 @@ - type: Damageable damageContainer: Biological damageModifierSet: Scale - - type: Puller - needsHands: true - type: Tag tags: - VimPilot @@ -1828,8 +1812,6 @@ path: /Audio/Animals/frog_ribbit.ogg - type: Bloodstream bloodMaxVolume: 50 - - type: Puller - needsHands: true - type: Tag tags: - VimPilot @@ -2054,8 +2036,6 @@ - type: Damageable damageContainer: Biological damageModifierSet: Scale - - type: Puller - needsHands: true # Code unique spider prototypes or combine them all into one spider and get a # random sprite state when you spawn it. @@ -2499,7 +2479,6 @@ gender: epicene - type: SentienceTarget flavorKind: station-event-random-sentience-flavor-corgi - - type: Puller - type: MobPrice price: 200 - type: Tag