XenoArch [Science Overhaul] (#12204)

* multi-node xeno artifacts

* refactor existing artifact effects

* more tweaks to generation

* more shit plus fix tests

* more generation stuff plus threat levels

* doink

* now make it build

* defer the artifact activation to not cause errors

also pricing

* some changes

* all of the yaml + ui stuff for artifact analyzer

* machine linking and starting to make the ui functional

* artifact analyzer display

* a shit ton of artifact analyzer stuff

* more changes; making destroy work properly; progress bar tweaks

* getting shit going!

ALL RIGHT

* small tweaks that didn't help much

* Komm susser todd: the end of analysis

* recipes and hints and ui, oh my!

* add some in-game sources

gotta prepare for day 1 launch

* node data + ditch random seed in place of id

* bunch of triggers

* finish off the last few triggers

* implement machine examine verb

* knock, flicker, blink, throw

* shatter, foam, shuffle, heat

* fix all the shit i broke

* *some* of these have to be good, no?

25 effects

* callin' it there for effects

* comments + reword some trigger hints

* don't mind this little commit here

* byref event

* fix brokey node entry

* fix low pressure trigger

* mirror review plus fixing 0x40's bug

also the throw artifact threw incorrectly

* randomize the event message a teeny bit
This commit is contained in:
Nemanja
2022-11-06 18:05:44 -05:00
committed by GitHub
parent 0d4a605a94
commit 273e0968e4
107 changed files with 3321 additions and 358 deletions

View File

@@ -0,0 +1,44 @@
using Content.Shared.Damage;
using Content.Shared.Whitelist;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// <summary>
/// When activated, damages nearby entities.
/// </summary>
[RegisterComponent]
public sealed class DamageNearbyArtifactComponent : Component
{
/// <summary>
/// The radius of entities that will be affected
/// </summary>
[DataField("radius")]
public float Radius = 3f;
/// <summary>
/// A whitelist for filtering certain damage.
/// </summary>
/// <remarks>
/// TODO: The component portion, since it uses an array, does not work currently.
/// </remarks>
[DataField("whitelist")]
public EntityWhitelist? Whitelist;
/// <summary>
/// The damage that is applied
/// </summary>
[DataField("damage", required: true)]
public DamageSpecifier Damage = default!;
/// <summary>
/// The chance that damage is applied to each individual entity
/// </summary>
[DataField("damageChance")]
public float DamageChance = 1f;
/// <summary>
/// Whether or not this should ignore resistances for the damage
/// </summary>
[DataField("ignoreResistances")]
public bool IgnoreResistances;
}

View File

@@ -1,4 +1,5 @@
using Content.Shared.Disease;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// <summary>
@@ -8,10 +9,15 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
public sealed class DiseaseArtifactComponent : Component
{
/// <summary>
/// Disease the artifact will spawn
/// If empty, picks a random one from its list
/// The diseases that the artifact can use.
/// </summary>
[DataField("diseasePrototype", customTypeSerializer: typeof(PrototypeIdListSerializer<DiseasePrototype>))]
public List<string> DiseasePrototypes = new();
/// <summary>
/// Disease the artifact will spawn
/// Picks a random one from its list
/// </summary>
[DataField("disease")]
[ViewVariables(VVAccess.ReadWrite)]
public DiseasePrototype? SpawnDisease;
@@ -19,7 +25,6 @@ public sealed class DiseaseArtifactComponent : Component
/// How far away it will check for people
/// If empty, picks a random one from its list
/// </summary>
[DataField("range")]
[ViewVariables(VVAccess.ReadWrite)]
[DataField("range"), ViewVariables(VVAccess.ReadWrite)]
public float Range = 5f;
}

View File

@@ -0,0 +1,54 @@
using Content.Shared.Chemistry.Reagent;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// <summary>
/// Generates foam from the artifact when activated
/// </summary>
[RegisterComponent]
public sealed class FoamArtifactComponent : Component
{
/// <summary>
/// The list of reagents that will randomly be picked from
/// to choose the foam reagent
/// </summary>
[DataField("reagents", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<ReagentPrototype>))]
public List<string> Reagents = new();
/// <summary>
/// The foam reagent
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public string? SelectedReagent;
/// <summary>
/// How long does the foam last?
/// </summary>
[DataField("duration")]
public float Duration = 10;
/// <summary>
/// How much reagent is in the foam?
/// </summary>
[DataField("reagentAmount")]
public float ReagentAmount = 100;
/// <summary>
/// Minimum radius of foam spawned
/// </summary>
[DataField("minFoamAmount")]
public int MinFoamAmount = 2;
/// <summary>
/// Maximum radius of foam spawned
/// </summary>
[DataField("maxFoamAmount")]
public int MaxFoamAmount = 6;
/// <summary>
/// How long it takes for each tile of foam to spawn
/// </summary>
[DataField("spreadDuration")]
public float SpreadDuration = 1;
}

View File

