Skip to content

Commit

Permalink
Merge pull request #221 from TheGrimbeeper/artifacts
Browse files Browse the repository at this point in the history
Additional Artifact effects
  • Loading branch information
formlessnameless authored Sep 7, 2024
2 parents 19f438e + 535a688 commit 9e6ef3e
Show file tree
Hide file tree
Showing 8 changed files with 385 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;

/// <summary>
/// Triggers when a nearby entity is resurrected
/// </summary>
[RegisterComponent]
public sealed partial class ArtifactResurrectionTriggerComponent : Component
{
/// <summary>
/// How close to the resurrection the artifact has to be for it to trigger.
/// </summary>
[DataField("range")]
public float Range = 15f;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
using Content.Shared.Mobs;

namespace Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Systems;

public sealed class ArtifactResurrectionTriggerSystem : EntitySystem
{
[Dependency] private readonly ArtifactSystem _artifact = default!;

/// <inheritdoc/>
public override void Initialize()
{
SubscribeLocalEvent<MobStateChangedEvent>(OnMobStateChanged);
}

private void OnMobStateChanged(MobStateChangedEvent ev)
{
if (ev.OldMobState != MobState.Dead || ev.NewMobState == MobState.Dead)
return;

var resurrectionXform = Transform(ev.Target);

var toActivate = new List<Entity<ArtifactResurrectionTriggerComponent>>();
var query = EntityQueryEnumerator<ArtifactResurrectionTriggerComponent, TransformComponent>();
while (query.MoveNext(out var uid, out var trigger, out var xform))
{
if (!resurrectionXform.Coordinates.TryDistance(EntityManager, xform.Coordinates, out var distance))
continue;

if (distance > trigger.Range)
continue;

toActivate.Add((uid, trigger));
}

foreach (var a in toActivate)
{
_artifact.TryActivateArtifact(a);
}
}
}
3 changes: 2 additions & 1 deletion Resources/Locale/en-US/xenoarchaeology/artifact-hints.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ artifact-trigger-hint-death = Life essence
artifact-trigger-hint-radiation = Radiation
artifact-trigger-hint-pressure = Extreme pressure
artifact-trigger-hint-regular-gases = Standard atmospheric gases
artifact-trigger-hint-vape = Gaseous water
artifact-trigger-hint-plasma = Gaseous plasma
artifact-trigger-hint-land = Active deceleration
artifact-trigger-hint-examine = Examination
artifact-trigger-hint-resurrection = Resurrection
artifact-trigger-hint-medical = Therapeutic chemicals
11 changes: 11 additions & 0 deletions Resources/Prototypes/Entities/Objects/Misc/space_cash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,17 @@
- type: Stack
count: 30000

- type: entity
parent: SpaceCash
id: SpaceCash50000
suffix: 50000
components:
- type: Icon
sprite: Objects/Economy/cash.rsi
state: cash_1000
- type: Stack
count: 50000

- type: entity
parent: SpaceCash
id: SpaceCash1000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@
- type: ItemBorgModule
items:
- NodeScanner
- BorgDropper
- Beaker

- type: entity
id: BorgModuleAnomaly
Expand Down
36 changes: 36 additions & 0 deletions Resources/Prototypes/Polymorphs/polymorph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,42 @@
revertOnCrit: true
duration: 20

- type: polymorph
id: ArtifactBee
configuration:
entity: MobBee
forced: true
transferName: true
transferHumanoidAppearance: true
inventory: None
revertOnDeath: true
revertOnCrit: true
duration: 25

- type: polymorph
id: ArtifactClownSpider
configuration:
entity: MobClownSpider
forced: true
transferName: true
transferHumanoidAppearance: true
inventory: None
revertOnDeath: true
revertOnCrit: true
duration: 25

- type: polymorph
id: ArtifactFinfin
configuration:
entity: MobFinfin
forced: true
transferName: true
transferHumanoidAppearance: true
inventory: None
revertOnDeath: true
revertOnCrit: true
duration: 25

# Polymorphs for Wizards polymorph self spell
- type: polymorph
id: WizardSpider
Expand Down
237 changes: 231 additions & 6 deletions Resources/Prototypes/XenoArch/Effects/normal_effects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -628,18 +628,40 @@
- id: RandomArtifactSpawner

- type: artifactEffect
id: EffectAnomaly
id: EffectPortal
targetDepth: 3
effectHint: artifact-effect-hint-displacement
components:
- type: PortalArtifact

- type: artifactEffect
id: EffectLesserPresentSpawn
targetDepth: 3
effectHint: artifact-effect-hint-creation
components:
- type: SpawnArtifact
maxSpawns: 5
spawns:
- id: PresentRandom
prob: 0.95
- id: PresentRandomUnsafe
prob: 0.03
- id: PresentRandomInsane
prob: 0.02

- type: artifactEffect
id: EffectAnomaly
targetDepth: 4
effectHint: artifact-effect-hint-creation
components:
- type: SpawnArtifact
maxSpawns: 1
spawns:
- id: RandomAnomalySpawner

- type: artifactEffect
id: EffectBoom
targetDepth: 3
targetDepth: 4
effectHint: artifact-effect-hint-environment
components:
- type: TriggerArtifact
Expand All @@ -652,11 +674,214 @@
maxIntensity: 50

- type: artifactEffect
id: EffectPortal
targetDepth: 3
effectHint: artifact-effect-hint-displacement
id: EffectMajorCashSpawn
targetDepth: 4
effectHint: artifact-effect-hint-creation
components:
- type: PortalArtifact
- type: SpawnArtifact
maxSpawns: 10
spawns:
- id: SpaceCash100
maxAmount: 5
prob: 0.75
- id: SpaceCash1000
maxAmount: 2
prob: 0.5
- id: SpaceCash5000
prob: 0.25
- id: SpaceCash10000
prob: 0.1
- id: SpaceCash50000
prob: 0.01

- type: artifactEffect
id: EffectFaunaSpawnDangerous
targetDepth: 4
effectHint: artifact-effect-hint-creation
components:
- type: SpawnArtifact
maxSpawns: 10
spawns:
- id: MobAdultSlimesYellowAngry
orGroup: fauna
- id: MobAngryBee
orGroup: fauna
- id: MobBearSpace
orGroup: fauna
- id: MobBee
orGroup: fauna
maxAmount: 10
- id: MobKangarooSpace
orGroup: fauna
- id: MobMonkeySyndicateAgent #so lucky
orGroup: fauna
maxAmount: 1
prob: 0.03
- id: MobGrenadePenguin
orGroup: fauna
maxAmount: 2
- id: MobPurpleSnake
orGroup: fauna
- id: MobSpiderSpace
orGroup: fauna
- id: MobTick
orGroup: fauna
- id: MobXenoRavager
orGroup: fauna
- id: MobDragonDungeon
orGroup: fauna
prob: 0.05

- type: artifactEffect
id: EffectBigIgnite
targetDepth: 4
effectHint: artifact-effect-hint-release
components:
- type: IgniteArtifact
range: 8
minFireStack: 4
maxFireStack: 7

- type: artifactEffect
id: EffectFoamVeryDangerous
targetDepth: 4
effectHint: artifact-effect-hint-biochemical
components:
- type: FoamArtifact
minFoamAmount: 30
maxFoamAmount: 40
reagents:
- SpaceDrugs
- Nocturine
- MuteToxin
- Phlogiston
- CarpoToxin
- Uranium
- BuzzochloricBees
- JuiceThatMakesYouWeh
- Lead
- ForeverWeed
- Romerol

- type: artifactEffect
id: EffectPolyClownSpider
targetDepth: 4
effectHint: artifact-effect-hint-polymorph
components:
- type: PolyOthersArtifact
polymorphPrototypeName: ArtifactClownSpider
range: 5

- type: artifactEffect
id: EffectPolyFinfin
targetDepth: 4
effectHint: artifact-effect-hint-polymorph
components:
- type: PolyOthersArtifact
polymorphPrototypeName: ArtifactFinfin
range: 5

- type: artifactEffect
id: EffectPolyBee
targetDepth: 4
effectHint: artifact-effect-hint-polymorph
components:
- type: PolyOthersArtifact
polymorphPrototypeName: ArtifactBee
range: 5

- type: artifactEffect
id: EffectHealAllPowerful
targetDepth: 4
effectHint: artifact-effect-hint-environment
components:
- type: DamageNearbyArtifact
damageChance: 1
radius: 30
whitelist:
components:
- MobState
damage:
groups:
Brute: -900
Burn: -900
Airloss: -600
Toxin: -600

- type: artifactEffect
id: EffectSuperHeat
targetDepth: 4
effectHint: artifact-effect-hint-release
components:
- type: TemperatureArtifact
targetTemp: 5000

- type: artifactEffect
id: EffectSuperCold
targetDepth: 4
effectHint: artifact-effect-hint-consumption
components:
- type: TemperatureArtifact
targetTemp: 2

- type: artifactEffect
id: EffectShatterStructure
targetDepth: 4
effectHint: artifact-effect-hint-environment
components:
- type: DamageNearbyArtifact
damageChance: 0.85
whitelist:
tags:
- Window
- Wall
damage:
types:
Structural: 300

- type: artifactEffect
id: EffectPresentSpawn
targetDepth: 4
effectHint: artifact-effect-hint-creation
components:
- type: SpawnArtifact
maxSpawns: 7
spawns:
- id: PresentRandom
prob: 0.9
- id: PresentRandomUnsafe
prob: 0.06
- id: PresentRandomInsane
prob: 0.03

- type: artifactEffect
id: EffectBookSpawn
targetDepth: 4
effectHint: artifact-effect-hint-creation
components:
- type: SpawnArtifact
maxSpawns: 1
spawns:
- id: BookRandomStory
prob: 0.95
- id: WizardsGrimoire
prob: 0.001
- id: SpawnSpellbook
prob: 0.01
- id: ForceWallSpellbook
prob: 0.01
- id: BlinkBook
prob: 0.01
- id: SmiteBook
prob: 0.003
- id: KnockSpellbook
prob: 0.01
- id: FireballSpellbook
prob: 0.01
- id: SpawnSpaceGreaseSpellbook
prob: 0.01
- id: ScrollRunes
prob: 0.01

- type: artifactEffect
id: EffectSingulo
Expand Down
Loading

0 comments on commit 9e6ef3e

Please sign in to comment.