public override void Effect(DiseaseEffectArgs args) { if (!args.EntityManager.TryGetComponent <BloodstreamComponent>(args.DiseasedEntity, out var bloodstream)) { return; } var stream = bloodstream.ChemicalSolution; if (stream != null) { var solutionSys = args.EntityManager.EntitySysManager.GetEntitySystem <SolutionContainerSystem>(); if (Reagent != null) { if (Amount < 0 && stream.ContainsReagent(Reagent)) { solutionSys.TryRemoveReagent(args.DiseasedEntity, stream, Reagent, -Amount); } if (Amount > 0) { solutionSys.TryAddReagent(args.DiseasedEntity, stream, Reagent, Amount, out _); } } } }
public override void Effect(DiseaseEffectArgs args) { if (SnoughSound != null) { SoundSystem.Play(SnoughSound.GetSound(), Filter.Pvs(args.DiseasedEntity), args.DiseasedEntity, AudioHelpers.WithVariation(0.2f)); } EntitySystem.Get <DiseaseSystem>().SneezeCough(args.DiseasedEntity, args.Disease, SnoughMessage, AirTransmit); }
public override bool Cure(DiseaseEffectArgs args) { if (!args.EntityManager.TryGetComponent(args.DiseasedEntity, out TemperatureComponent? temp)) { return(false); } return(temp.CurrentTemperature > Min && temp.CurrentTemperature < float.MaxValue); }
public override bool Cure(DiseaseEffectArgs args) { if (!args.EntityManager.TryGetComponent <BuckleComponent>(args.DiseasedEntity, out var buckle)) { return(false); } if (buckle.Buckled) { Ticker++; } return(Ticker >= MaxLength); }
public override void Effect(DiseaseEffectArgs args) { var popupSys = EntitySystem.Get <SharedPopupSystem>(); if (Type == PopupType.Local) { popupSys.PopupEntity(Loc.GetString(Message), args.DiseasedEntity, Filter.Entities(args.DiseasedEntity)); } else if (Type == PopupType.Pvs) { popupSys.PopupEntity(Loc.GetString(Message, ("person", args.DiseasedEntity)), args.DiseasedEntity, Filter.Pvs(args.DiseasedEntity)); } }
public override void Effect(DiseaseEffectArgs args) { var popupSys = args.EntityManager.EntitySysManager.GetEntitySystem <SharedPopupSystem>(); if (Type == PopupRecipients.Local) { popupSys.PopupEntity(Loc.GetString(Message), args.DiseasedEntity, Filter.Entities(args.DiseasedEntity), VisualType); } else if (Type == PopupRecipients.Pvs) { popupSys.PopupEntity(Loc.GetString(Message, ("person", Identity.Entity(args.DiseasedEntity, args.EntityManager))), args.DiseasedEntity, Filter.Pvs(args.DiseasedEntity), VisualType); } }
public override void Effect(DiseaseEffectArgs args) { EntityUid?polyUid = EntitySystem.Get <PolymorphableSystem>().PolymorphEntity(args.DiseasedEntity, PolymorphId); if (PolymorphSound != null && polyUid != null) { SoundSystem.Play(PolymorphSound.GetSound(), Filter.Pvs(polyUid.Value), polyUid.Value, AudioHelpers.WithVariation(0.2f)); } if (PolymorphMessage != null && polyUid != null) { EntitySystem.Get <SharedPopupSystem>().PopupEntity(Loc.GetString(PolymorphMessage), polyUid.Value, Filter.Entities(polyUid.Value), Shared.Popups.PopupType.Large); } }
public override bool Cure(DiseaseEffectArgs args) { if (!args.EntityManager.TryGetComponent <BloodstreamComponent>(args.DiseasedEntity, out var bloodstream)) { return(false); } var quant = FixedPoint2.Zero; if (Reagent != null && bloodstream.ChemicalSolution.ContainsReagent(Reagent)) { quant = bloodstream.ChemicalSolution.GetReagentQuantity(Reagent); } return(quant >= Min); }
public override void Effect(DiseaseEffectArgs args) { if (Comp == null) { return; } EntityUid uid = args.DiseasedEntity; var newComponent = (Component)IoCManager.Resolve <IComponentFactory>().GetComponent(Comp); newComponent.Owner = uid; if (!args.EntityManager.HasComponent(uid, newComponent.GetType())) { args.EntityManager.AddComponent(uid, newComponent); } }
public override void Effect(DiseaseEffectArgs args) { var statusSys = EntitySystem.Get <StatusEffectsSystem>(); if (Type == StatusEffectDiseaseType.Add && Component != String.Empty) { statusSys.TryAddStatusEffect(args.DiseasedEntity, Key, TimeSpan.FromSeconds(Time), Refresh, Component); } else if (Type == StatusEffectDiseaseType.Remove) { statusSys.TryRemoveTime(args.DiseasedEntity, Key, TimeSpan.FromSeconds(Time)); } else if (Type == StatusEffectDiseaseType.Set) { statusSys.TrySetTime(args.DiseasedEntity, Key, TimeSpan.FromSeconds(Time)); } }
public override bool Cure(DiseaseEffectArgs args) { if (!args.EntityManager.TryGetComponent <BuckleComponent>(args.DiseasedEntity, out var buckle) || !args.EntityManager.HasComponent <HealOnBuckleComponent>(buckle.BuckledTo?.Owner)) { return(false); } var ticks = 1; if (args.EntityManager.HasComponent <SleepingComponent>(args.DiseasedEntity)) { ticks *= SleepMultiplier; } if (buckle.Buckled) { Ticker += ticks; } return(Ticker >= MaxLength); }
/// <summary> /// What effect the disease will have. /// </summary> public abstract void Effect(DiseaseEffectArgs args);
public override void Effect(DiseaseEffectArgs args) { var vomitSys = args.EntityManager.EntitySysManager.GetEntitySystem <VomitSystem>(); vomitSys.Vomit(args.DiseasedEntity, ThirstAmount, HungerAmount); }
public override bool Cure(DiseaseEffectArgs args) { Ticker++; return(Ticker >= MaxLength); }
public override void Effect(DiseaseEffectArgs args) { EntitySystem.Get <DamageableSystem>().TryChangeDamage(args.DiseasedEntity, Damage, true, false); }
public override void Effect(DiseaseEffectArgs args) { EntitySystem.Get <DiseaseSystem>().SneezeCough(args.DiseasedEntity, args.Disease, SnoughMessage, AirTransmit); }
/// <summary> /// This returns true if the disease should be cured /// and false otherwise /// </summary> public abstract bool Cure(DiseaseEffectArgs args);