Beds, Medical Beds, Stasis Beds (#6695)
This commit is contained in:
@@ -4,6 +4,7 @@ using Content.Shared.Disease;
|
||||
using Content.Shared.Disease.Components;
|
||||
using Content.Server.Disease.Components;
|
||||
using Content.Server.Clothing.Components;
|
||||
using Content.Server.Body.Systems;
|
||||
using Content.Shared.MobState.Components;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Inventory;
|
||||
@@ -47,6 +48,8 @@ namespace Content.Server.Disease
|
||||
SubscribeLocalEvent<DiseaseProtectionComponent, GotUnequippedEvent>(OnUnequipped);
|
||||
SubscribeLocalEvent<DiseaseVaccineComponent, AfterInteractEvent>(OnAfterInteract);
|
||||
SubscribeLocalEvent<DiseaseVaccineComponent, ExaminedEvent>(OnExamined);
|
||||
// Handling stuff from other systems
|
||||
SubscribeLocalEvent<DiseaseCarrierComponent, ApplyMetabolicMultiplierEvent>(OnApplyMetabolicMultiplier);
|
||||
// Private events stuff
|
||||
SubscribeLocalEvent<TargetVaxxSuccessfulEvent>(OnTargetVaxxSuccessful);
|
||||
SubscribeLocalEvent<VaxxCancelledEvent>(OnVaxxCancelled);
|
||||
@@ -285,6 +288,26 @@ namespace Content.Server.Disease
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnApplyMetabolicMultiplier(EntityUid uid, DiseaseCarrierComponent component, ApplyMetabolicMultiplierEvent args)
|
||||
{
|
||||
if (args.Apply)
|
||||
{
|
||||
foreach (var disease in component.Diseases)
|
||||
{
|
||||
disease.TickTime *= args.Multiplier;
|
||||
return;
|
||||
}
|
||||
}
|
||||
foreach (var disease in component.Diseases)
|
||||
{
|
||||
disease.TickTime /= args.Multiplier;
|
||||
if (disease.Accumulator >= disease.TickTime)
|
||||
disease.Accumulator = disease.TickTime;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Helper functions
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user