Revert "Не должно ебануть (#170)"

This reverts commit aabdcec60c.
This commit is contained in:
BIGZi0348
2024-11-12 20:48:25 +03:00
parent aabdcec60c
commit 55fe86dde4
70 changed files with 186 additions and 1097 deletions

View File

@@ -44,18 +44,6 @@ public sealed class SubdermalImplantRemoved(EntityUid user, EntityUid target, Su
public SubdermalImplantComponent Component = component;
}
public sealed class ImplanterUsed(EntityUid implant, EntityUid implanter) : EventArgs
{
/// <summary>
/// Implant which was used
/// </summary>
public EntityUid Implant = implant;
/// <summary>
/// Implanter which was used
/// </summary>
public EntityUid Implanter = implanter;
}
//WD EDIT END
public abstract class SharedImplanterSystem : EntitySystem
@@ -125,7 +113,6 @@ public abstract class SharedImplanterSystem : EntitySystem
var ev = new TransferDnaEvent { Donor = target, Recipient = implanter };
RaiseLocalEvent(target, ref ev);
RaiseLocalEvent(implant.Value, new ImplanterUsed(implant.Value, implanter)); // WD
Dirty(implanter, component);
}

View File

@@ -54,7 +54,7 @@ public partial class InventorySystem
SubscribeLocalEvent<InventoryComponent, RefreshEquipmentHudEvent<ShowHungerIconsComponent>>(RelayInventoryEvent);
SubscribeLocalEvent<InventoryComponent, RefreshEquipmentHudEvent<ShowThirstIconsComponent>>(RelayInventoryEvent);
SubscribeLocalEvent<InventoryComponent, RefreshEquipmentHudEvent<ShowMindShieldIconsComponent>>(RelayInventoryEvent);
SubscribeLocalEvent<InventoryComponent, RefreshEquipmentHudEvent<ShowAntagonistIconsComponent>>(RelayInventoryEvent);
SubscribeLocalEvent<InventoryComponent, RefreshEquipmentHudEvent<ShowSyndicateIconsComponent>>(RelayInventoryEvent);
SubscribeLocalEvent<InventoryComponent, RefreshEquipmentHudEvent<ShowCriminalRecordIconsComponent>>(RelayInventoryEvent);
SubscribeLocalEvent<InventoryComponent, GetVerbsEvent<EquipmentVerb>>(OnGetEquipmentVerbs);

View File

@@ -14,26 +14,9 @@ public sealed class MobStateActionsSystem : EntitySystem
public override void Initialize()
{
SubscribeLocalEvent<MobStateActionsComponent, MobStateChangedEvent>(OnMobStateChanged);
SubscribeLocalEvent<MobStateComponent, ComponentInit>(OnMobStateComponentInit); // WD ahead of wizden
}
private void OnMobStateChanged(EntityUid uid, MobStateActionsComponent component, MobStateChangedEvent args)
{
ComposeActions(uid, component, args.NewMobState); // WD ahead of wizden
}
private void OnMobStateComponentInit(EntityUid uid, MobStateComponent component, ComponentInit args) // WD ahead of wizden
{
if (!TryComp<MobStateActionsComponent>(uid, out var mobStateActionsComp))
return;
ComposeActions(uid, mobStateActionsComp, component.CurrentState);
}
/// <summary>
/// Adds or removes actions from a mob based on mobstate.
/// </summary>
private void ComposeActions(EntityUid uid, MobStateActionsComponent component, MobState newMobState) // WD ahead of wizden
{
if (!TryComp<ActionsComponent>(uid, out var action))
return;
@@ -44,7 +27,7 @@ public sealed class MobStateActionsSystem : EntitySystem
}
component.GrantedActions.Clear();
if (!component.Actions.TryGetValue(newMobState, out var toGrant))
if (!component.Actions.TryGetValue(args.NewMobState, out var toGrant))
return;
foreach (var id in toGrant)

View File

@@ -6,4 +6,4 @@ namespace Content.Shared.Overlays;
/// This component allows you to identify members of the Syndicate faction.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class ShowAntagonistIconsComponent : Component {}
public sealed partial class ShowSyndicateIconsComponent : Component {}

View File

@@ -1,35 +0,0 @@
using Content.Shared.Body.Components;
using Content.Shared.Implants;
using Content.Shared.Tag;
namespace Content.Shared._White.Implants.VoiceActivatedBomb;
public abstract class SharedVoiceActivatedBombSystem : EntitySystem
{
[Dependency] protected readonly TagSystem Tag = default!;
protected const string VoiceActivatedBombTag = "VoiceActivatedBombImplant";
public override void Initialize()
{
SubscribeLocalEvent<BodyComponent, AddImplantAttemptEvent>(OnTryInsertVoiceActivatedBomb);
}
private void OnTryInsertVoiceActivatedBomb(Entity<BodyComponent> ent, ref AddImplantAttemptEvent args)
{
if (!Tag.HasTag(args.Implant, VoiceActivatedBombTag))
return;
var ev = new InsertVoiceActivatedBombEvent(args.User, args.Implant, args.Implanter);
RaiseLocalEvent(args.Implant, ev);
if (ev.Cancelled)
args.Cancel();
return;
}
}
public sealed class InsertVoiceActivatedBombEvent(EntityUid user, EntityUid implant, EntityUid implanter)
: CancellableEntityEventArgs
{
public readonly EntityUid User = user;
public readonly EntityUid Implant = implant;
public readonly EntityUid Implanter = implanter;
}