Metabolism tweaks / metabolism 4.0 (#5246)
* Metabolism tweaks
* use MetabolismArgs and convert ReagentEntityReactions into ReagentEffects
* fork forgor 💀
* fixes
This commit is contained in:
@@ -52,11 +52,26 @@ namespace Content.Server.Body.Metabolism
|
||||
[DataField("metabolizerTypes", customTypeSerializer:typeof(PrototypeIdHashSetSerializer<MetabolizerTypePrototype>))]
|
||||
public HashSet<string>? MetabolizerTypes = null;
|
||||
|
||||
/// <summary>
|
||||
/// Should this metabolizer remove chemicals that have no metabolisms defined?
|
||||
/// As a stop-gap, basically.
|
||||
/// </summary>
|
||||
[DataField("removeEmpty")]
|
||||
public bool RemoveEmpty = false;
|
||||
|
||||
/// <summary>
|
||||
/// How many reagents can this metabolizer process at once?
|
||||
/// Used to nerf 'stacked poisons' where having 5+ different poisons in a syringe, even at low
|
||||
/// quantity, would be muuuuch better than just one poison acting.
|
||||
/// </summary>
|
||||
[DataField("maxReagents")]
|
||||
public int MaxReagentsProcessable = 3;
|
||||
|
||||
/// <summary>
|
||||
/// A list of metabolism groups that this metabolizer will act on, in order of precedence.
|
||||
/// </summary>
|
||||
[DataField("groups", required: true)]
|
||||
public List<MetabolismGroupEntry> MetabolismGroups = default!;
|
||||
[DataField("groups")]
|
||||
public List<MetabolismGroupEntry>? MetabolismGroups = default!;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -9,10 +9,12 @@ using Content.Shared.Body.Mechanism;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.MobState.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.Body.Metabolism
|
||||
{
|
||||
@@ -22,6 +24,7 @@ namespace Content.Server.Body.Metabolism
|
||||
{
|
||||
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -102,17 +105,35 @@ namespace Content.Server.Body.Metabolism
|
||||
|
||||
if (solutionEntityUid == null || solution == null)
|
||||
return;
|
||||
// we found our guy
|
||||
foreach (var reagent in solution.Contents.ToArray())
|
||||
|
||||
// randomize the reagent list so we don't have any weird quirks
|
||||
// like alphabetical order or insertion order mattering for processing
|
||||
var list = solution.Contents.ToArray();
|
||||
_random.Shuffle(list);
|
||||
|
||||
int reagents = 0;
|
||||
foreach (var reagent in list)
|
||||
{
|
||||
if (!_prototypeManager.TryIndex<ReagentPrototype>(reagent.ReagentId, out var proto))
|
||||
continue;
|
||||
|
||||
FixedPoint2 mostToRemove = FixedPoint2.Zero;
|
||||
if (proto.Metabolisms == null)
|
||||
{
|
||||
if (meta.RemoveEmpty)
|
||||
_solutionContainerSystem.TryRemoveReagent(solutionEntityUid.Value, solution, reagent.ReagentId, FixedPoint2.New(1));
|
||||
continue;
|
||||
}
|
||||
|
||||
// we're done here entirely if this is true
|
||||
if (reagents >= meta.MaxReagentsProcessable)
|
||||
return;
|
||||
reagents += 1;
|
||||
|
||||
// loop over all our groups and see which ones apply
|
||||
FixedPoint2 mostToRemove = FixedPoint2.Zero;
|
||||
if (meta.MetabolismGroups == null)
|
||||
continue;
|
||||
|
||||
foreach (var group in meta.MetabolismGroups)
|
||||
{
|
||||
if (!proto.Metabolisms.Keys.Contains(group.Id))
|
||||
@@ -124,16 +145,27 @@ namespace Content.Server.Body.Metabolism
|
||||
if (entry.MetabolismRate > mostToRemove)
|
||||
mostToRemove = entry.MetabolismRate;
|
||||
|
||||
// if it's possible for them to be dead, and they are,
|
||||
// then we shouldn't process any effects, but should probably
|
||||
// still remove reagents
|
||||
if (EntityManager.TryGetComponent<MobStateComponent>(solutionEntityUid.Value, out var state))
|
||||
{
|
||||
if (state.IsDead())
|
||||
continue;
|
||||
}
|
||||
|
||||
var args = new ReagentEffectArgs(solutionEntityUid.Value, meta.OwnerUid, solution, proto, entry.MetabolismRate,
|
||||
EntityManager, null);
|
||||
|
||||
// do all effects, if conditions apply
|
||||
foreach (var effect in entry.Effects)
|
||||
{
|
||||
bool failed = false;
|
||||
var quant = new Solution.ReagentQuantity(reagent.ReagentId, reagent.Quantity);
|
||||
if (effect.Conditions != null)
|
||||
{
|
||||
foreach (var cond in effect.Conditions)
|
||||
{
|
||||
if (!cond.Condition(solutionEntityUid.Value, meta.OwnerUid, quant, EntityManager))
|
||||
if (!cond.Condition(args))
|
||||
failed = true;
|
||||
}
|
||||
|
||||
@@ -141,7 +173,7 @@ namespace Content.Server.Body.Metabolism
|
||||
continue;
|
||||
}
|
||||
|
||||
effect.Metabolize(solutionEntityUid.Value, meta.OwnerUid, quant, EntityManager);
|
||||
effect.Metabolize(args);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -566,7 +566,7 @@ namespace Content.Server.Botany.Components
|
||||
foreach (var reagent in solutionSystem.RemoveEachReagent(OwnerUid, solution, amt))
|
||||
{
|
||||
var reagentProto = _prototypeManager.Index<ReagentPrototype>(reagent);
|
||||
reagentProto.ReactionPlant(OwnerUid, new Solution.ReagentQuantity(reagent, amt));
|
||||
reagentProto.ReactionPlant(OwnerUid, new Solution.ReagentQuantity(reagent, amt), solution);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,9 +22,12 @@ namespace Content.Server.Chemistry.ReagentEffectConditions
|
||||
[DataField("shouldHave")]
|
||||
public bool ShouldHave = true;
|
||||
|
||||
public override bool Condition(EntityUid solutionEntity, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override bool Condition(ReagentEffectArgs args)
|
||||
{
|
||||
if (entityManager.TryGetComponent<MetabolizerComponent>(organEntity, out var metabolizer)
|
||||
if (args.OrganEntity == null)
|
||||
return false;
|
||||
|
||||
if (args.EntityManager.TryGetComponent<MetabolizerComponent>(args.OrganEntity.Value, out var metabolizer)
|
||||
&& metabolizer.MetabolizerTypes != null
|
||||
&& metabolizer.MetabolizerTypes.Contains(Type))
|
||||
return ShouldHave;
|
||||
|
||||
@@ -18,9 +18,15 @@ namespace Content.Server.Chemistry.ReagentEffectConditions
|
||||
[DataField("max")]
|
||||
public FixedPoint2 Max = FixedPoint2.MaxValue;
|
||||
|
||||
public override bool Condition(EntityUid solutionEntity, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override bool Condition(ReagentEffectArgs args)
|
||||
{
|
||||
return reagent.Quantity >= Min && reagent.Quantity < Max;
|
||||
if (args.Source != null)
|
||||
{
|
||||
var quant = args.Source.GetReagentQuantity(args.Reagent.ID);
|
||||
return quant >= Min && quant <= Max;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.Chemistry.EntitySystems;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.FixedPoint;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
|
||||
|
||||
namespace Content.Server.Chemistry.ReagentEffects
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class AddToSolutionReaction : ReagentEffect
|
||||
{
|
||||
[DataField("solution")]
|
||||
private string _solution = "reagents";
|
||||
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
// TODO see if this is correct
|
||||
if (!EntitySystem.Get<SolutionContainerSystem>()
|
||||
.TryGetSolution(args.SolutionEntity, _solution, out var solutionContainer))
|
||||
return;
|
||||
|
||||
if (EntitySystem.Get<SolutionContainerSystem>()
|
||||
.TryAddReagent(args.SolutionEntity, solutionContainer, args.Reagent.ID, args.Metabolizing, out var accepted))
|
||||
args.Source?.RemoveReagent(args.Reagent.ID, accepted);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.Atmos.Components;
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.FixedPoint;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
|
||||
|
||||
namespace Content.Server.Chemistry.ReagentEffects
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class ExtinguishReaction : ReagentEffect
|
||||
{
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
if (!args.EntityManager.TryGetComponent(args.SolutionEntity, out FlammableComponent? flammable)) return;
|
||||
|
||||
var flammableSystem = EntitySystem.Get<FlammableSystem>();
|
||||
flammableSystem.Extinguish(args.SolutionEntity, flammable);
|
||||
flammableSystem.AdjustFireStacks(args.SolutionEntity, -1.5f * (float) args.Metabolizing, flammable);
|
||||
}
|
||||
}
|
||||
}
|
||||
25
Content.Server/Chemistry/ReagentEffects/FlammableReaction.cs
Normal file
25
Content.Server/Chemistry/ReagentEffects/FlammableReaction.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.Atmos.Components;
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.FixedPoint;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
|
||||
|
||||
namespace Content.Server.Chemistry.ReagentEffects
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class FlammableReaction : ReagentEffect
|
||||
{
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
if (!args.EntityManager.TryGetComponent(args.SolutionEntity, out FlammableComponent? flammable)) return;
|
||||
|
||||
EntitySystem.Get<FlammableSystem>().AdjustFireStacks(args.SolutionEntity, args.Metabolizing.Float() / 5f, flammable);
|
||||
args.Source?.RemoveReagent(args.Reagent.ID, args.Metabolizing);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,9 +19,9 @@ namespace Content.Server.Chemistry.ReagentEffects
|
||||
[DataField("damage", required: true)]
|
||||
public DamageSpecifier Damage = default!;
|
||||
|
||||
public override void Metabolize(EntityUid solutionEntity, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
EntitySystem.Get<DamageableSystem>().TryChangeDamage(solutionEntity, Damage, true);
|
||||
EntitySystem.Get<DamageableSystem>().TryChangeDamage(args.SolutionEntity, Damage * args.Metabolizing, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,9 +37,9 @@ namespace Content.Server.Chemistry.ReagentEffects
|
||||
/// <summary>
|
||||
/// Remove reagent at set rate, changes the movespeed modifiers and adds a MovespeedModifierMetabolismComponent if not already there.
|
||||
/// </summary>
|
||||
public override void Metabolize(EntityUid solutionEntity, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
var status = entityManager.EnsureComponent<MovespeedModifierMetabolismComponent>(solutionEntity);
|
||||
var status = args.EntityManager.EnsureComponent<MovespeedModifierMetabolismComponent>(args.SolutionEntity);
|
||||
|
||||
// Only refresh movement if we need to.
|
||||
var modified = !status.WalkSpeedModifier.Equals(WalkSpeedModifier) ||
|
||||
@@ -48,10 +48,10 @@ namespace Content.Server.Chemistry.ReagentEffects
|
||||
status.WalkSpeedModifier = WalkSpeedModifier;
|
||||
status.SprintSpeedModifier = SprintSpeedModifier;
|
||||
|
||||
IncreaseTimer(status, StatusLifetime * reagent.Quantity.Float());
|
||||
IncreaseTimer(status, StatusLifetime * args.Metabolizing.Float());
|
||||
|
||||
if (modified)
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(solutionEntity);
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(args.SolutionEntity);
|
||||
|
||||
}
|
||||
public void IncreaseTimer(MovespeedModifierMetabolismComponent status, float time)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
@@ -6,9 +7,9 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism
|
||||
{
|
||||
public class PlantAdjustHealth : PlantAdjustAttribute
|
||||
{
|
||||
public override void Metabolize(EntityUid plantHolder, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
if (!CanMetabolize(plantHolder, out var plantHolderComp, entityManager))
|
||||
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager))
|
||||
return;
|
||||
|
||||
plantHolderComp.Health += Amount;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
@@ -6,9 +7,9 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism
|
||||
{
|
||||
public class PlantAdjustMutationLevel : PlantAdjustAttribute
|
||||
{
|
||||
public override void Metabolize(EntityUid plantHolder, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
if (!CanMetabolize(plantHolder, out var plantHolderComp, entityManager))
|
||||
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager))
|
||||
return;
|
||||
|
||||
plantHolderComp.MutationLevel += Amount * plantHolderComp.MutationMod;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
@@ -7,9 +8,9 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism
|
||||
[UsedImplicitly]
|
||||
public class PlantAdjustMutationMod : PlantAdjustAttribute
|
||||
{
|
||||
public override void Metabolize(EntityUid plantHolder, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
if (!CanMetabolize(plantHolder, out var plantHolderComp, entityManager))
|
||||
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager))
|
||||
return;
|
||||
|
||||
plantHolderComp.MutationMod += Amount;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
@@ -7,9 +8,9 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism
|
||||
[UsedImplicitly]
|
||||
public class PlantAdjustNutrition : PlantAdjustAttribute
|
||||
{
|
||||
public override void Metabolize(EntityUid plantHolder, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
if (!CanMetabolize(plantHolder, out var plantHolderComp, entityManager))
|
||||
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager))
|
||||
return;
|
||||
|
||||
plantHolderComp.AdjustNutrient(Amount);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
@@ -7,9 +8,9 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism
|
||||
[UsedImplicitly]
|
||||
public class PlantAdjustPests : PlantAdjustAttribute
|
||||
{
|
||||
public override void Metabolize(EntityUid plantHolder, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
if (!CanMetabolize(plantHolder, out var plantHolderComp, entityManager))
|
||||
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager))
|
||||
return;
|
||||
|
||||
plantHolderComp.PestLevel += Amount;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
@@ -7,9 +8,9 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism
|
||||
[UsedImplicitly]
|
||||
public class PlantAdjustToxins : PlantAdjustAttribute
|
||||
{
|
||||
public override void Metabolize(EntityUid plantHolder, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
if (!CanMetabolize(plantHolder, out var plantHolderComp, entityManager))
|
||||
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager))
|
||||
return;
|
||||
|
||||
plantHolderComp.Toxins += Amount;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
@@ -7,9 +8,9 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism
|
||||
[UsedImplicitly]
|
||||
public class PlantAdjustWater : PlantAdjustAttribute
|
||||
{
|
||||
public override void Metabolize(EntityUid plantHolder, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
if (!CanMetabolize(plantHolder, out var plantHolderComp, entityManager))
|
||||
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager))
|
||||
return;
|
||||
|
||||
plantHolderComp.AdjustWater(Amount);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
@@ -7,9 +8,9 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism
|
||||
[UsedImplicitly]
|
||||
public class PlantAdjustWeeds : PlantAdjustAttribute
|
||||
{
|
||||
public override void Metabolize(EntityUid plantHolder, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
if (!CanMetabolize(plantHolder, out var plantHolderComp, entityManager))
|
||||
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager))
|
||||
return;
|
||||
|
||||
plantHolderComp.WeedLevel += Amount;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
@@ -7,9 +8,9 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism
|
||||
[UsedImplicitly]
|
||||
public class PlantAffectGrowth : PlantAdjustAttribute
|
||||
{
|
||||
public override void Metabolize(EntityUid plantHolder, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
if (!CanMetabolize(plantHolder, out var plantHolderComp, entityManager))
|
||||
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager))
|
||||
return;
|
||||
|
||||
plantHolderComp.AffectGrowth((int) Amount);
|
||||
|
||||
@@ -15,9 +15,9 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism
|
||||
[DataDefinition]
|
||||
public class PlantClonexadone : ReagentEffect
|
||||
{
|
||||
public override void Metabolize(EntityUid plantHolder, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
if (!entityManager.TryGetComponent(plantHolder, out PlantHolderComponent? plantHolderComp)
|
||||
if (!args.EntityManager.TryGetComponent(args.SolutionEntity, out PlantHolderComponent? plantHolderComp)
|
||||
|| plantHolderComp.Seed == null || plantHolderComp.Dead)
|
||||
return;
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism
|
||||
[DataDefinition]
|
||||
public class PlantDiethylamine : ReagentEffect
|
||||
{
|
||||
public override void Metabolize(EntityUid plantHolder, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
if (!entityManager.TryGetComponent(plantHolder, out PlantHolderComponent? plantHolderComp)
|
||||
if (!args.EntityManager.TryGetComponent(args.SolutionEntity, out PlantHolderComponent? plantHolderComp)
|
||||
|| plantHolderComp.Seed == null || plantHolderComp.Dead ||
|
||||
plantHolderComp.Seed.Immutable)
|
||||
return;
|
||||
|
||||
@@ -15,9 +15,9 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism
|
||||
[DataDefinition]
|
||||
public class RobustHarvest : ReagentEffect
|
||||
{
|
||||
public override void Metabolize(EntityUid plantHolder, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
if (!entityManager.TryGetComponent(plantHolder, out PlantHolderComponent? plantHolderComp)
|
||||
if (!args.EntityManager.TryGetComponent(args.SolutionEntity, out PlantHolderComponent? plantHolderComp)
|
||||
|| plantHolderComp.Seed == null || plantHolderComp.Dead ||
|
||||
plantHolderComp.Seed.Immutable)
|
||||
return;
|
||||
|
||||
@@ -18,10 +18,10 @@ namespace Content.Server.Chemistry.ReagentEffects
|
||||
[DataField("factor")] public float NutritionFactor { get; set; } = 3.0f;
|
||||
|
||||
//Remove reagent at set rate, satiate hunger if a HungerComponent can be found
|
||||
public override void Metabolize(EntityUid solutionEntity, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
if (entityManager.TryGetComponent(solutionEntity, out HungerComponent? hunger))
|
||||
hunger.UpdateFood(NutritionFactor);
|
||||
if (args.EntityManager.TryGetComponent(args.SolutionEntity, out HungerComponent? hunger))
|
||||
hunger.UpdateFood(NutritionFactor * (float) args.Metabolizing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@ namespace Content.Server.Chemistry.ReagentEffects
|
||||
public float HydrationFactor { get; set; } = 3.0f;
|
||||
|
||||
/// Satiate thirst if a ThirstComponent can be found
|
||||
public override void Metabolize(EntityUid solutionEntity, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
if (entityManager.TryGetComponent(solutionEntity, out ThirstComponent? thirst))
|
||||
thirst.UpdateThirst(HydrationFactor);
|
||||
if (args.EntityManager.TryGetComponent(args.SolutionEntity, out ThirstComponent? thirst))
|
||||
thirst.UpdateThirst(HydrationFactor * (float) args.Metabolizing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.Nutrition.EntitySystems;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Nutrition.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
|
||||
|
||||
namespace Content.Server.Chemistry.ReagentEffects
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class WashCreamPieReaction : ReagentEffect
|
||||
{
|
||||
public override void Metabolize(ReagentEffectArgs args)
|
||||
{
|
||||
if (!args.EntityManager.TryGetComponent(args.SolutionEntity, out CreamPiedComponent? creamPied)) return;
|
||||
|
||||
EntitySystem.Get<CreamPieSystem>().SetCreamPied(args.SolutionEntity, creamPied, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.Chemistry.EntitySystems;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.FixedPoint;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
|
||||
|
||||
namespace Content.Server.Chemistry.ReagentEntityReactions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class AddToSolutionReaction : ReagentEntityReaction
|
||||
{
|
||||
[DataField("solution")]
|
||||
private string _solution = "reagents";
|
||||
|
||||
[DataField("reagents", true, customTypeSerializer: typeof(PrototypeIdHashSetSerializer<ReagentPrototype>))]
|
||||
// ReSharper disable once CollectionNeverUpdated.Local
|
||||
private readonly HashSet<string> _reagents = new();
|
||||
|
||||
protected override void React(EntityUid uid, ReagentPrototype reagent, FixedPoint2 volume, Solution? source, IEntityManager entityManager)
|
||||
{
|
||||
// TODO see if this is correct
|
||||
if (!EntitySystem.Get<SolutionContainerSystem>()
|
||||
.TryGetSolution(uid, _solution, out var solutionContainer)
|
||||
|| (_reagents.Count > 0 && !_reagents.Contains(reagent.ID))) return;
|
||||
|
||||
if (EntitySystem.Get<SolutionContainerSystem>()
|
||||
.TryAddReagent(uid, solutionContainer, reagent.ID, volume, out var accepted))
|
||||
source?.RemoveReagent(reagent.ID, accepted);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.Atmos.Components;
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.FixedPoint;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
|
||||
|
||||
namespace Content.Server.Chemistry.ReagentEntityReactions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class ExtinguishReaction : ReagentEntityReaction
|
||||
{
|
||||
[DataField("reagents", true, customTypeSerializer:typeof(PrototypeIdHashSetSerializer<ReagentPrototype>))]
|
||||
// ReSharper disable once CollectionNeverUpdated.Local
|
||||
private readonly HashSet<string> _reagents = new ();
|
||||
|
||||
protected override void React(EntityUid uid, ReagentPrototype reagent, FixedPoint2 volume, Solution? source, IEntityManager entityManager)
|
||||
{
|
||||
if (!entityManager.TryGetComponent(uid, out FlammableComponent? flammable) || !_reagents.Contains(reagent.ID)) return;
|
||||
|
||||
var flammableSystem = EntitySystem.Get<FlammableSystem>();
|
||||
flammableSystem.Extinguish(uid, flammable);
|
||||
flammableSystem.AdjustFireStacks(uid, -1.5f, flammable);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.Atmos.Components;
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.FixedPoint;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
|
||||
|
||||
namespace Content.Server.Chemistry.ReagentEntityReactions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class FlammableReaction : ReagentEntityReaction
|
||||
{
|
||||
[DataField("reagents", true, customTypeSerializer:typeof(PrototypeIdHashSetSerializer<ReagentPrototype>))]
|
||||
// ReSharper disable once CollectionNeverUpdated.Local
|
||||
private readonly HashSet<string> _reagents = new ();
|
||||
|
||||
protected override void React(EntityUid uid, ReagentPrototype reagent, FixedPoint2 volume, Solution? source, IEntityManager entityManager)
|
||||
{
|
||||
if (!entityManager.TryGetComponent(uid, out FlammableComponent? flammable) || !_reagents.Contains(reagent.ID)) return;
|
||||
|
||||
EntitySystem.Get<FlammableSystem>().AdjustFireStacks(uid, volume.Float() / 10f, flammable);
|
||||
source?.RemoveReagent(reagent.ID, volume);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.Nutrition.EntitySystems;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Nutrition.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
|
||||
|
||||
namespace Content.Server.Chemistry.ReagentEntityReactions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class WashCreamPieReaction : ReagentEntityReaction
|
||||
{
|
||||
[DataField("reagents", true, customTypeSerializer:typeof(PrototypeIdHashSetSerializer<ReagentPrototype>))]
|
||||
// ReSharper disable once CollectionNeverUpdated.Local
|
||||
private readonly HashSet<string> _reagents = new ();
|
||||
|
||||
protected override void React(EntityUid uid, ReagentPrototype reagent, FixedPoint2 volume, Solution? source, IEntityManager entityManager)
|
||||
{
|
||||
if (!entityManager.TryGetComponent(uid, out CreamPiedComponent? creamPied) || !_reagents.Contains(reagent.ID)) return;
|
||||
|
||||
EntitySystem.Get<CreamPieSystem>().SetCreamPied(uid, creamPied, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,10 +34,31 @@ namespace Content.Shared.Chemistry
|
||||
if (!EntityManager.TryGetComponent(uid, out ReactiveComponent? reactive))
|
||||
return;
|
||||
|
||||
foreach (var reaction in reactive.Reactions)
|
||||
{
|
||||
// If we have a source solution, use the reagent quantity we have left. Otherwise, use the reaction volume specified.
|
||||
reaction.React(method, uid, reagent, source?.GetReagentQuantity(reagent.ID) ?? reactVolume, source, EntityManager);
|
||||
var args = new ReagentEffectArgs(uid, null, source, reagent,
|
||||
source?.GetReagentQuantity(reagent.ID) ?? reactVolume, EntityManager, method);
|
||||
|
||||
foreach (var entry in reactive.Reactions)
|
||||
{
|
||||
if (!entry.Methods.Contains(method))
|
||||
continue;
|
||||
|
||||
if (entry.Reagents != null && !entry.Reagents.Contains(reagent.ID))
|
||||
continue;
|
||||
|
||||
foreach (var effect in entry.Effects)
|
||||
{
|
||||
bool failed = false;
|
||||
foreach (var cond in effect.Conditions ?? new ReagentEffectCondition[] { })
|
||||
{
|
||||
if (!cond.Condition(args))
|
||||
failed = true;
|
||||
}
|
||||
|
||||
if (failed)
|
||||
continue;
|
||||
|
||||
effect.Metabolize(args);
|
||||
|
||||
// Make sure we still have enough reagent to go...
|
||||
if (source != null && !source.ContainsReagent(reagent.ID))
|
||||
@@ -46,3 +67,4 @@ namespace Content.Shared.Chemistry
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
|
||||
|
||||
namespace Content.Shared.Chemistry.Reaction
|
||||
{
|
||||
@@ -10,7 +12,20 @@ namespace Content.Shared.Chemistry.Reaction
|
||||
{
|
||||
public override string Name => "Reactive";
|
||||
|
||||
[DataField("reactions", true, serverOnly:true)]
|
||||
public ReagentEntityReaction[] Reactions { get; } = Array.Empty<ReagentEntityReaction>();
|
||||
[DataField("reactions", required: true, readOnly: true, serverOnly: true)]
|
||||
public List<ReactiveReagentEffectEntry> Reactions { get; } = default!;
|
||||
}
|
||||
|
||||
[DataDefinition]
|
||||
public class ReactiveReagentEffectEntry
|
||||
{
|
||||
[DataField("methods")]
|
||||
public HashSet<ReactionMethod> Methods = default!;
|
||||
|
||||
[DataField("reagents", customTypeSerializer: typeof(PrototypeIdHashSetSerializer<ReagentPrototype>))]
|
||||
public HashSet<string>? Reagents = null;
|
||||
|
||||
[DataField("effects", required: true)]
|
||||
public List<ReagentEffect> Effects = default!;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.FixedPoint;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
@@ -21,6 +22,23 @@ namespace Content.Shared.Chemistry.Reagent
|
||||
[DataField("conditions")]
|
||||
public ReagentEffectCondition[]? Conditions;
|
||||
|
||||
public abstract void Metabolize(EntityUid solutionEntity, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager);
|
||||
public abstract void Metabolize(ReagentEffectArgs args);
|
||||
}
|
||||
|
||||
public enum ReactionMethod
|
||||
{
|
||||
Touch,
|
||||
Injection,
|
||||
Ingestion,
|
||||
}
|
||||
|
||||
public readonly record struct ReagentEffectArgs(
|
||||
EntityUid SolutionEntity,
|
||||
EntityUid? OrganEntity,
|
||||
Solution? Source,
|
||||
ReagentPrototype Reagent,
|
||||
FixedPoint2 Metabolizing,
|
||||
IEntityManager EntityManager,
|
||||
ReactionMethod? Method
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,6 @@ namespace Content.Shared.Chemistry.Reagent
|
||||
[MeansImplicitUse]
|
||||
public abstract class ReagentEffectCondition
|
||||
{
|
||||
public abstract bool Condition(EntityUid solutionEntity, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager);
|
||||
public abstract bool Condition(ReagentEffectArgs args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
using System;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Shared.Chemistry.Reagent
|
||||
{
|
||||
public enum ReactionMethod
|
||||
{
|
||||
Touch,
|
||||
Injection,
|
||||
Ingestion,
|
||||
}
|
||||
|
||||
[ImplicitDataDefinitionForInheritors]
|
||||
public abstract class ReagentEntityReaction
|
||||
{
|
||||
[ViewVariables]
|
||||
[DataField("touch")]
|
||||
public bool Touch { get; } = false;
|
||||
|
||||
[ViewVariables]
|
||||
[DataField("injection")]
|
||||
public bool Injection { get; } = false;
|
||||
|
||||
[ViewVariables]
|
||||
[DataField("ingestion")]
|
||||
public bool Ingestion { get; } = false;
|
||||
|
||||
public void React(ReactionMethod method, EntityUid uid, ReagentPrototype reagent, FixedPoint2 volume, Components.Solution? source, IEntityManager entityManager)
|
||||
{
|
||||
switch (method)
|
||||
{
|
||||
case ReactionMethod.Touch:
|
||||
if (!Touch)
|
||||
return;
|
||||
break;
|
||||
case ReactionMethod.Injection:
|
||||
if(!Injection)
|
||||
return;
|
||||
break;
|
||||
case ReactionMethod.Ingestion:
|
||||
if(!Ingestion)
|
||||
return;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(method), method, null);
|
||||
}
|
||||
|
||||
React(uid, reagent, volume, source, entityManager);
|
||||
}
|
||||
|
||||
protected abstract void React(EntityUid uid, ReagentPrototype reagent, FixedPoint2 volume, Components.Solution? source, IEntityManager entityManager);
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,7 @@ namespace Content.Shared.Chemistry.Reagent
|
||||
return removed;
|
||||
}
|
||||
|
||||
public void ReactionPlant(EntityUid? plantHolder, Solution.ReagentQuantity amount)
|
||||
public void ReactionPlant(EntityUid? plantHolder, Solution.ReagentQuantity amount, Solution solution)
|
||||
{
|
||||
if (plantHolder == null)
|
||||
return;
|
||||
@@ -114,7 +114,9 @@ namespace Content.Shared.Chemistry.Reagent
|
||||
var entMan = IoCManager.Resolve<IEntityManager>();
|
||||
foreach (var plantMetabolizable in _plantMetabolism)
|
||||
{
|
||||
plantMetabolizable.Metabolize(plantHolder.Value, plantHolder.Value, amount, entMan);
|
||||
plantMetabolizable.Metabolize(
|
||||
new ReagentEffectArgs(plantHolder.Value, null, solution, this, amount.Quantity, entMan, null)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,6 +118,7 @@
|
||||
# This is done because these chemicals need to have some effect even if they aren't being filtered out of your body.
|
||||
# You're technically 'immune to poison' without a heart, but.. uhh, you'll have bigger problems on your hands.
|
||||
- type: Metabolizer
|
||||
maxReagents: 2
|
||||
metabolizerTypes: [Human]
|
||||
groups:
|
||||
- id: Medicine
|
||||
@@ -147,6 +148,8 @@
|
||||
# TODO: Have it work off of the ent's solution container, and move this
|
||||
# to intestines instead.
|
||||
- type: Metabolizer
|
||||
# mm yummy
|
||||
maxReagents: 3
|
||||
metabolizerTypes: [Human]
|
||||
groups:
|
||||
- id: Food
|
||||
@@ -164,6 +167,7 @@
|
||||
size: 1
|
||||
compatibility: Biological
|
||||
- type: Metabolizer # The liver metabolizes certain chemicals only, like alcohol.
|
||||
maxReagents: 1
|
||||
metabolizerTypes: [Human]
|
||||
groups:
|
||||
- id: Alcohol
|
||||
@@ -182,3 +186,8 @@
|
||||
- type: Mechanism
|
||||
size: 1
|
||||
compatibility: Biological
|
||||
# The kidneys just remove anything that doesn't currently have any metabolisms, as a stopgap.
|
||||
- type: Metabolizer
|
||||
maxReagents: 5
|
||||
metabolizerTypes: [Human]
|
||||
removeEmpty: true
|
||||
|
||||
@@ -6,17 +6,14 @@
|
||||
components:
|
||||
- type: Reactive
|
||||
reactions:
|
||||
- reagents: [Water]
|
||||
methods: [Touch]
|
||||
effects:
|
||||
- !type:ExtinguishReaction
|
||||
touch: true
|
||||
reagents:
|
||||
- Water
|
||||
- reagents: [WeldingFuel, Thermite, Plasma, Ethanol]
|
||||
methods: [Touch]
|
||||
effects:
|
||||
- !type:FlammableReaction
|
||||
touch: true
|
||||
reagents:
|
||||
- WeldingFuel
|
||||
- Thermite
|
||||
- Plasma
|
||||
- Ethanol
|
||||
- type: UtilityAI
|
||||
behaviorSets:
|
||||
- Clothing
|
||||
|
||||
@@ -12,23 +12,18 @@
|
||||
- FootstepSound
|
||||
- type: Reactive
|
||||
reactions:
|
||||
- reagents: [Water]
|
||||
methods: [Touch]
|
||||
effects:
|
||||
- !type:ExtinguishReaction
|
||||
touch: true
|
||||
reagents:
|
||||
- Water
|
||||
- reagents: [WeldingFuel, Thermite, Plasma, Ethanol]
|
||||
methods: [Touch]
|
||||
effects:
|
||||
- !type:FlammableReaction
|
||||
touch: true
|
||||
reagents:
|
||||
- WeldingFuel
|
||||
- Thermite
|
||||
- Plasma
|
||||
- Ethanol
|
||||
- Oil
|
||||
- reagents: [Water, SpaceCleaner]
|
||||
methods: [Touch]
|
||||
effects:
|
||||
- !type:WashCreamPieReaction
|
||||
touch: true
|
||||
reagents:
|
||||
- Water
|
||||
- SpaceCleaner
|
||||
- type: Flashable
|
||||
- type: Hands
|
||||
- type: MovementSpeedModifier
|
||||
|
||||
@@ -20,13 +20,11 @@
|
||||
state: cube
|
||||
- type: Reactive
|
||||
reactions:
|
||||
- reagents: [Water]
|
||||
methods: [Touch, Ingestion, Injection]
|
||||
effects:
|
||||
- !type:AddToSolutionReaction
|
||||
solution: cube
|
||||
touch: true
|
||||
ingestion: true
|
||||
injection: true
|
||||
reagents:
|
||||
- Water
|
||||
- type: Rehydratable
|
||||
target: MobMonkey
|
||||
- type: CollisionWake
|
||||
@@ -62,13 +60,11 @@
|
||||
solution: plushie
|
||||
- type: Reactive
|
||||
reactions:
|
||||
- reagents: [Water]
|
||||
methods: [Touch, Ingestion, Injection]
|
||||
effects:
|
||||
- !type:AddToSolutionReaction
|
||||
solution: plushie
|
||||
touch: true
|
||||
ingestion: true
|
||||
injection: true
|
||||
reagents:
|
||||
- Water
|
||||
- type: Rehydratable
|
||||
target: MobCarp
|
||||
- type: CollisionWake
|
||||
|
||||
@@ -46,19 +46,6 @@
|
||||
damage:
|
||||
types:
|
||||
Heat : 1 #per second, scales with number of fire 'stacks'
|
||||
- type: Reactive
|
||||
reactions:
|
||||
- !type:ExtinguishReaction
|
||||
touch: true
|
||||
reagents:
|
||||
- Water
|
||||
- !type:FlammableReaction
|
||||
touch: true
|
||||
reagents:
|
||||
- WeldingFuel
|
||||
- Thermite
|
||||
- Plasma
|
||||
- Ethanol
|
||||
- type: Appearance
|
||||
visuals:
|
||||
- type: FireVisualizer
|
||||
|
||||
@@ -50,6 +50,9 @@
|
||||
anchored: true
|
||||
- type: Reactive
|
||||
reactions:
|
||||
- reagents: [Water]
|
||||
methods: [Touch, Ingestion, Injection]
|
||||
effects:
|
||||
- !type:AddToSolutionReaction
|
||||
solution: soil
|
||||
- type: Appearance
|
||||
|
||||
Reference in New Issue
Block a user