@@ -20,7 +20,7 @@ public sealed class GasArtifactComponent : Component
/// List of possible activation gases to pick on startup.
/// </summary>
[DataField("possibleGas")]
public Gas[] PossibleGases =
public List<Gas> PossibleGases = new()
{
Gas.Oxygen,
Gas.Plasma,

View File

@@ -0,0 +1,14 @@
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// <summary>
/// This is used for using the "knock" spell when the artifact is activated
/// </summary>
[RegisterComponent]
public sealed class KnockArtifactComponent : Component
{
/// <summary>
/// The range of the spell
/// </summary>
[DataField("knockRange")]
public float KnockRange = 4f;
}

View File

@@ -0,0 +1,20 @@
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// <summary>
/// Flickers all the lights within a certain radius.
/// </summary>
[RegisterComponent]
public sealed class LightFlickerArtifactComponent : Component
{
/// <summary>
/// Lights within this radius will be flickered on activation
/// </summary>
[DataField("radius")]
public float Radius = 4;
/// <summary>
/// The chance that the light will flicker
/// </summary>
[DataField("flickerChance")]
public float FlickerChance = 0.75f;
}

View File

@@ -1,17 +0,0 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// <summary>
/// Spawn RadiationPulse when artifact activated.
/// </summary>
[RegisterComponent]
public sealed class RadiateArtifactComponent : Component
{
/// <summary>
/// Radiation pulse prototype to spawn.
/// </summary>
[DataField("pulsePrototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string PulsePrototype = "RadiationPulse";
}

View File

@@ -0,0 +1,15 @@
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// <summary>
/// When activated, will teleport the artifact
/// to a random position within a certain radius
/// </summary>
[RegisterComponent]
public sealed class RandomTeleportArtifactComponent : Component
{
/// <summary>
/// The max distance that the artifact will teleport.
/// </summary>
[DataField("range")]
public float Range = 7.5f;
}

View File

@@ -0,0 +1,12 @@
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// <summary>
/// When activated, will shuffle the position of all players
/// within a certain radius.
/// </summary>
[RegisterComponent]
public sealed class ShuffleArtifactComponent : Component
{
[DataField("radius")]
public float Radius = 7.5f;
}

View File

@@ -11,21 +11,35 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
[RegisterComponent]
public sealed class SpawnArtifactComponent : Component
{
[DataField("random")]
public bool RandomPrototype = true;
/// <summary>
/// The list of possible prototypes to spawn that it picks from.
/// </summary>
[DataField("possiblePrototypes", customTypeSerializer:typeof(PrototypeIdListSerializer<EntityPrototype>))]
public List<string> PossiblePrototypes = new();
/// <summary>
/// The prototype it selected to spawn.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("prototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string? Prototype;
/// <summary>
/// The range around the artifact that it will spawn the entity
/// </summary>
[DataField("range")]
public float Range = 0.5f;
/// <summary>
/// The maximum number of times the spawn will occur
/// </summary>
[DataField("maxSpawns")]
public int MaxSpawns = 20;
public int SpawnsCount = 0;
/// <summary>
/// Whether or not the artifact spawns the same entity every time
/// or picks through the list each time.
/// </summary>
[DataField("consistentSpawn")]
public bool ConsistentSpawn = true;
}

View File

@@ -13,7 +13,7 @@ public sealed class TelepathicArtifactComponent : Component
/// </summary>
[DataField("messages")]
[ViewVariables(VVAccess.ReadWrite)]
public string[] Messages = default!;
public List<string> Messages = default!;
/// <summary>
/// Loc string ids of telepathic messages (spooky version).
@@ -21,7 +21,7 @@ public sealed class TelepathicArtifactComponent : Component
/// </summary>
[DataField("drastic")]
[ViewVariables(VVAccess.ReadWrite)]
public string[] DrasticMessages = default!;
public List<string>? DrasticMessages;
/// <summary>
/// Probability to pick drastic version of message.

View File

@@ -8,7 +8,7 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
[RegisterComponent]
public sealed class TemperatureArtifactComponent : Component
{
[DataField("targetTemp")]
[DataField("targetTemp"), ViewVariables(VVAccess.ReadWrite)]
public float TargetTemperature = Atmospherics.T0C;
[DataField("spawnTemp")]
@@ -21,6 +21,6 @@ public sealed class TemperatureArtifactComponent : Component
/// If true, artifact will heat/cool not only its current tile, but surrounding tiles too.
/// This will change room temperature much faster.
/// </summary>
[DataField("effectAdjacent")]
public bool EffectAdjacentTiles = true;
[DataField("affectAdjacent")]
public bool AffectAdjacentTiles = true;
}

View File

@@ -0,0 +1,27 @@
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// <summary>
/// Throws all nearby entities backwards.
/// Also pries nearby tiles.
/// </summary>
[RegisterComponent]
public sealed class ThrowArtifactComponent : Component
{
/// <summary>
/// How close do you have to be to get yeeted?
/// </summary>
[DataField("range")]
public float Range = 2f;
/// <summary>
/// How likely is it that an individual tile will get pried?
/// </summary>
[DataField("tilePryChance")]
public float TilePryChance = 0.5f;
/// <summary>
/// How strongly does stuff get thrown?
/// </summary>
[DataField("throwStrength"), ViewVariables(VVAccess.ReadWrite)]
public float ThrowStrength = 5f;
}