Xenoarchaeology artifacts (#6069)
Co-authored-by: Alexander Evgrashin <evgrashin.adl@gmail.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
using System.Collections.Generic;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
|
||||
|
||||
/// <summary>
|
||||
/// When activated artifact will spawn an entity from prototype.
|
||||
/// It could be an angry mob or some random item.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public class SpawnArtifactComponent : Component
|
||||
{
|
||||
public override string Name => "SpawnArtifact";
|
||||
|
||||
[DataField("random")]
|
||||
public bool RandomPrototype = true;
|
||||
|
||||
[DataField("possiblePrototypes", customTypeSerializer:typeof(PrototypeIdListSerializer<EntityPrototype>))]
|
||||
public List<string> PossiblePrototypes = new();
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("prototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
public string? Prototype;
|
||||
|
||||
[DataField("range")]
|
||||
public float Range = 0.5f;
|
||||
|
||||
[DataField("maxSpawns")]
|
||||
public int MaxSpawns = 20;
|
||||
|
||||
public int SpawnsCount = 0;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Harmless artifact that broadcast "thoughts" to players nearby.
|
||||
/// Thoughts are shown as popups and unique for each player.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public class TelepathicArtifactComponent : Component
|
||||
{
|
||||
public override string Name => "TelepathicArtifact";
|
||||
|
||||
/// <summary>
|
||||
/// Loc string ids of telepathic messages.
|
||||
/// Will be randomly picked and shown to player.
|
||||
/// </summary>
|
||||
[DataField("messages")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public string[] Messages = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Loc string ids of telepathic messages (spooky version).
|
||||
/// Will be randomly picked and shown to player.
|
||||
/// </summary>
|
||||
[DataField("drastic")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public string[] DrasticMessages = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Probability to pick drastic version of message.
|
||||
/// </summary>
|
||||
[DataField("drasticProb")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float DrasticMessageProb = 0.2f;
|
||||
|
||||
/// <summary>
|
||||
/// Radius in which player can receive artifacts messages.
|
||||
/// </summary>
|
||||
[DataField("range")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float Range = 10f;
|
||||
}
|
||||
Reference in New Issue
Block a user