Microwaves no longer instantly gib living creatures Microwaves now heat in real-time
* Animal cruelty nerf - microwaves no longer instantly gib, and now heat in realtime * While we're at it there's honestly no need for this shit to be hardcoded
This commit is contained in:
@@ -37,7 +37,6 @@ public sealed class BodySystem : SharedBodySystem
|
|||||||
|
|
||||||
SubscribeLocalEvent<BodyComponent, MoveInputEvent>(OnRelayMoveInput);
|
SubscribeLocalEvent<BodyComponent, MoveInputEvent>(OnRelayMoveInput);
|
||||||
SubscribeLocalEvent<BodyComponent, ApplyMetabolicMultiplierEvent>(OnApplyMetabolicMultiplier);
|
SubscribeLocalEvent<BodyComponent, ApplyMetabolicMultiplierEvent>(OnApplyMetabolicMultiplier);
|
||||||
SubscribeLocalEvent<BodyComponent, BeingMicrowavedEvent>(OnBeingMicrowaved);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnRelayMoveInput(EntityUid uid, BodyComponent component, ref MoveInputEvent args)
|
private void OnRelayMoveInput(EntityUid uid, BodyComponent component, ref MoveInputEvent args)
|
||||||
@@ -65,19 +64,6 @@ public sealed class BodySystem : SharedBodySystem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnBeingMicrowaved(EntityUid uid, BodyComponent component, BeingMicrowavedEvent args)
|
|
||||||
{
|
|
||||||
if (args.Handled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Don't microwave animals, kids
|
|
||||||
SharedTransform.AttachToGridOrMap(uid);
|
|
||||||
_appearance.SetData(args.Microwave, MicrowaveVisualState.Bloody, true);
|
|
||||||
GibBody(uid, false, component);
|
|
||||||
|
|
||||||
args.Handled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void AddPart(
|
protected override void AddPart(
|
||||||
EntityUid bodyUid,
|
EntityUid bodyUid,
|
||||||
EntityUid partUid,
|
EntityUid partUid,
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ namespace Content.Server.Kitchen.Components
|
|||||||
public string MachinePartCookTimeMultiplier = "Capacitor";
|
public string MachinePartCookTimeMultiplier = "Capacitor";
|
||||||
[DataField("cookTimeScalingConstant")]
|
[DataField("cookTimeScalingConstant")]
|
||||||
public float CookTimeScalingConstant = 0.5f;
|
public float CookTimeScalingConstant = 0.5f;
|
||||||
|
[DataField("baseHeatMultiplier"), ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public float BaseHeatMultiplier = 100;
|
||||||
|
[DataField("objectHeatMultiplier"), ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public float ObjectHeatMultiplier = 100;
|
||||||
|
|
||||||
[DataField("failureResult", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
[DataField("failureResult", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||||
public string BadRecipeEntityId = "FoodBadRecipe";
|
public string BadRecipeEntityId = "FoodBadRecipe";
|
||||||
|
|||||||
@@ -105,11 +105,11 @@ namespace Content.Server.Kitchen.EntitySystems
|
|||||||
/// <param name="time">The time on the microwave, in seconds.</param>
|
/// <param name="time">The time on the microwave, in seconds.</param>
|
||||||
private void AddTemperature(MicrowaveComponent component, float time)
|
private void AddTemperature(MicrowaveComponent component, float time)
|
||||||
{
|
{
|
||||||
var heatToAdd = time * 100;
|
var heatToAdd = time * component.BaseHeatMultiplier;
|
||||||
foreach (var entity in component.Storage.ContainedEntities)
|
foreach (var entity in component.Storage.ContainedEntities)
|
||||||
{
|
{
|
||||||
if (TryComp<TemperatureComponent>(entity, out var tempComp))
|
if (TryComp<TemperatureComponent>(entity, out var tempComp))
|
||||||
_temperature.ChangeHeat(entity, heatToAdd, false, tempComp);
|
_temperature.ChangeHeat(entity, heatToAdd * component.ObjectHeatMultiplier, false, tempComp);
|
||||||
|
|
||||||
if (!TryComp<SolutionContainerManagerComponent>(entity, out var solutions))
|
if (!TryComp<SolutionContainerManagerComponent>(entity, out var solutions))
|
||||||
continue;
|
continue;
|
||||||
@@ -482,10 +482,13 @@ namespace Content.Server.Kitchen.EntitySystems
|
|||||||
//check if there's still cook time left
|
//check if there's still cook time left
|
||||||
active.CookTimeRemaining -= frameTime;
|
active.CookTimeRemaining -= frameTime;
|
||||||
if (active.CookTimeRemaining > 0)
|
if (active.CookTimeRemaining > 0)
|
||||||
|
{
|
||||||
|
AddTemperature(microwave, frameTime);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
//this means the microwave has finished cooking.
|
//this means the microwave has finished cooking.
|
||||||
AddTemperature(microwave, active.TotalTime);
|
AddTemperature(microwave, Math.Max(frameTime + active.CookTimeRemaining, 0)); //Though there's still a little bit more heat to pump out
|
||||||
|
|
||||||
if (active.PortionedRecipe.Item1 != null)
|
if (active.PortionedRecipe.Item1 != null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user