Stable merge (#41171)
* [HOTFIX] Fix status effect removal from entity effects and buckets not being draggable (#41168) just do less work it's that easy! Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> * [Hotfix] Fix Phalanx (#41170) feex Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> --------- Co-authored-by: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
@@ -886,12 +886,13 @@ public sealed class PlantHolderSystem : EntitySystem
|
|||||||
|
|
||||||
if (solution.Volume > 0 && component.MutationLevel < 25)
|
if (solution.Volume > 0 && component.MutationLevel < 25)
|
||||||
{
|
{
|
||||||
var amt = FixedPoint2.New(1);
|
foreach (var entry in component.SoilSolution.Value.Comp.Solution.Contents)
|
||||||
foreach (var entry in _solutionContainerSystem.RemoveEachReagent(component.SoilSolution.Value, amt))
|
|
||||||
{
|
{
|
||||||
var reagentProto = _prototype.Index<ReagentPrototype>(entry.Reagent.Prototype);
|
var reagentProto = _prototype.Index<ReagentPrototype>(entry.Reagent.Prototype);
|
||||||
_entityEffects.ApplyEffects(uid, reagentProto.PlantMetabolisms.ToArray());
|
_entityEffects.ApplyEffects(uid, reagentProto.PlantMetabolisms.ToArray(), entry.Quantity.Float());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_solutionContainerSystem.RemoveEachReagent(component.SoilSolution.Value, FixedPoint2.New(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckLevelSanity(uid, component);
|
CheckLevelSanity(uid, component);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ using Content.Shared.Chemistry.Components;
|
|||||||
using Content.Shared.Chemistry.EntitySystems;
|
using Content.Shared.Chemistry.EntitySystems;
|
||||||
using Content.Shared.DragDrop;
|
using Content.Shared.DragDrop;
|
||||||
using Content.Shared.FixedPoint;
|
using Content.Shared.FixedPoint;
|
||||||
using Content.Shared.Item;
|
|
||||||
using Content.Shared.Nutrition.EntitySystems;
|
using Content.Shared.Nutrition.EntitySystems;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Robust.Shared.Audio.Systems;
|
using Robust.Shared.Audio.Systems;
|
||||||
@@ -20,7 +19,6 @@ namespace Content.Shared.Fluids.EntitySystems;
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <seealso cref="DumpableSolutionComponent" />
|
/// <seealso cref="DumpableSolutionComponent" />
|
||||||
/// <seealso cref="DrainableSolutionComponent" />
|
/// <seealso cref="DrainableSolutionComponent" />
|
||||||
/// <seealso cref="RefillableSolutionComponent" />
|
|
||||||
public sealed class SolutionDumpingSystem : EntitySystem
|
public sealed class SolutionDumpingSystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IPrototypeManager _protoMan = default!;
|
[Dependency] private readonly IPrototypeManager _protoMan = default!;
|
||||||
@@ -30,8 +28,6 @@ public sealed class SolutionDumpingSystem : EntitySystem
|
|||||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||||
[Dependency] private readonly SharedSolutionContainerSystem _solContainer = default!;
|
[Dependency] private readonly SharedSolutionContainerSystem _solContainer = default!;
|
||||||
|
|
||||||
private EntityQuery<ItemComponent> _itemQuery;
|
|
||||||
private EntityQuery<RefillableSolutionComponent> _refillableQuery;
|
|
||||||
private EntityQuery<DumpableSolutionComponent> _dumpQuery;
|
private EntityQuery<DumpableSolutionComponent> _dumpQuery;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
@@ -40,21 +36,16 @@ public sealed class SolutionDumpingSystem : EntitySystem
|
|||||||
|
|
||||||
SubscribeLocalEvent<DrainableSolutionComponent, CanDragEvent>(OnDrainableCanDrag);
|
SubscribeLocalEvent<DrainableSolutionComponent, CanDragEvent>(OnDrainableCanDrag);
|
||||||
SubscribeLocalEvent<DrainableSolutionComponent, CanDropDraggedEvent>(OnDrainableCanDragDropped);
|
SubscribeLocalEvent<DrainableSolutionComponent, CanDropDraggedEvent>(OnDrainableCanDragDropped);
|
||||||
|
|
||||||
//SubscribeLocalEvent<RefillableSolutionComponent, DragDropDraggedEvent>(OnRefillableDragged); For if you want to refill a container by dragging it into another one. Can't find a use for that currently.
|
|
||||||
SubscribeLocalEvent<DrainableSolutionComponent, DragDropDraggedEvent>(OnDrainableDragged);
|
SubscribeLocalEvent<DrainableSolutionComponent, DragDropDraggedEvent>(OnDrainableDragged);
|
||||||
|
|
||||||
SubscribeLocalEvent<DumpableSolutionComponent, DrainedTargetEvent>(OnDrainedToDumpableDragged);
|
SubscribeLocalEvent<DumpableSolutionComponent, DrainedTargetEvent>(OnDrainedToDumpableDragged);
|
||||||
|
|
||||||
// We use queries for these since CanDropDraggedEvent gets called pretty rapidly
|
// We use queries for these since CanDropDraggedEvent gets called pretty rapidly
|
||||||
_itemQuery = GetEntityQuery<ItemComponent>();
|
|
||||||
_refillableQuery = GetEntityQuery<RefillableSolutionComponent>();
|
|
||||||
_dumpQuery = GetEntityQuery<DumpableSolutionComponent>();
|
_dumpQuery = GetEntityQuery<DumpableSolutionComponent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDrainableCanDrag(Entity<DrainableSolutionComponent> ent, ref CanDragEvent args)
|
private void OnDrainableCanDrag(Entity<DrainableSolutionComponent> ent, ref CanDragEvent args)
|
||||||
{
|
{
|
||||||
if (_itemQuery.HasComp(ent))
|
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ public sealed partial class StatusEffectsSystem
|
|||||||
/// <returns> True if duration was edited successfully, false otherwise.</returns>
|
/// <returns> True if duration was edited successfully, false otherwise.</returns>
|
||||||
public bool TryRemoveTime(EntityUid uid, EntProtoId effectProto, TimeSpan? time)
|
public bool TryRemoveTime(EntityUid uid, EntProtoId effectProto, TimeSpan? time)
|
||||||
{
|
{
|
||||||
return time == null ? TryRemoveStatusEffect(uid, effectProto) : TryAddTime(uid, effectProto, time.Value);
|
return time == null ? TryRemoveStatusEffect(uid, effectProto) : TryAddTime(uid, effectProto, - time.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -588,10 +588,7 @@
|
|||||||
- !type:PlantAdjustToxins
|
- !type:PlantAdjustToxins
|
||||||
amount: 6
|
amount: 6
|
||||||
- !type:PlantPhalanximine
|
- !type:PlantPhalanximine
|
||||||
conditions:
|
minScale: 4
|
||||||
- !type:ReagentCondition
|
|
||||||
reagent: Phalanximine
|
|
||||||
min: 4
|
|
||||||
metabolisms:
|
metabolisms:
|
||||||
Medicine:
|
Medicine:
|
||||||
metabolismRate: 0.1
|
metabolismRate: 0.1
|
||||||
|
|||||||
Reference in New Issue
Block a user