Artifexium (#17604)

This commit is contained in:
Nemanja
2023-06-24 08:00:42 -04:00
committed by GitHub
parent 5d126d7774
commit 489077868c
6 changed files with 57 additions and 6 deletions

View File

@@ -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<ArtifactTriggerPrototype>(currentNode.Trigger);
var effect = _prototype.Index<ArtifactEffectPrototype>(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;
}

View File

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

View File

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

View File

@@ -28,6 +28,9 @@
type: TransferAmountBoundUserInterface
- key: enum.InstrumentUiKey.Key
type: InstrumentBoundUserInterface
- type: Reactive
groups:
Acidic: [Touch]
- type: Fixtures
fixtures:
fix1:

View File

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

View File

@@ -94,6 +94,8 @@
triggerHint: artifact-trigger-hint-water
components:
- type: Reactive
groups:
Acidic: [ Touch ]
reactions:
- reagents: [ Water ]
methods: [ Touch ]