Files
crystall-punk-14/Content.Shared/_CP14/MagicRitual/Actions/SpawnEntity.cs
Ed d2c5aa74b4 Ritualizm (#474)
* ritual cucumber setup

* entities requirements

* try graph???

* Revert "try graph???"

This reverts commit c90c6353cb.

* pipyau

* fixes

* yay, it works

* spawn effect

* regex lower message restrictions

* unique speakers support

* apply entity effect ritual

* ritual chalk

* Update SpawnEntity.cs

* ritual stability

* stability event

* add guidebook description to all ritual actions

* Readability added

* Update RequiredResource.cs

* finish describer

* clean up describer

* Update triggers.ftl

* cave ambient loop

* parry sound update

* rituals end start

* magic ambience add

* global sharedization

* Update phases.yml

* daytime requirement

* Update phases.yml

* start ritual

* fixes

* more ambient work

* rritual visualizer

* end ritual

* magic orbs!

* required orbs

* orbs design

* consume orbs

* setup neutral cluster triggers and edges

* listener proxy

* restucture graph

* fix time triggers

* healing cluster

* fixes

* Create CP14RitualTest.cs

* test errors for check test

* YEEEE

* Fuck triggers, its broken now, YAY

* triggers redo

* fix

* fix test

* Update CP14RitualTest.cs

* Update neutral_cluster.yml

* Update CP14RitualSystem.Triggers.cs

* clean up, documentation

* redo triggers again

* and another one

* species sacrifice trigger

* whitelist trigger

* fix

* describer refactor

* fix memory leaking  + hyperlinks

* dd
2024-10-06 18:04:18 +03:00

45 lines
1.4 KiB
C#

using System.Text;
using Robust.Shared.Prototypes;
namespace Content.Shared._CP14.MagicRitual.Actions;
/// <summary>
/// Creates an entity in the coordinates of the ritual.
/// </summary> TODO: EntityTable support?
public sealed partial class SpawnEntity : CP14RitualAction
{
[DataField(required: true)]
public Dictionary<EntProtoId, int> Spawns = new();
[DataField]
public LocId? Name;
public override string? GetGuidebookEffectDescription(IPrototypeManager prototype, IEntitySystemManager entSys)
{
var sb = new StringBuilder();
sb.Append(Loc.GetString("cp14-ritual-effect-spawn-entity")+ "\n");
foreach (var spawn in Spawns)
{
if (!prototype.TryIndex(spawn.Key, out var indexed))
return null;
sb.Append(Loc.GetString("cp14-ritual-entry-item",
("name", Name is null ? indexed.Name : Loc.GetString(Name)),
("count", spawn.Value)) + "\n");
}
return sb.ToString();
}
public override void Effect(EntityManager entManager, SharedTransformSystem transform, Entity<CP14MagicRitualPhaseComponent> phase)
{
foreach (var spawn in Spawns)
{
for (var i = 0; i < spawn.Value; i++)
{
entManager.Spawn(spawn.Key, transform.GetMapCoordinates(phase));
}
}
}
}