Skip to content

Commit

Permalink
New artifact effects (new-frontiers-14#2318)
Browse files Browse the repository at this point in the history
* Arti+

* Update normal_effects.yml

* Update utility_effects.yml

* artifact hints, interactions, limited puddles

* Update normal_effects.yml

* Better(?) artifact pet failure, reclaimer fix

* Revert adding water vapor to C# (overwritten)

* missed a comment

---------

Co-authored-by: Whatstone <[email protected]>
  • Loading branch information
dvir001 and whatston3 authored Nov 20, 2024
1 parent cab229e commit 3ac49bc
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
using Content.Shared.FixedPoint; // Frontier

namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;

Expand Down Expand Up @@ -29,4 +30,10 @@ public sealed partial class ChemicalPuddleArtifactComponent : Component
/// </summary>
[DataField("chemAmount")]
public int ChemAmount = 3;

/// <summary>
/// Frontier: the total maximum volume of chemicals to spawn.
/// </summary>
[DataField]
public FixedPoint2 MaximumVolume = 100.0f;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Content.Server.Fluids.EntitySystems;
using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
using Content.Shared.FixedPoint;
using Robust.Shared.Random;

namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;
Expand All @@ -19,6 +20,11 @@ public sealed class ChemicalPuddleArtifactSystem : EntitySystem
/// the chemicals that the puddle is made of.
/// </summary>
public const string NodeDataChemicalList = "nodeDataChemicalList";
/// <summary>
/// Frontier: the key for the node data entry containing
/// the amount of chemicals spawned so far from this node.
/// </summary>
public const string NodeDataVolumeSpawned = "nodeDataVolumeSpawned";

/// <inheritdoc/>
public override void Initialize()
Expand All @@ -43,7 +49,15 @@ private void OnActivated(EntityUid uid, ChemicalPuddleArtifactComponent componen
_artifact.SetNodeData(uid, NodeDataChemicalList, chemicalList, artifact);
}

var amountPerChem = component.ChemicalSolution.MaxVolume / component.ChemAmount;
// Frontier: maximum volume per node
if (!_artifact.TryGetNodeData(uid, NodeDataVolumeSpawned, out FixedPoint2 volumeSpawned))
volumeSpawned = 0;
FixedPoint2 volumeToSpawn = FixedPoint2.Min(component.ChemicalSolution.MaxVolume, component.MaximumVolume - volumeSpawned);
volumeToSpawn = FixedPoint2.Max(0, volumeToSpawn);
_artifact.SetNodeData(uid, NodeDataVolumeSpawned, volumeSpawned + volumeToSpawn, artifact);

var amountPerChem = volumeToSpawn / component.ChemAmount;
// End Frontier
foreach (var reagent in chemicalList)
{
component.ChemicalSolution.AddReagent(reagent, amountPerChem);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Petting animals
petting-failure-mistake = Ymg' reach yog l' pet {THE($target)}, mgng ahlloig vulgtmnahor ot h'.
petting-success-artifact = You pet {THE($target)} on {POSS-ADJ($target)} bizarre surfaces.
petting-failure-artifact = You reach out to pet {THE($target)}, but a voice in your head tells you not to.
## Patting players
pat-success-generic = You pet {THE($target)} on {POSS-ADJ($target)} soft fluffy head.
Expand Down
3 changes: 3 additions & 0 deletions Resources/Locale/en-US/_NF/xenoarchaeology/artifact-hints.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
artifact-effect-hint-reclaimer = Matter repurposing
artifact-effect-hint-petting = Reciprocal affection
artifact-effect-hint-mop = Fluid absorbancy
61 changes: 28 additions & 33 deletions Resources/Prototypes/XenoArch/Effects/normal_effects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,14 @@
targetDepth: 0
effectHint: artifact-effect-hint-creation
components:
- type: SpawnArtifact
maxSpawns: 20
spawns:
- id: FoodBanana
amount: 2 # Frontier 3<2
maxAmount: 4 # Frontier 6<4
# - type: SpawnArtifact
# maxSpawns: 20
# spawns:
# - id: FoodBanana
# amount: 3
# maxAmount: 6
- type: ChemicalPuddleArtifact
maximumVolume: 200 # Frontier
chemicalSolution:
maxVol: 100
canReact: false
Expand Down Expand Up @@ -156,8 +157,9 @@
effectHint: artifact-effect-hint-biochemical
components:
- type: ChemicalPuddleArtifact
maximumVolume: 600 # Frontier
chemicalSolution:
maxVol: 500
maxVol: 300 # Frontier: 500<300
canReact: false
possibleChemicals:
- Aluminium
Expand Down Expand Up @@ -489,8 +491,9 @@
effectHint: artifact-effect-hint-biochemical
components:
- type: ChemicalPuddleArtifact
maximumVolume: 600 # Frontier
chemicalSolution:
maxVol: 500
maxVol: 300 # Frontier: 500<300
canReact: false
possibleChemicals:
- Dermaline
Expand Down Expand Up @@ -590,24 +593,6 @@
messages:
- shuffle-artifact-popup

- type: artifactEffect
id: EffectT4PartsSpawn
targetDepth: 3
effectHint: artifact-effect-hint-creation
components:
- type: SpawnArtifact
maxSpawns: 10
spawns:
- id: QuadraticCapacitorStockPart
prob: 0.5
maxAmount: 3
- id: FemtoManipulatorStockPart
prob: 0.5
maxAmount: 3
- id: BluespaceMatterBinStockPart
prob: 0.5
maxAmount: 3

- type: artifactEffect
id: EffectFoamDangerous
targetDepth: 3
Expand Down Expand Up @@ -674,14 +659,14 @@
maxIntensity: 50
canCreateVacuum: false

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

# - type: artifactEffect # Frontier
# - type: artifactEffect
# id: EffectSingulo
# targetDepth: 10
# effectHint: artifact-effect-hint-destruction
Expand All @@ -690,3 +675,13 @@
# maxSpawns: 1
# spawns:
# - id: Singularity

# - type: artifactEffect
# id: EffectTesla
# targetDepth: 10
# effectHint: artifact-effect-hint-destruction
# components:
# - type: SpawnArtifact
# maxSpawns: 1
# spawns:
# - id: TeslaEnergyBall
28 changes: 28 additions & 0 deletions Resources/Prototypes/_NF/XenoArch/Effects/normal_effects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
- type: artifactEffect
id: EffectT4PartsSpawn
targetDepth: 3
effectHint: artifact-effect-hint-creation
components:
- type: SpawnArtifact
maxSpawns: 10
spawns:
- id: QuadraticCapacitorStockPart
prob: 0.5
maxAmount: 3
- id: FemtoManipulatorStockPart
prob: 0.5
maxAmount: 3
- id: BluespaceMatterBinStockPart
prob: 0.5
maxAmount: 3

- type: artifactEffect
id: EffectBluespaceCrystalSpawn
targetDepth: 3
effectHint: artifact-effect-hint-creation
components:
- type: SpawnArtifact
maxSpawns: 5
spawns:
- id: MaterialBluespace1
maxAmount: 3
96 changes: 96 additions & 0 deletions Resources/Prototypes/_NF/XenoArch/Effects/utility_effects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# # Utility effects permanently modify the entity in some way when triggered, and they generally make it 'useful' for some purpose,
# # like turning the artifact into a tool, or gun, or whatever.
- type: artifactEffect
id: EffectReclaimer
targetDepth: 3
effectHint: artifact-effect-hint-reclaimer
blacklist:
components:
- Item
permanentComponents:
- type: MaterialReclaimer
whitelist:
components:
- PhysicalComposition
- SpaceGarbage
- Log # Frontier
tags:
- Trash
- Recyclable
blacklist:
components:
- Material
- Pda
- IdCard
- Brain
tags:
- HighRiskItem
soundCooldown: 0
sound:
path: /Audio/Ambience/Objects/crushing.ogg
params:
volume: 5
maxDistance: 5
loop: true
useOldSolutionLogic: true
solutionContainerId: output
powered: true
- type: MaterialStorage
insertOnInteract: false
- type: SolutionContainerManager
solutions:
output:
maxVol: 1000 # Frontier 100<1000
- type: DrainableSolution
solution: output
- type: ExaminableSolution
solution: output
- type: MaterialReclaimerMagnetPickup # Frontier
range: 0.30
magnetEnabled: true

- type: artifactEffect
id: EffectInteractionPopup
targetDepth: 2
effectHint: artifact-trigger-hint-petting
blacklist:
components:
- Item
permanentComponents:
- type: InteractionPopup
successChance: 0.5
interactSuccessString: petting-success-artifact
interactFailureString: petting-failure-artifact
interactSuccessSpawn: EffectHearts
interactSuccessSound:
collection: RadiationPulse

- type: artifactEffect
id: EffectAdvMop
targetDepth: 3
effectHint: artifact-trigger-hint-mop
whitelist:
components:
- Item
permanentComponents:
- type: Spillable
solution: absorbed
- type: Absorbent
pickupAmount: 100
- type: UseDelay
delay: 1.0
- type: SolutionRegeneration
solution: absorbed
generated:
reagents:
- ReagentId: Water
Quantity: 5
- type: SolutionPurge
solution: absorbed
preserve:
- Water
quantity: 10
- type: SolutionContainerManager
solutions:
absorbed:
maxVol: 100

0 comments on commit 3ac49bc

Please sign in to comment.