Imagine if artifacts fucking killed you (#17746)

This commit is contained in:
Nemanja 2023-06-30 15:25:33 -04:00 committed by GitHub
parent 9b711d4344
commit b4fb089e00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 234 additions and 121 deletions

View File

@ -74,6 +74,13 @@ public sealed class ExplosiveComponent : Component
[DataField("canCreateVacuum")]
public bool CanCreateVacuum = true;
/// <summary>
/// An override for whether or not the entity should be deleted after it explodes.
/// If null, the system calling the explode method handles it.
/// </summary>
[DataField("deleteAfterExplosion")]
public bool? DeleteAfterExplosion;
/// <summary>
/// Avoid somehow double-triggering this explosion (e.g. by damaging this entity from its own explosion.
/// </summary>

View File

@ -153,7 +153,7 @@ public sealed partial class ExplosionSystem : EntitySystem
explosive.CanCreateVacuum,
user);
if (delete)
if (explosive.DeleteAfterExplosion ?? delete)
EntityManager.QueueDeleteEntity(uid);
}

View File

@ -10,6 +10,12 @@ public sealed class RandomTeleportArtifactComponent : Component
/// <summary>
/// The max distance that the artifact will teleport.
/// </summary>
[DataField("range")]
public float Range = 7.5f;
[DataField("maxRange")]
public float MaxRange = 15f;
/// <summary>
/// The min distance that the artifact will teleport.
/// </summary>
[DataField("minRange")]
public float MinRange = 6f;
}

View File

@ -14,9 +14,6 @@ public sealed class TemperatureArtifactComponent : Component
[DataField("spawnTemp")]
public float SpawnTemperature = 100;
[DataField("maxTempDif")]
public float MaxTemperatureDifference = 1;
/// <summary>
/// If true, artifact will heat/cool not only its current tile, but surrounding tiles too.
/// This will change room temperature much faster.

View File

@ -0,0 +1,10 @@
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// <summary>
/// This is used for an artifact that triggers when activated.
/// </summary>
[RegisterComponent]
public sealed class TriggerArtifactComponent : Component
{
}

View File

@ -22,17 +22,7 @@ public sealed class IgniteArtifactSystem : EntitySystem
private void OnActivate(EntityUid uid, IgniteArtifactComponent component, ArtifactActivatedEvent args)
{
var flammable = GetEntityQuery<FlammableComponent>();
var targets = new HashSet<EntityUid>();
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;

View File

@ -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)));
}
}

View File

@ -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;
}

View File

@ -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;
/// <summary>
/// This handles <see cref="TriggerArtifactComponent"/>
/// </summary>
public sealed class TriggerArtifactSystem : EntitySystem
{
[Dependency] private readonly TriggerSystem _trigger = default!;
/// <inheritdoc/>
public override void Initialize()
{
SubscribeLocalEvent<TriggerArtifactComponent, ArtifactActivatedEvent>(OnArtifactActivated);
}
private void OnArtifactActivated(EntityUid uid, TriggerArtifactComponent component, ArtifactActivatedEvent args)
{
_trigger.Trigger(uid, args.Activator);
}
}

View File

@ -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

View File

@ -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

View File

@ -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.