Files
crystall-punk-14/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellMixSolution.cs
Ed 9a787bc7b8 Thaumaturgic alchemy refactor WIP (#955)
* essences thaumaturgy refactor

* migrate structure crystals

* shard migrate

* bruh

* fix migration

* fixes

* 1 combining

* Create essence_brewing.yml

* Update magic.yml

* stack essence support

* FUCK THIIA ALL, DELETE ALL

* redesign counter spell

* Update precurser.yml

* magic splitting solution

* precurser splitting

* Praecantatio

* Update cleaner.yml

* add potions recipe

* fuck alchemy guidebook

* guidebook update

* fixes

* energia fix

* Update migration.yml

* fixes

* Update Alchemy.xml

* fix

* medium vial

* fixes?

* Update essence_combining.yml

* Update target_effect_creation_water.yml

* alchemist Comoss update

* Update closets.yml

* mana opertion glove

* Update migration.yml

* Update vials.yml

* Update GuideReagentReaction.xaml

* try to fix

* manual migration

* Update comoss_d.yml

* fix

* manual migration 2

* precursor admixture

* Update heater.yml
2025-03-02 13:28:13 +03:00

35 lines
1.3 KiB
C#

using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Chemistry.Reaction;
using Robust.Shared.Prototypes;
namespace Content.Shared._CP14.MagicSpell.Spells;
public sealed partial class CP14SpellMixSolution : CP14SpellEffect
{
[DataField]
public List<ProtoId<MixingCategoryPrototype>> ReactionTypes = default!;
public override void Effect(EntityManager entManager, CP14SpellEffectBaseArgs args)
{
if (args.Target is null)
return;
if (!entManager.TryGetComponent<SolutionContainerManagerComponent>(args.Target.Value, out var solutionContainerManager))
return;
if (!entManager.TryGetComponent<MixableSolutionComponent>(args.Target.Value, out var mixableSolution))
return;
var solutionContainerSystem = entManager.System<SharedSolutionContainerSystem>();
if (!solutionContainerSystem.TryGetSolution((args.Target.Value, solutionContainerManager), mixableSolution.Solution, out var solution))
return;
var reactionSystem = entManager.System<ChemicalReactionSystem>();
reactionSystem.FullyReactSolution(solution.Value, new ReactionMixerComponent { ReactionTypes = ReactionTypes });
}
}