diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.Nodes.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.Nodes.cs index 54b83f2514..e6f937236d 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.Nodes.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.Nodes.cs @@ -28,7 +28,7 @@ public sealed partial class ArtifactSystem { if (nodeAmount < 1) { - Logger.Error($"nodeAmount {nodeAmount} is less than 1. Aborting artifact tree generation."); + Log.Error($"nodeAmount {nodeAmount} is less than 1. Aborting artifact tree generation."); return; } @@ -226,12 +226,24 @@ public sealed partial class ArtifactSystem var trigger = _prototype.Index(currentNode.Trigger); var effect = _prototype.Index(currentNode.Effect); - foreach (var name in effect.Components.Keys.Concat(trigger.Components.Keys)) - { - var comp = _componentFactory.GetRegistration(name); - EntityManager.RemoveComponentDeferred(uid, comp.Type); - } + var entityPrototype = MetaData(uid).EntityPrototype; + var toRemove = effect.Components.Keys.Concat(trigger.Components.Keys).ToList(); + foreach (var name in toRemove) + { + // if the entity prototype contained the component originally + if (entityPrototype?.Components.TryGetComponent(name, out var entry) ?? false) + { + var comp = (Component) _componentFactory.GetComponent(name); + comp.Owner = uid; + var temp = (object) comp; + _serialization.CopyTo(entry, ref temp); + EntityManager.AddComponent(uid, (Component) temp!, true); + continue; + } + + EntityManager.RemoveComponentDeferred(uid, _componentFactory.GetRegistration(name).Type); + } component.CurrentNodeId = null; } diff --git a/Resources/Locale/en-US/reagents/meta/chemicals.ftl b/Resources/Locale/en-US/reagents/meta/chemicals.ftl index 5fe31d31a2..976c122f8a 100644 --- a/Resources/Locale/en-US/reagents/meta/chemicals.ftl +++ b/Resources/Locale/en-US/reagents/meta/chemicals.ftl @@ -6,3 +6,6 @@ reagent-desc-phenol = An aromatic ring of carbon with a hydroxyl group. A useful reagent-name-sodium-carbonate = Sodium Carbonate reagent-desc-sodium-carbonate = A white, odorless, water-soluble salt that yields an alkaline solution in water. Also known as soda ash. + +reagent-name-artifexium = artifexium +reagent-desc-artifexium = A lavender mixture of microscopic artifact fragments and a strong acid. It has the ability to activate artifacts. diff --git a/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/item_artifacts.yml b/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/item_artifacts.yml index 68f4369509..5686b5783e 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/item_artifacts.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/item_artifacts.yml @@ -19,6 +19,9 @@ - type: CollisionWake enabled: false - type: InteractionOutline + - type: Reactive + groups: + Acidic: [Touch] - type: Fixtures fixtures: fix1: @@ -175,6 +178,11 @@ - type: Tag tags: - ArtifactFragment + - type: Extractable + juiceSolution: + reagents: + - ReagentId: Artifexium + Quantity: 10 - type: StaticPrice price: 250 - type: GuideHelp diff --git a/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/structure_artifacts.yml b/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/structure_artifacts.yml index 052679e049..1a6cc5cd58 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/structure_artifacts.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/structure_artifacts.yml @@ -28,6 +28,9 @@ type: TransferAmountBoundUserInterface - key: enum.InstrumentUiKey.Key type: InstrumentBoundUserInterface + - type: Reactive + groups: + Acidic: [Touch] - type: Fixtures fixtures: fix1: diff --git a/Resources/Prototypes/Reagents/chemicals.yml b/Resources/Prototypes/Reagents/chemicals.yml index 76273de3a0..703fec050d 100644 --- a/Resources/Prototypes/Reagents/chemicals.yml +++ b/Resources/Prototypes/Reagents/chemicals.yml @@ -49,3 +49,26 @@ desc: reagent-desc-sodium-carbonate physicalDesc: reagent-physical-desc-powdery color: white + +- type: reagent + id: Artifexium + name: reagent-name-artifexium + desc: reagent-desc-artifexium + flavor: metallic + physicalDesc: reagent-physical-desc-crystalline + color: "#776291" + metabolisms: + Poison: + effects: + - !type:HealthChange + damage: + types: + Caustic: 2 + reactiveEffects: + Acidic: + methods: [ Touch ] + effects: + - !type:ActivateArtifact + conditions: + - !type:ReagentThreshold + min: 5 diff --git a/Resources/Prototypes/XenoArch/artifact_triggers.yml b/Resources/Prototypes/XenoArch/artifact_triggers.yml index 05d299eda9..73227a5cd2 100644 --- a/Resources/Prototypes/XenoArch/artifact_triggers.yml +++ b/Resources/Prototypes/XenoArch/artifact_triggers.yml @@ -94,6 +94,8 @@ triggerHint: artifact-trigger-hint-water components: - type: Reactive + groups: + Acidic: [ Touch ] reactions: - reagents: [ Water ] methods: [ Touch ]