make revenant soft toy construction use tags (#16905)
This commit is contained in:
@@ -31,11 +31,6 @@ namespace Content.Shared.Construction.Steps
|
|||||||
return typeof(TagConstructionGraphStep);
|
return typeof(TagConstructionGraphStep);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node.Has("prototype"))
|
|
||||||
{
|
|
||||||
return typeof(PrototypeConstructionGraphStep);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (node.Has("allTags") || node.Has("anyTags"))
|
if (node.Has("allTags") || node.Has("anyTags"))
|
||||||
{
|
{
|
||||||
return typeof(MultipleTagsConstructionGraphStep);
|
return typeof(MultipleTagsConstructionGraphStep);
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace Content.Shared.Construction.Steps
|
|
||||||
{
|
|
||||||
[DataDefinition]
|
|
||||||
public sealed class PrototypeConstructionGraphStep : ArbitraryInsertConstructionGraphStep
|
|
||||||
{
|
|
||||||
[DataField("prototype")]
|
|
||||||
private string _prototype = "BaseItem";
|
|
||||||
|
|
||||||
[DataField("allowParents")]
|
|
||||||
private bool _allowParents;
|
|
||||||
|
|
||||||
public override bool EntityValid(EntityUid uid, IEntityManager entityManager, IComponentFactory compFactory)
|
|
||||||
{
|
|
||||||
entityManager.TryGetComponent(uid, out MetaDataComponent? metaDataComponent);
|
|
||||||
if (metaDataComponent?.EntityPrototype == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (metaDataComponent.EntityPrototype.ID == _prototype)
|
|
||||||
return true;
|
|
||||||
if (_allowParents && metaDataComponent.EntityPrototype.Parents != null)
|
|
||||||
return metaDataComponent.EntityPrototype.Parents.Contains(_prototype);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -67,6 +67,7 @@
|
|||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- ForceableFollow
|
- ForceableFollow
|
||||||
|
- PlushieGhost
|
||||||
- type: RandomWalk
|
- type: RandomWalk
|
||||||
accumulatorRatio: 0.5
|
accumulatorRatio: 0.5
|
||||||
maxSpeed: 1
|
maxSpeed: 1
|
||||||
|
|||||||
@@ -137,6 +137,7 @@
|
|||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- Trash
|
- Trash
|
||||||
|
- Ectoplasm
|
||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
food:
|
food:
|
||||||
|
|||||||
@@ -6,10 +6,16 @@
|
|||||||
edges:
|
edges:
|
||||||
- to: plushie
|
- to: plushie
|
||||||
steps:
|
steps:
|
||||||
- prototype: PlushieGhost
|
- tag: PlushieGhost
|
||||||
name: a ghost plushie
|
name: ghost soft toy
|
||||||
- prototype: Ectoplasm
|
icon:
|
||||||
|
sprite: Mobs/Ghosts/ghost_human.rsi
|
||||||
|
state: icon
|
||||||
|
- tag: Ectoplasm
|
||||||
name: ectoplasm
|
name: ectoplasm
|
||||||
|
icon:
|
||||||
|
sprite: Mobs/Ghosts/revenant.rsi
|
||||||
|
state: ectoplasm
|
||||||
doAfter: 10
|
doAfter: 10
|
||||||
- node: plushie
|
- node: plushie
|
||||||
entity: PlushieGhostRevenant
|
entity: PlushieGhostRevenant
|
||||||
|
|||||||
@@ -239,6 +239,9 @@
|
|||||||
- type: Tag
|
- type: Tag
|
||||||
id: DroneUsable
|
id: DroneUsable
|
||||||
|
|
||||||
|
- type: Tag
|
||||||
|
id: Ectoplasm
|
||||||
|
|
||||||
- type: Tag
|
- type: Tag
|
||||||
id: Egg
|
id: Egg
|
||||||
|
|
||||||
@@ -558,6 +561,9 @@
|
|||||||
- type: Tag
|
- type: Tag
|
||||||
id: Plastic
|
id: Plastic
|
||||||
|
|
||||||
|
- type: Tag
|
||||||
|
id: PlushieGhost
|
||||||
|
|
||||||
- type: Tag
|
- type: Tag
|
||||||
id: Powerdrill
|
id: Powerdrill
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user