Files
tbd-station-14/Content.Shared/EntityEffects/Effects/EntitySpawning/BaseSpawnEntityEntityEffect.cs
Princess Cheeseballs e5b6e4bf04 Fix Entity Effect Scaling (Hopefully) for good and some other misc fixes (#41163)
* Fix the last of the entity effects bugs

* aaa

* losing it

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
2025-11-06 21:34:53 +00:00

37 lines
1.3 KiB
C#

using Robust.Shared.Prototypes;
namespace Content.Shared.EntityEffects.Effects.EntitySpawning;
/// <summary>
/// A type of <see cref="EntityEffectBase{T}"/> for effects that spawn entities by prototype.
/// </summary>
/// <typeparam name="T">The entity effect inheriting this BaseEffect</typeparam>
/// <inheritdoc cref="EntityEffect"/>
public abstract partial class BaseSpawnEntityEntityEffect<T> : EntityEffectBase<T> where T : BaseSpawnEntityEntityEffect<T>
{
/// <summary>
/// Amount of entities we're spawning
/// </summary>
[DataField]
public int Number = 1;
/// <summary>
/// Prototype of the entity we're spawning
/// </summary>
[DataField (required: true)]
public EntProtoId Entity;
/// <summary>
/// Whether this spawning is predicted. Set false to not predict the spawn.
/// Entities with animations or that have random elements when spawned should set this to false.
/// </summary>
[DataField]
public bool Predicted = true;
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("entity-effect-guidebook-spawn-entity",
("chance", Probability),
("entname", IoCManager.Resolve<IPrototypeManager>().Index<EntityPrototype>(Entity).Name),
("amount", Number));
}