From b4fb089e002fc288062a448ebe61bf3412544944 Mon Sep 17 00:00:00 2001
From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
Date: Fri, 30 Jun 2023 15:25:33 -0400
Subject: [PATCH] Imagine if artifacts fucking killed you (#17746)
---
.../Components/ExplosiveComponent.cs | 7 +
.../EntitySystems/ExplosionSystem.cs | 2 +-
.../RandomTeleportArtifactComponent.cs | 10 +-
.../TemperatureArtifactComponent.cs | 3 -
.../Components/TriggerArtifactComponent.cs | 10 +
.../Effects/Systems/IgniteArtifactSystem.cs | 12 +-
.../Systems/RandomTeleportArtifactSystem.cs | 2 +-
.../Systems/TemperatureArtifactSystem.cs | 3 -
.../Effects/Systems/TriggerArtifactSystem.cs | 24 ++
.../en-US/xenoarchaeology/artifact-hints.ftl | 3 +-
.../XenoArch/Effects/normal_effects.yml | 262 +++++++++++-------
.../Prototypes/XenoArch/artifact_triggers.yml | 17 +-
12 files changed, 234 insertions(+), 121 deletions(-)
create mode 100644 Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Components/TriggerArtifactComponent.cs
create mode 100644 Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/TriggerArtifactSystem.cs
diff --git a/Content.Server/Explosion/Components/ExplosiveComponent.cs b/Content.Server/Explosion/Components/ExplosiveComponent.cs
index 9752f92d3b..88213d61e5 100644
--- a/Content.Server/Explosion/Components/ExplosiveComponent.cs
+++ b/Content.Server/Explosion/Components/ExplosiveComponent.cs
@@ -74,6 +74,13 @@ public sealed class ExplosiveComponent : Component
[DataField("canCreateVacuum")]
public bool CanCreateVacuum = true;
+ ///
+ /// An override for whether or not the entity should be deleted after it explodes.
+ /// If null, the system calling the explode method handles it.
+ ///
+ [DataField("deleteAfterExplosion")]
+ public bool? DeleteAfterExplosion;
+
///
/// Avoid somehow double-triggering this explosion (e.g. by damaging this entity from its own explosion.
///
diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.cs
index 39214bbe06..73e48d1731 100644
--- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.cs
+++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.cs
@@ -153,7 +153,7 @@ public sealed partial class ExplosionSystem : EntitySystem
explosive.CanCreateVacuum,
user);
- if (delete)
+ if (explosive.DeleteAfterExplosion ?? delete)
EntityManager.QueueDeleteEntity(uid);
}
diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Components/RandomTeleportArtifactComponent.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Components/RandomTeleportArtifactComponent.cs
index ce9d823a4f..539af03d5f 100644
--- a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Components/RandomTeleportArtifactComponent.cs
+++ b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Components/RandomTeleportArtifactComponent.cs
@@ -10,6 +10,12 @@ public sealed class RandomTeleportArtifactComponent : Component
///
/// The max distance that the artifact will teleport.
///
- [DataField("range")]
- public float Range = 7.5f;
+ [DataField("maxRange")]
+ public float MaxRange = 15f;
+
+ ///
+ /// The min distance that the artifact will teleport.
+ ///
+ [DataField("minRange")]
+ public float MinRange = 6f;
}
diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Components/TemperatureArtifactComponent.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Components/TemperatureArtifactComponent.cs
index e77d387e14..c55ef6abbc 100644
--- a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Components/TemperatureArtifactComponent.cs
+++ b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Components/TemperatureArtifactComponent.cs
@@ -14,9 +14,6 @@ public sealed class TemperatureArtifactComponent : Component
[DataField("spawnTemp")]
public float SpawnTemperature = 100;
- [DataField("maxTempDif")]
- public float MaxTemperatureDifference = 1;
-
///
/// If true, artifact will heat/cool not only its current tile, but surrounding tiles too.
/// This will change room temperature much faster.
diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Components/TriggerArtifactComponent.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Components/TriggerArtifactComponent.cs
new file mode 100644
index 0000000000..f706b3b0d0
--- /dev/null
+++ b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Components/TriggerArtifactComponent.cs
@@ -0,0 +1,10 @@
+namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
+
+///
+/// This is used for an artifact that triggers when activated.
+///
+[RegisterComponent]
+public sealed class TriggerArtifactComponent : Component
+{
+
+}
diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/IgniteArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/IgniteArtifactSystem.cs
index fa36fae85b..2d6827252d 100644
--- a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/IgniteArtifactSystem.cs
+++ b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/IgniteArtifactSystem.cs
@@ -22,17 +22,7 @@ public sealed class IgniteArtifactSystem : EntitySystem
private void OnActivate(EntityUid uid, IgniteArtifactComponent component, ArtifactActivatedEvent args)
{
var flammable = GetEntityQuery();
- var targets = new HashSet();
- if (args.Activator != null)
- {
- targets.Add(args.Activator.Value);
- }
- else
- {
- targets = _lookup.GetEntitiesInRange(uid, component.Range);
- }
-
- foreach (var target in targets)
+ foreach (var target in _lookup.GetEntitiesInRange(uid, component.Range))
{
if (!flammable.TryGetComponent(target, out var fl))
continue;
diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/RandomTeleportArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/RandomTeleportArtifactSystem.cs
index 84964958f3..7e3ecb8faa 100644
--- a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/RandomTeleportArtifactSystem.cs
+++ b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/RandomTeleportArtifactSystem.cs
@@ -23,6 +23,6 @@ public sealed class RandomTeleportArtifactSystem : EntitySystem
var xform = Transform(uid);
_popup.PopupCoordinates(Loc.GetString("blink-artifact-popup"), xform.Coordinates, PopupType.Medium);
- _xform.SetCoordinates(uid, xform, xform.Coordinates.Offset(_random.NextVector2(component.Range)));
+ _xform.SetCoordinates(uid, xform, xform.Coordinates.Offset(_random.NextVector2(component.MinRange, component.MaxRange)));
}
}
diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/TemperatureArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/TemperatureArtifactSystem.cs
index 97c53f3ecc..163600c6dd 100644
--- a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/TemperatureArtifactSystem.cs
+++ b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/TemperatureArtifactSystem.cs
@@ -42,9 +42,6 @@ public sealed class TemperatureArtifactSystem : EntitySystem
{
var dif = component.TargetTemperature - environment.Temperature;
var absDif = Math.Abs(dif);
- if (absDif < component.MaxTemperatureDifference)
- return;
-
var step = Math.Min(absDif, component.SpawnTemperature);
environment.Temperature += dif > 0 ? step : -step;
}
diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/TriggerArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/TriggerArtifactSystem.cs
new file mode 100644
index 0000000000..f70c8d7e9e
--- /dev/null
+++ b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/TriggerArtifactSystem.cs
@@ -0,0 +1,24 @@
+using Content.Server.Explosion.EntitySystems;
+using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
+using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
+
+namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;
+
+///
+/// This handles
+///
+public sealed class TriggerArtifactSystem : EntitySystem
+{
+ [Dependency] private readonly TriggerSystem _trigger = default!;
+
+ ///
+ public override void Initialize()
+ {
+ SubscribeLocalEvent(OnArtifactActivated);
+ }
+
+ private void OnArtifactActivated(EntityUid uid, TriggerArtifactComponent component, ArtifactActivatedEvent args)
+ {
+ _trigger.Trigger(uid, args.Activator);
+ }
+}
diff --git a/Resources/Locale/en-US/xenoarchaeology/artifact-hints.ftl b/Resources/Locale/en-US/xenoarchaeology/artifact-hints.ftl
index cdf2e065fa..1da33c3232 100644
--- a/Resources/Locale/en-US/xenoarchaeology/artifact-hints.ftl
+++ b/Resources/Locale/en-US/xenoarchaeology/artifact-hints.ftl
@@ -32,5 +32,6 @@ artifact-trigger-hint-magnet = Magnetic waves
artifact-trigger-hint-death = Life essence
artifact-trigger-hint-radiation = Radiation
artifact-trigger-hint-pressure = Extreme pressure
-artifact-trigger-hint-gas = Gas
+artifact-trigger-hint-regular-gases = Standard atmospheric gases
+artifact-trigger-hint-plasma = Gaseous plasma
artifact-trigger-hint-land = Active deceleration
diff --git a/Resources/Prototypes/XenoArch/Effects/normal_effects.yml b/Resources/Prototypes/XenoArch/Effects/normal_effects.yml
index 72aa1974cd..1c5f6fe362 100644
--- a/Resources/Prototypes/XenoArch/Effects/normal_effects.yml
+++ b/Resources/Prototypes/XenoArch/Effects/normal_effects.yml
@@ -108,9 +108,12 @@
targetDepth: 0
components:
- type: PointLight
- radius: 2
- energy: 5
- color: "#27153b"
+ radius: 8
+ energy: 25
+ color: "#daa3fd"
+ - type: TriggerArtifact
+ - type: FlashOnTrigger
+ range: 8
- type: artifactEffect #bornana
id: EffectBananaSpawn
@@ -121,10 +124,25 @@
maxSpawns: 20
spawns:
- id: FoodBanana
+ amount: 3
+ maxAmount: 6
+ - type: ChemicalPuddleArtifact
+ chemicalSolution:
+ maxVol: 100
+ canReact: false
+ possibleChemicals:
+ - Potassium
+
+- type: artifactEffect
+ id: EffectThrow
+ targetDepth: 0
+ effectHint: artifact-effect-hint-environment
+ components:
+ - type: ThrowArtifact
- type: artifactEffect
id: EffectChemicalPuddle
- targetDepth: 1
+ targetDepth: 0
effectHint: artifact-effect-hint-biochemical
components:
- type: ChemicalPuddleArtifact
@@ -160,14 +178,15 @@
effectHint: artifact-effect-hint-consumption
components:
- type: TemperatureArtifact
- targetTemp: 150
+ targetTemp: 50
- type: artifactEffect
- id: EffectThrow
+ id: EffectHeat
targetDepth: 1
- effectHint: artifact-effect-hint-environment
+ effectHint: artifact-effect-hint-release
components:
- - type: ThrowArtifact
+ - type: TemperatureArtifact
+ targetTemp: 500
- type: artifactEffect
id: EffectFoamMild
@@ -222,10 +241,60 @@
- charge-artifact-popup
- type: artifactEffect
- id: EffectAngryCarpSpawn
+ id: EffectRadiate
+ targetDepth: 1
+ effectHint: artifact-effect-hint-release
+ components:
+ - type: RadiationSource
+ intensity: 2
+
+- type: artifactEffect
+ id: EffectKnock
+ targetDepth: 1
+ effectHint: artifact-effect-hint-electrical-interference
+ components:
+ - type: KnockArtifact
+
+- type: artifactEffect
+ id: EffectExplosionScary
targetDepth: 2
effectHint: artifact-effect-hint-environment
components:
+ - type: TriggerArtifact
+ - type: ExplodeOnTrigger
+ - type: Explosive
+ deleteAfterExplosion: false
+ explosionType: Radioactive
+ totalIntensity: 300
+ intensitySlope: 2
+ maxIntensity: 1.5
+ canCreateVacuum: false
+
+- type: artifactEffect
+ id: EffectRareMaterialSpawn
+ targetDepth: 2
+ effectHint: artifact-effect-hint-creation
+ components:
+ - type: SpawnArtifact
+ spawns:
+ - id: SilverOre1
+ prob: 0.3
+ maxAmount: 3
+ - id: PlasmaOre1
+ prob: 0.3
+ maxAmount: 3
+ - id: GoldOre1
+ prob: 0.3
+ maxAmount: 3
+ - id: UraniumOre1
+ prob: 0.3
+ maxAmount: 3
+
+- type: artifactEffect
+ id: EffectAngryCarpSpawn
+ targetDepth: 2
+ effectHint: artifact-effect-hint-creation
+ components:
- type: SpawnArtifact
maxSpawns: 5
spawns:
@@ -253,21 +322,6 @@
- id: SpaceCash1000
prob: 0.1
-- type: artifactEffect
- id: EffectRadiate
- targetDepth: 2
- effectHint: artifact-effect-hint-release
- components:
- - type: RadiationSource
- intensity: 2
-
-- type: artifactEffect
- id: EffectKnock
- targetDepth: 2
- effectHint: artifact-effect-hint-electrical-interference
- components:
- - type: KnockArtifact
-
- type: artifactEffect
id: EffectShatterWindows
targetDepth: 2
@@ -280,7 +334,7 @@
- Window
damage:
types:
- Structural: 100
+ Structural: 200
- type: artifactEffect
id: EffectGas
@@ -288,6 +342,13 @@
effectHint: artifact-effect-hint-environment
components:
- type: GasArtifact
+ possibleGas:
+ - CarbonDioxide
+ - Plasma
+ - Tritium
+ - Miasma
+ - NitrousOxide
+ - Frezon
- type: artifactEffect
id: EffectBlink
@@ -296,20 +357,20 @@
components:
- type: RandomTeleportArtifact
-- type: artifactEffect
- id: EffectFoamGood
- targetDepth: 2
- effectHint: artifact-effect-hint-biochemical
- components:
- - type: FoamArtifact
- reagents:
- - Dermaline
- - Arithrazine
- - Bicaridine
- - Inaprovaline
- - Kelotane
- - Dexalin
- - Omnizine
+#- type: artifactEffect
+# id: EffectFoamGood
+# targetDepth: 2
+# effectHint: artifact-effect-hint-biochemical
+# components:
+# - type: FoamArtifact
+# reagents:
+# - Dermaline
+# - Arithrazine
+# - Bicaridine
+# - Inaprovaline
+# - Kelotane
+# - Dexalin
+# - Omnizine
- type: artifactEffect
id: EffectChemicalPuddleRare
@@ -337,14 +398,21 @@
- Pax
- Siderlac
+- type: artifactEffect
+ id: EffectEmp
+ targetDepth: 2
+ effectHint: artifact-effect-hint-electrical-interference
+ components:
+ - type: EmpArtifact
+
- type: artifactEffect
id: EffectHealAll
targetDepth: 3
effectHint: artifact-effect-hint-environment
components:
- type: DamageNearbyArtifact
- damageChance: 0.75
- radius: 5
+ damageChance: 1
+ radius: 8
whitelist:
components:
- MobState
@@ -353,6 +421,14 @@
Brute: -300
Burn: -300
+- type: artifactEffect
+ id: EffectRadiateStrong
+ targetDepth: 3
+ effectHint: artifact-effect-hint-release
+ components:
+ - type: RadiationSource
+ intensity: 6
+
- type: artifactEffect
id: EffectMaterialSpawn
targetDepth: 3
@@ -397,54 +473,26 @@
prob: 0.5
maxAmount: 3
-- type: artifactEffect
- id: EffectRareMaterialSpawn
- targetDepth: 3
- effectHint: artifact-effect-hint-creation
- components:
- - type: SpawnArtifact
- spawns:
- - id: SilverOre1
- prob: 0.3
- maxAmount: 3
- - id: PlasmaOre1
- prob: 0.3
- maxAmount: 3
- - id: GoldOre1
- prob: 0.3
- maxAmount: 3
- - id: UraniumOre1
- prob: 0.3
- maxAmount: 3
-
-- type: artifactEffect
- id: EffectHeat
- targetDepth: 3
- effectHint: artifact-effect-hint-release
- components:
- - type: TemperatureArtifact
- targetTemp: 450
-
-- type: artifactEffect
- id: EffectFoamDangerous
- targetDepth: 3
- effectHint: artifact-effect-hint-biochemical
- components:
- - type: FoamArtifact
- minFoamAmount: 20
- maxFoamAmount: 30
- reagents:
- - Tritium
- - Plasma
- - SulfuricAcid
- - SpaceDrugs
- - Nocturine
- - MuteToxin
- - Napalm
- - CarpoToxin
- - ChloralHydrate
- - Mold
- - Amatoxin
+#- type: artifactEffect
+# id: EffectFoamDangerous
+# targetDepth: 3
+# effectHint: artifact-effect-hint-biochemical
+# components:
+# - type: FoamArtifact
+# minFoamAmount: 20
+# maxFoamAmount: 30
+# reagents:
+# - Tritium
+# - Plasma
+# - SulfuricAcid
+# - SpaceDrugs
+# - Nocturine
+# - MuteToxin
+# - Napalm
+# - CarpoToxin
+# - ChloralHydrate
+# - Mold
+# - Amatoxin
- type: artifactEffect
id: EffectIgnite
@@ -452,6 +500,9 @@
effectHint: artifact-effect-hint-release
components:
- type: IgniteArtifact
+ range: 7
+ minFireStack: 3
+ maxFireStack: 6
- type: artifactEffect
id: EffectMitosis
@@ -463,19 +514,36 @@
spawns:
- id: RandomArtifactSpawner
+- type: artifactEffect
+ id: EffectAnomaly
+ targetDepth: 3
+ effectHint: artifact-effect-hint-creation
+ components:
+ - type: SpawnArtifact
+ maxSpawns: 1
+ spawns:
+ - id: RandomAnomalySpawner
+
+- type: artifactEffect
+ id: EffectBoom
+ targetDepth: 3
+ effectHint: artifact-effect-hint-environment
+ components:
+ - type: TriggerArtifact
+ - type: ExplodeOnTrigger
+ - type: Explosive
+ deleteAfterExplosion: false
+ explosionType: Default
+ totalIntensity: 500
+ intensitySlope: 2.5
+ maxIntensity: 50
+
- type: artifactEffect
id: EffectSingulo
- targetDepth: 100
+ targetDepth: 7
effectHint: artifact-effect-hint-destruction
components:
- type: SpawnArtifact
maxSpawns: 1
spawns:
- id: Singularity
-
-- type: artifactEffect
- id: EffectEmp
- targetDepth: 3
- effectHint: artifact-effect-hint-electrical-interference
- components:
- - type: EmpArtifact
diff --git a/Resources/Prototypes/XenoArch/artifact_triggers.yml b/Resources/Prototypes/XenoArch/artifact_triggers.yml
index 73227a5cd2..3308eed185 100644
--- a/Resources/Prototypes/XenoArch/artifact_triggers.yml
+++ b/Resources/Prototypes/XenoArch/artifact_triggers.yml
@@ -102,6 +102,17 @@
effects:
- !type:ActivateArtifact
+- type: artifactTrigger
+ id: TriggerGas
+ targetDepth: 2
+ triggerHint: artifact-trigger-hint-regular-gases
+ components:
+ - type: ArtifactGasTrigger
+ possibleGas:
+ - Oxygen
+ - Nitrogen
+ - CarbonDioxide
+
- type: artifactTrigger
id: TriggerDeath
targetDepth: 2
@@ -153,11 +164,13 @@
maxPressureThreshold: 385
- type: artifactTrigger
- id: TriggerGas
+ id: TriggerPlasma
targetDepth: 3
- triggerHint: artifact-trigger-hint-gas
+ triggerHint: artifact-trigger-hint-plasma
components:
- type: ArtifactGasTrigger
+ possibleGas:
+ - Plasma
#don't add in new targetdepth values until you have a few
#or else it will skew heavily towards a few options.