Rodents can be Faxecuted (executed via Fax machine) (#21461)
* Rodents can be Faxecuted (executed via Fax machine) * use brute instead of new group. * fax visuals now use tags for mouse and hamster instead of comps * fix for ubuntu, damn ubuntu bane of my life * cant copy hamlet, can now faxecute mothroaches. * fix * fix * fixes * removed ifs now using switch, removed hastag now using string. * fixes and no more switch * cleanup * more cleanup * fix * cleanup * moved damage out of faxmachine and into own system and component. * changes * fixes and done i think. * tidy * Fixes --------- Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -16,7 +16,10 @@ using Content.Shared.DeviceNetwork;
|
||||
using Content.Shared.Emag.Components;
|
||||
using Content.Shared.Emag.Systems;
|
||||
using Content.Shared.Fax;
|
||||
using Content.Shared.Fax.Systems;
|
||||
using Content.Shared.Fax.Components;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Paper;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
@@ -42,6 +45,7 @@ public sealed class FaxSystem : EntitySystem
|
||||
[Dependency] private readonly UserInterfaceSystem _userInterface = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly MetaDataSystem _metaData = default!;
|
||||
[Dependency] private readonly FaxecuteSystem _faxecute = default!;
|
||||
|
||||
private const string PaperSlotId = "Paper";
|
||||
|
||||
@@ -313,12 +317,18 @@ public sealed class FaxSystem : EntitySystem
|
||||
|
||||
private void OnCopyButtonPressed(EntityUid uid, FaxMachineComponent component, FaxCopyMessage args)
|
||||
{
|
||||
Copy(uid, component, args);
|
||||
if (HasComp<MobStateComponent>(component.PaperSlot.Item))
|
||||
_faxecute.Faxecute(uid, component); /// when button pressed it will hurt the mob.
|
||||
else
|
||||
Copy(uid, component, args);
|
||||
}
|
||||
|
||||
private void OnSendButtonPressed(EntityUid uid, FaxMachineComponent component, FaxSendMessage args)
|
||||
{
|
||||
Send(uid, component, args.Actor);
|
||||
if (HasComp<MobStateComponent>(component.PaperSlot.Item))
|
||||
_faxecute.Faxecute(uid, component); /// when button pressed it will hurt the mob.
|
||||
else
|
||||
Send(uid, component, args.Actor);
|
||||
}
|
||||
|
||||
private void OnRefreshButtonPressed(EntityUid uid, FaxMachineComponent component, FaxRefreshMessage args)
|
||||
@@ -336,14 +346,20 @@ public sealed class FaxSystem : EntitySystem
|
||||
if (!Resolve(uid, ref component))
|
||||
return;
|
||||
|
||||
if (TryComp<FaxableObjectComponent>(component.PaperSlot.Item, out var faxable))
|
||||
component.InsertingState = faxable.InsertingState;
|
||||
|
||||
|
||||
if (component.InsertingTimeRemaining > 0)
|
||||
{
|
||||
_appearanceSystem.SetData(uid, FaxMachineVisuals.VisualState, FaxMachineVisualState.Inserting);
|
||||
Dirty(uid, component);
|
||||
}
|
||||
else if (component.PrintingTimeRemaining > 0)
|
||||
_appearanceSystem.SetData(uid, FaxMachineVisuals.VisualState, FaxMachineVisualState.Printing);
|
||||
else
|
||||
_appearanceSystem.SetData(uid, FaxMachineVisuals.VisualState, FaxMachineVisualState.Normal);
|
||||
}
|
||||
|
||||
private void UpdateUserInterface(EntityUid uid, FaxMachineComponent? component = null)
|
||||
{
|
||||
if (!Resolve(uid, ref component))
|
||||
@@ -477,7 +493,7 @@ public sealed class FaxSystem : EntitySystem
|
||||
return;
|
||||
|
||||
if (!TryComp<MetaDataComponent>(sendEntity, out var metadata) ||
|
||||
!TryComp<PaperComponent>(sendEntity, out var paper))
|
||||
!TryComp<PaperComponent>(sendEntity, out var paper))
|
||||
return;
|
||||
|
||||
var payload = new NetworkPayload()
|
||||
|
||||
Reference in New Issue
Block a user