Microwave rework (#6470)

This commit is contained in:
mirrorcult
2022-02-12 17:53:54 -07:00
committed by GitHub
parent be853b2529
commit 9adfde9ee3
16 changed files with 243 additions and 196 deletions

View File

@@ -13,6 +13,7 @@ using Robust.Shared.IoC;
using Robust.Shared.Localization;
using System;
using System.Diagnostics.CodeAnalysis;
using Content.Server.Kitchen.Components;
namespace Content.Server.PowerCell;
@@ -31,6 +32,26 @@ public class PowerCellSystem : SharedPowerCellSystem
SubscribeLocalEvent<PowerCellComponent, SolutionChangedEvent>(OnSolutionChange);
SubscribeLocalEvent<PowerCellComponent, ExaminedEvent>(OnCellExamined);
// funny
SubscribeLocalEvent<PowerCellSlotComponent, BeingMicrowavedEvent>(OnSlotMicrowaved);
SubscribeLocalEvent<BatteryComponent, BeingMicrowavedEvent>(OnMicrowaved);
}
private void OnSlotMicrowaved(EntityUid uid, PowerCellSlotComponent component, BeingMicrowavedEvent args)
{
if (component.CellSlot.Item == null)
return;
RaiseLocalEvent(component.CellSlot.Item.Value, args, false);
}
private void OnMicrowaved(EntityUid uid, BatteryComponent component, BeingMicrowavedEvent args)
{
args.Handled = true;
// What the fuck are you doing???
Explode(uid, component);
}
private void OnChargeChanged(EntityUid uid, PowerCellComponent component, ChargeChangedEvent args)