ChatManager murder (#7337)

This commit is contained in:
mirrorcult
2022-03-30 22:21:58 -07:00
committed by GitHub
parent a11e8b676c
commit 70f0fffed2
16 changed files with 587 additions and 512 deletions

View File

@@ -1,4 +1,5 @@
using System.Threading;
using Content.Server.Chat;
using Content.Shared.Disease;
using Content.Shared.Disease.Components;
using Content.Server.Disease.Components;
@@ -40,6 +41,7 @@ namespace Content.Server.Disease
SubscribeLocalEvent<DiseaseCarrierComponent, CureDiseaseAttemptEvent>(OnTryCureDisease);
SubscribeLocalEvent<DiseasedComponent, InteractHandEvent>(OnInteractDiseasedHand);
SubscribeLocalEvent<DiseasedComponent, InteractUsingEvent>(OnInteractDiseasedUsing);
SubscribeLocalEvent<DiseasedComponent, EntitySpokeEvent>(OnEntitySpeak);
SubscribeLocalEvent<DiseaseProtectionComponent, GotEquippedEvent>(OnEquipped);
SubscribeLocalEvent<DiseaseProtectionComponent, GotUnequippedEvent>(OnUnequipped);
SubscribeLocalEvent<DiseaseVaccineComponent, AfterInteractEvent>(OnAfterInteract);
@@ -204,6 +206,14 @@ namespace Content.Server.Disease
InteractWithDiseased(args.Target, args.User);
}
private void OnEntitySpeak(EntityUid uid, DiseasedComponent component, EntitySpokeEvent args)
{
if (TryComp<DiseaseCarrierComponent>(uid, out var carrier))
{
SneezeCough(uid, _random.Pick(carrier.Diseases), string.Empty);
}
}
/// <summary>
/// Called when a vaccine is used on someone
/// to handle the vaccination doafter