using Content.Server.Chemistry.Containers.EntitySystems;
-using Content.Server.Explosion.Components;
using Content.Server.Explosion.EntitySystems;
using Content.Server.Fluids.EntitySystems;
using Content.Server.Nutrition.Components;
using Content.Server.Popups;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.Explosion.Components;
-using Content.Shared.Interaction;
+using Content.Shared.Nutrition;
using Content.Shared.Nutrition.Components;
using Content.Shared.Nutrition.EntitySystems;
using Content.Shared.Rejuvenate;
{
base.Initialize();
- SubscribeLocalEvent<CreamPieComponent, InteractUsingEvent>(OnInteractUsing);
+ // activate BEFORE entity is deleted and trash is spawned
+ SubscribeLocalEvent<CreamPieComponent, ConsumeDoAfterEvent>(OnConsume, before: [typeof(FoodSystem)]);
+ SubscribeLocalEvent<CreamPieComponent, SliceFoodEvent>(OnSlice);
+
SubscribeLocalEvent<CreamPiedComponent, RejuvenateEvent>(OnRejuvenate);
}
EntityManager.QueueDeleteEntity(uid);
}
- private void OnInteractUsing(Entity<CreamPieComponent> entity, ref InteractUsingEvent args)
+ private void OnConsume(Entity<CreamPieComponent> entity, ref ConsumeDoAfterEvent args)
+ {
+ ActivatePayload(entity);
+ }
+
+ private void OnSlice(Entity<CreamPieComponent> entity, ref SliceFoodEvent args)
{
ActivatePayload(entity);
}
using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Server.Nutrition.Components;
+using Content.Shared.Nutrition;
using Content.Shared.Nutrition.Components;
using Content.Shared.Chemistry.Components;
using Content.Shared.Examine;
FillSlice(sliceUid, lostSolution);
_audio.PlayPvs(component.Sound, transform.Coordinates, AudioParams.Default.WithVolume(-2));
+ var ev = new SliceFoodEvent();
+ RaiseLocalEvent(uid, ref ev);
// Decrease size of item based on count - Could implement in the future
// Bug with this currently is the size in a container is not updated