Add puller sanity test (#24885)

* Add puller sanity test

* weh

* NRTs

(cherry picked from commit 641fb665b7831b76aeb7ee3d22da8d947be2c5a8)
This commit is contained in:
metalgearsloth 2024-02-03 02:51:05 +01:00 committed by Debug
parent 0c0d9cda95
commit 00586dd79f
No known key found for this signature in database
GPG Key ID: 271270A74EF9C350
2 changed files with 48 additions and 24 deletions

View File

@ -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
{
/// <summary>
/// Checks that needsHands on PullerComponent is not set on mobs that don't even have hands.
/// </summary>
[Test]
public async Task PullerSanityTest()
{
await using var pair = await PoolManager.GetServerClient();
var server = pair.Server;
var compFactory = server.ResolveDependency<IComponentFactory>();
var protoManager = server.ResolveDependency<IPrototypeManager>();
await server.WaitAssertion(() =>
{
Assert.Multiple(() =>
{
foreach (var proto in protoManager.EnumeratePrototypes<EntityPrototype>())
{
if (!proto.TryGetComponent(out SharedPullerComponent? puller))
continue;
if (!puller.NeedsHands)
continue;
Assert.That(proto.HasComponent<HandsComponent>(compFactory), $"Found puller {proto} with NeedsHand pulling but has no hands?");
}
});
});
await pair.CleanReturnAsync();
}
}

View File

@ -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: Extractable # DeltaV - Make it so bees can be ground up
grindableSolutionName: bee
- type: SolutionContainerManager
@ -237,12 +233,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
@ -267,7 +261,7 @@
Base: dead-1
Dead:
Base: dead-1
- type: entity
parent: MobChicken
id: MobChicken2
@ -536,8 +530,6 @@
prototype: Mothroach
- type: TypingIndicator
proto: moth
- type: Puller
needsHands: true
- type: Destructible
thresholds:
- trigger:
@ -713,8 +705,6 @@
bloodMaxVolume: 0.1
- type: MobPrice
price: 50
- type: Puller
needsHands: true
- type: entity
name: cow
@ -997,7 +987,6 @@
path: /Audio/Animals/goose_honk.ogg
- type: Bloodstream
bloodMaxVolume: 100
- type: Puller
- type: NpcFactionMember
factions:
- Passive
@ -1054,7 +1043,6 @@
- type: HTN
rootTask:
task: SimpleHostileCompound
- type: Puller
- type: entity
name: kangaroo
@ -1313,7 +1301,7 @@
- type: GhostTakeoverAvailable
- type: Loadout
prototypes: [SyndicateOperativeGearMonkey]
- type: entity
id: MobMonkeySyndicateAgent
parent: MobBaseSyndicateMonkey
@ -1601,8 +1589,6 @@
- type: CanEscapeInventory
- type: MobPrice
price: 50
- type: Puller
needsHands: true
- type: FelinidFood # Nyanotrasen - Felinid, ability to eat mice, see Content.Server/Nyanotrasen/Abilities/Felinid/FelinidSystem.cs
- type: BadFood
- type: NonSpreaderZombie
@ -1736,8 +1722,6 @@
- type: Damageable
damageContainer: Biological
damageModifierSet: Scale
- type: Puller
needsHands: true
- type: Tag
tags:
- VimPilot
@ -1841,8 +1825,6 @@
path: /Audio/Animals/frog_ribbit.ogg
- type: Bloodstream
bloodMaxVolume: 50
- type: Puller
needsHands: true
- type: Tag
tags:
- VimPilot
@ -2067,8 +2049,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.
@ -2513,7 +2493,6 @@
gender: epicene
- type: SentienceTarget
flavorKind: station-event-random-sentience-flavor-corgi
- type: Puller
- type: MobPrice
price: 200
- type: Tag