Skip to content

Commit

Permalink
webedit jumpscare 1
Browse files Browse the repository at this point in the history
i am NOT installing a new copy of the repo and eating more diskspace for this one change, permit me to webedit

Signed-off-by: Eris <[email protected]>
  • Loading branch information
Erisfiregamer1 authored Nov 24, 2024
1 parent 5fe4b1e commit 3c0d4a0
Showing 1 changed file with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
using Content.Shared.Database;
using Content.Shared.Destructible;
using Content.Shared.DoAfter;
using Content.Shared.DragDrop;
using Content.Shared.Examine;
using Content.Shared.FixedPoint;
using Content.Shared.Hands.Components;
Expand Down Expand Up @@ -105,6 +106,8 @@ public override void Initialize()
SubscribeLocalEvent<DeepFryerComponent, SolutionChangedEvent>(OnSolutionChange);
SubscribeLocalEvent<DeepFryerComponent, ContainerRelayMovementEntityEvent>(OnRelayMovement);
SubscribeLocalEvent<DeepFryerComponent, InteractUsingEvent>(OnInteractUsing);
SubscribeLocalEvent<DeepFryerComponent, CanDropTargetEvent>(OnCanDragDropOn);
SubscribeLocalEvent<DeepFryerComponent, DragDropTargetEvent>(OnDragDropOn);

SubscribeLocalEvent<DeepFryerComponent, BeforeActivatableUIOpenEvent>(OnBeforeActivatableUIOpen);
SubscribeLocalEvent<DeepFryerComponent, DeepFryerRemoveItemMessage>(OnRemoveItem);
Expand Down Expand Up @@ -158,6 +161,12 @@ public FixedPoint2 GetOilVolume(EntityUid uid, DeepFryerComponent component)
return oilVolume;
}

private void OnDragDropOn(EntityUid uid, DeepFryerComponent component, ref DragDropTargetEvent args)
{
_containerSystem.Insert(args.Dragged, component.Storage);
args.Handled = true;
}

/// <summary>
/// Returns how much total waste is in the vat.
/// </summary>
Expand Down Expand Up @@ -332,12 +341,12 @@ private void DeepFry(EntityUid uid, DeepFryerComponent component, EntityUid item

MakeCrispy(item);

var itemComponent = Comp<ItemComponent>(item);
var oilToUse = 0;

// Determine how much solution to spend on this item.
var solutionQuantity = FixedPoint2.Min(
component.Solution.Volume,
itemComponent.Size.Id switch
if (HasComp<ItemComponent>(item)) {
var itemComponent = Comp<ItemComponent>(item);

oilToUse = (int) (itemComponent.Size.Id switch
{
"Tiny" => 1,
"Small" => 5,
Expand All @@ -347,6 +356,15 @@ private void DeepFry(EntityUid uid, DeepFryerComponent component, EntityUid item
"Ginormous" => 50,
_ => 10
} * component.SolutionSizeCoefficient);
} else {
oilToUse = 10; // Default until I figure out how in the 24 hells to get an entity's mass and just use that
}

// Determine how much solution to spend on this item.
var solutionQuantity = FixedPoint2.Min(
component.Solution.Volume,
oilToUse
);

if (component.Whitelist != null && component.Whitelist.IsValid(item, EntityManager) ||
beingEvent.TurnIntoFood)
Expand Down

0 comments on commit 3c0d4a0

Please sign in to comment.