Donk co. microwave + microwave tweaks (#28951)

* THE syndie microwave

* Always burn to explode microwave when copying

* Make it so copying ids stop when the microwave is goign to explode

* Made explosion destroy the board and spit out the machine parts

* Move logic is MicrowaveSystem, make metal cooking use the same logic

* Fix passing the wrong malfunction time

* Shuttle cannot escape aggressive branding

* Always make it explode with an id

* Forgot to invert bool, move it after fry chance
This commit is contained in:
Verm
2024-06-14 22:00:00 -05:00
committed by GitHub
parent 7d0798cea5
commit 41a081d5ef
15 changed files with 99 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ using Content.Shared.Database;
using Content.Shared.Popups;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Content.Server.Kitchen.EntitySystems;
namespace Content.Server.Access.Systems;
@@ -18,6 +19,7 @@ public sealed class IdCardSystem : SharedIdCardSystem
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly MicrowaveSystem _microwave = default!;
public override void Initialize()
{
@@ -27,12 +29,13 @@ public sealed class IdCardSystem : SharedIdCardSystem
private void OnMicrowaved(EntityUid uid, IdCardComponent component, BeingMicrowavedEvent args)
{
if (!component.CanMicrowave)
return;
if (!component.CanMicrowave || !TryComp<MicrowaveComponent>(args.Microwave, out var micro) || micro.Broken)
return;
if (TryComp<AccessComponent>(uid, out var access))
{
float randomPick = _random.NextFloat();
// if really unlucky, burn card
if (randomPick <= 0.15f)
{
@@ -49,6 +52,14 @@ public sealed class IdCardSystem : SharedIdCardSystem
EntityManager.QueueDeleteEntity(uid);
return;
}
//Explode if the microwave can't handle it
if (!micro.CanMicrowaveIdsSafely)
{
_microwave.Explode((args.Microwave, micro));
return;
}
// If they're unlucky, brick their ID
if (randomPick <= 0.25f)
{
@@ -73,6 +84,7 @@ public sealed class IdCardSystem : SharedIdCardSystem
_adminLogger.Add(LogType.Action, LogImpact.Medium,
$"{ToPrettyString(args.Microwave)} added {random.ID} access to {ToPrettyString(uid):entity}");
}
}
}