45
Content.IntegrationTests/Tests/Puller/PullerTest.cs
Normal file
45
Content.IntegrationTests/Tests/Puller/PullerTest.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -58,8 +58,6 @@
|
|||||||
damage:
|
damage:
|
||||||
types:
|
types:
|
||||||
Piercing: 5
|
Piercing: 5
|
||||||
- type: Puller
|
|
||||||
needsHands: true
|
|
||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- VimPilot
|
- VimPilot
|
||||||
@@ -122,8 +120,6 @@
|
|||||||
- type: HTN
|
- type: HTN
|
||||||
rootTask:
|
rootTask:
|
||||||
task: SimpleHostileCompound
|
task: SimpleHostileCompound
|
||||||
- type: Puller
|
|
||||||
needsHands: true
|
|
||||||
- type: ZombieImmune
|
- type: ZombieImmune
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
@@ -229,12 +225,10 @@
|
|||||||
accent: chicken
|
accent: chicken
|
||||||
- type: SentienceTarget
|
- type: SentienceTarget
|
||||||
flavorKind: station-event-random-sentience-flavor-organic
|
flavorKind: station-event-random-sentience-flavor-organic
|
||||||
- type: Puller
|
|
||||||
needsHands: true
|
|
||||||
- type: NpcFactionMember
|
- type: NpcFactionMember
|
||||||
factions:
|
factions:
|
||||||
- Passive
|
- Passive
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: MobChicken
|
parent: MobChicken
|
||||||
id: MobChicken1
|
id: MobChicken1
|
||||||
@@ -259,7 +253,7 @@
|
|||||||
Base: dead-1
|
Base: dead-1
|
||||||
Dead:
|
Dead:
|
||||||
Base: dead-1
|
Base: dead-1
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: MobChicken
|
parent: MobChicken
|
||||||
id: MobChicken2
|
id: MobChicken2
|
||||||
@@ -524,8 +518,6 @@
|
|||||||
prototype: Mothroach
|
prototype: Mothroach
|
||||||
- type: TypingIndicator
|
- type: TypingIndicator
|
||||||
proto: moth
|
proto: moth
|
||||||
- type: Puller
|
|
||||||
needsHands: true
|
|
||||||
- type: Destructible
|
- type: Destructible
|
||||||
thresholds:
|
thresholds:
|
||||||
- trigger:
|
- trigger:
|
||||||
@@ -701,8 +693,6 @@
|
|||||||
bloodMaxVolume: 0.1
|
bloodMaxVolume: 0.1
|
||||||
- type: MobPrice
|
- type: MobPrice
|
||||||
price: 50
|
price: 50
|
||||||
- type: Puller
|
|
||||||
needsHands: true
|
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: cow
|
name: cow
|
||||||
@@ -985,7 +975,6 @@
|
|||||||
path: /Audio/Animals/goose_honk.ogg
|
path: /Audio/Animals/goose_honk.ogg
|
||||||
- type: Bloodstream
|
- type: Bloodstream
|
||||||
bloodMaxVolume: 100
|
bloodMaxVolume: 100
|
||||||
- type: Puller
|
|
||||||
- type: NpcFactionMember
|
- type: NpcFactionMember
|
||||||
factions:
|
factions:
|
||||||
- Passive
|
- Passive
|
||||||
@@ -1042,7 +1031,6 @@
|
|||||||
- type: HTN
|
- type: HTN
|
||||||
rootTask:
|
rootTask:
|
||||||
task: SimpleHostileCompound
|
task: SimpleHostileCompound
|
||||||
- type: Puller
|
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: kangaroo
|
name: kangaroo
|
||||||
@@ -1301,7 +1289,7 @@
|
|||||||
- type: GhostTakeoverAvailable
|
- type: GhostTakeoverAvailable
|
||||||
- type: Loadout
|
- type: Loadout
|
||||||
prototypes: [SyndicateOperativeGearMonkey]
|
prototypes: [SyndicateOperativeGearMonkey]
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: MobMonkeySyndicateAgent
|
id: MobMonkeySyndicateAgent
|
||||||
parent: MobBaseSyndicateMonkey
|
parent: MobBaseSyndicateMonkey
|
||||||
@@ -1589,8 +1577,6 @@
|
|||||||
- type: CanEscapeInventory
|
- type: CanEscapeInventory
|
||||||
- type: MobPrice
|
- type: MobPrice
|
||||||
price: 50
|
price: 50
|
||||||
- type: Puller
|
|
||||||
needsHands: true
|
|
||||||
- type: BadFood
|
- type: BadFood
|
||||||
- type: NonSpreaderZombie
|
- type: NonSpreaderZombie
|
||||||
- type: PreventSpiller
|
- type: PreventSpiller
|
||||||
@@ -1723,8 +1709,6 @@
|
|||||||
- type: Damageable
|
- type: Damageable
|
||||||
damageContainer: Biological
|
damageContainer: Biological
|
||||||
damageModifierSet: Scale
|
damageModifierSet: Scale
|
||||||
- type: Puller
|
|
||||||
needsHands: true
|
|
||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- VimPilot
|
- VimPilot
|
||||||
@@ -1828,8 +1812,6 @@
|
|||||||
path: /Audio/Animals/frog_ribbit.ogg
|
path: /Audio/Animals/frog_ribbit.ogg
|
||||||
- type: Bloodstream
|
- type: Bloodstream
|
||||||
bloodMaxVolume: 50
|
bloodMaxVolume: 50
|
||||||
- type: Puller
|
|
||||||
needsHands: true
|
|
||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- VimPilot
|
- VimPilot
|
||||||
@@ -2054,8 +2036,6 @@
|
|||||||
- type: Damageable
|
- type: Damageable
|
||||||
damageContainer: Biological
|
damageContainer: Biological
|
||||||
damageModifierSet: Scale
|
damageModifierSet: Scale
|
||||||
- type: Puller
|
|
||||||
needsHands: true
|
|
||||||
|
|
||||||
# Code unique spider prototypes or combine them all into one spider and get a
|
# Code unique spider prototypes or combine them all into one spider and get a
|
||||||
# random sprite state when you spawn it.
|
# random sprite state when you spawn it.
|
||||||
@@ -2499,7 +2479,6 @@
|
|||||||
gender: epicene
|
gender: epicene
|
||||||
- type: SentienceTarget
|
- type: SentienceTarget
|
||||||
flavorKind: station-event-random-sentience-flavor-corgi
|
flavorKind: station-event-random-sentience-flavor-corgi
|
||||||
- type: Puller
|
|
||||||
- type: MobPrice
|
- type: MobPrice
|
||||||
price: 200
|
price: 200
|
||||||
- type: Tag
|
- type: Tag
|
||||||
|
|||||||
Reference in New Issue
Block a user