Add puller sanity test (#24885)
* Add puller sanity test * weh * NRTs (cherry picked from commit 641fb665b7831b76aeb7ee3d22da8d947be2c5a8)
This commit is contained in:
parent
0c0d9cda95
commit
00586dd79f
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue