diff --git a/Content.Client/Ligyb/DiseaseRoleSystem.cs b/Content.Client/Ligyb/DiseaseRoleSystem.cs deleted file mode 100644 index 6300c63db37..00000000000 --- a/Content.Client/Ligyb/DiseaseRoleSystem.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Content.Shared.Humanoid; -using Content.Shared.Ligyb; -namespace Content.Client.Ligyb; - -public sealed class DiseaseRoleSystem : EntitySystem -{ - public override void Initialize() - { - base.Initialize(); - SubscribeNetworkEvent(OnInfect); - } - - - - private void OnInfect(ClientInfectEvent ev) - { - - var target = GetEntity(ev.Infected); - var performer = GetEntity(ev.Owner); - - if (!TryComp(target, out var body)) - return; - - var sick = EnsureComp(target); - sick.owner = performer; - sick.Inited = true; - if(TryComp(performer, out var comp)) - { - comp.Infected.Add(target); - } - } - -} diff --git a/Content.Client/Ligyb/SickSystem.cs b/Content.Client/Ligyb/SickSystem.cs deleted file mode 100644 index 7ada536154d..00000000000 --- a/Content.Client/Ligyb/SickSystem.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Content.Shared.Mind.Components; -using Content.Shared.Mobs.Systems; -using Content.Shared.NPC; -using Content.Shared.StatusIcon; -using Content.Shared.StatusIcon.Components; -using Robust.Client.Player; -using Robust.Shared.Prototypes; -using Content.Shared.Ligyb; -namespace Content.Client.Ligyb; -public sealed class SickSystem : EntitySystem -{ - [Dependency] private readonly IPrototypeManager _prototype = default!; - [Dependency] private readonly MobStateSystem _mobState = default!; - [Dependency] private readonly IPlayerManager _playerManager = default!; - public override void Initialize() - { - base.Initialize(); - - SubscribeLocalEvent(OnGetStatusIcon); - SubscribeNetworkEvent(OnUpdateInfect); - } - - private void OnUpdateInfect(UpdateInfectionsEvent args) - { - EnsureComp(GetEntity(args.Uid)).Inited = true; - } - - private void OnGetStatusIcon(EntityUid uid, SickComponent component, ref GetStatusIconsEvent args) - { - if (component.Inited) - { - if (_playerManager.LocalEntity != null) - { - if (HasComp(_playerManager.LocalEntity.Value)) - { - if (!args.InContainer && - !_mobState.IsDead(uid) && - !HasComp(uid) && - TryComp(uid, out var mindContainer) && - mindContainer.ShowExamineInfo) - { - args.StatusIcons.Add(_prototype.Index(component.Icon)); - } - } - } - } - } -} diff --git a/Content.Client/Ligyb/VaccinatorSystem.cs b/Content.Client/Ligyb/VaccinatorSystem.cs deleted file mode 100644 index 3e3045bb4fa..00000000000 --- a/Content.Client/Ligyb/VaccinatorSystem.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Content.Shared.Chemistry.EntitySystems; - -namespace Content.Client.Chemistry.EntitySystems; - -/// -public sealed class VaccinatorSystem : SharedVaccinatorSystem -{ - -} diff --git a/Content.Server/Ligyb/CureDiseaseInfection.cs b/Content.Server/Ligyb/CureDiseaseInfection.cs deleted file mode 100644 index cb570c69b66..00000000000 --- a/Content.Server/Ligyb/CureDiseaseInfection.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Content.Shared.Chemistry.Reagent; -using Robust.Shared.Prototypes; -using Content.Shared.Ligyb; -public sealed partial class CureDiseaseInfection : ReagentEffect -{ - [DataField] - public bool Innoculate; - - protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) - { - if (Innoculate) - return "ок"; - - return "окей"; - } - - public override void Effect(ReagentEffectArgs args) - { - var entityManager = args.EntityManager; - if (!entityManager.HasComponent(args.SolutionEntity)) return; - if (entityManager.TryGetComponent(args.SolutionEntity, out var sick)) - { - if (entityManager.TryGetComponent(sick.owner, out var disease)) - { - var comp = entityManager.EnsureComponent(args.SolutionEntity); - comp.Immune = Innoculate; - comp.Delay = TimeSpan.FromMinutes(2) + TimeSpan.FromSeconds(disease.Shield * 30); - } - } - } -} diff --git a/Content.Server/Ligyb/DiseaseImmuneClothingSystem.cs b/Content.Server/Ligyb/DiseaseImmuneClothingSystem.cs deleted file mode 100644 index 23627f85fe6..00000000000 --- a/Content.Server/Ligyb/DiseaseImmuneClothingSystem.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Content.Shared.Clothing.Components; -using Content.Shared.Inventory.Events; -using Content.Shared.Ligyb; -using Content.Shared.Examine; -using Content.Shared.Verbs; -using Robust.Shared.Utility; -namespace Content.Server.Ligyb; - -public sealed class DiseaseImmuneClothingSystem : EntitySystem -{ - [Dependency] private readonly ExamineSystemShared _examine = default!; - public override void Initialize() - { - base.Initialize(); - SubscribeLocalEvent(OnGotEquipped); - SubscribeLocalEvent(OnGotUnequipped); - SubscribeLocalEvent>(OnArmorVerbExamine); - } - - private void OnGotEquipped(EntityUid uid, DiseaseImmuneClothingComponent component, GotEquippedEvent args) - { - if (!TryComp(uid, out ClothingComponent? clothing)) - return; - var isCorrectSlot = clothing.Slots.HasFlag(args.SlotFlags); - if (!isCorrectSlot) - return; - - EnsureComp(args.Equipee).Prob += component.Prob; - if (Comp(args.Equipee).Prob > 1) Comp(args.Equipee).Prob = 1; - - component.IsActive = true; - } - - private void OnGotUnequipped(EntityUid uid, DiseaseImmuneClothingComponent component, GotUnequippedEvent args) - { - if (!component.IsActive) - return; - - EnsureComp(args.Equipee).Prob -= component.Prob; - if (Comp(args.Equipee).Prob < 0) Comp(args.Equipee).Prob = 0; - - component.IsActive = false; - } - - private void OnArmorVerbExamine(EntityUid uid, DiseaseImmuneClothingComponent component, GetVerbsEvent args) - { - if (!args.CanInteract || !args.CanAccess) - return; - - var examineMarkup = new FormattedMessage(); - examineMarkup.TryAddMarkup($"Защищает от заражения на {Convert.ToInt32(component.Prob*100)}%", out var _); - - _examine.AddDetailedExamineVerb(args, component, examineMarkup, - "Стерильность", "/Textures/Interface/VerbIcons/dot.svg.192dpi.png", - "Изучить показатели стерильности."); - } - -} diff --git a/Content.Server/Ligyb/DiseaseRoleSystem.cs b/Content.Server/Ligyb/DiseaseRoleSystem.cs deleted file mode 100644 index 90d7019296c..00000000000 --- a/Content.Server/Ligyb/DiseaseRoleSystem.cs +++ /dev/null @@ -1,198 +0,0 @@ -using Content.Shared.Actions; -using Robust.Shared.Random; -using Content.Shared.Ligyb; -using Content.Server.Store.Components; -using Content.Server.Store.Systems; -using Robust.Shared.Prototypes; -using Content.Shared.FixedPoint; -using Content.Shared.Popups; -namespace Content.Server.Ligyb; - -public sealed class DiseaseRoleSystem : SharedDiseaseRoleSystem -{ - [Dependency] private readonly IRobustRandom _random = default!; - [Dependency] private readonly SharedActionsSystem _actionsSystem = default!; - [Dependency] private readonly StoreSystem _store = default!; - [Dependency] private readonly SharedPopupSystem _popup = default!; - - - [ValidatePrototypeId] private const string DiseaseShopId = "ActionDiseaseShop"; - - public override void Initialize() - { - base.Initialize(); - - SubscribeLocalEvent(OnInit); - SubscribeLocalEvent(OnMapInit); - SubscribeLocalEvent(OnShop); - SubscribeLocalEvent(OnAddSymptom); - SubscribeLocalEvent(OnInfects); - - SubscribeLocalEvent(OnBaseChance); - SubscribeLocalEvent(OnCoughChance); - SubscribeLocalEvent(OnLethal); - SubscribeLocalEvent(OnShield); - } - - - private void OnLethal(EntityUid uid, DiseaseRoleComponent component, DiseaseAddLethalEvent args) - { - if(!TryRemoveMoney(uid, 15)) - { - _popup.PopupEntity($"Вам не хватает очков эволюции", uid, uid); - return; - } - component.Lethal += 1; - if (component.Lethal >= 5) - { - _actionsSystem.RemoveAction(uid, args.Action); - } - } - - private void OnShield(EntityUid uid, DiseaseRoleComponent component, DiseaseAddShieldEvent args) - { - if (!TryRemoveMoney(uid, 15)) - { - _popup.PopupEntity($"Вам не хватает очков эволюции", uid, uid); - return; - } - component.Shield += 1; - if (component.Shield >= 6) - { - _actionsSystem.RemoveAction(uid, args.Action); - } - } - - private void OnBaseChance(EntityUid uid, DiseaseRoleComponent component, DiseaseAddBaseChanceEvent args) - { - if (!TryRemoveMoney(uid, 20)) - { - _popup.PopupEntity($"Вам не хватает очков эволюции", uid, uid); - return; - } - if (component.BaseInfectChance < 0.9f) - component.BaseInfectChance += 0.1f; - else - { - component.BaseInfectChance = 1; - _actionsSystem.RemoveAction(uid, args.Action); - } - } - - private void OnCoughChance(EntityUid uid, DiseaseRoleComponent component, DiseaseAddCoughChanceEvent args) - { - if (!TryRemoveMoney(uid, 15)) - { - _popup.PopupEntity($"Вам не хватает очков эволюции", uid, uid); - return; - } - if (component.CoughInfectChance < 0.85f) - component.CoughInfectChance += 0.05f; - else - { - component.CoughInfectChance = 1; - _actionsSystem.RemoveAction(uid, args.Action); - } - } - - - private void OnInfects(InfectEvent args) - { - if (TryComp(args.Performer, out var component)) - { - if(component.FreeInfects > 0) - { - component.FreeInfects--; - OnInfect(args, 1); - } - else if (TryRemoveMoney(args.Performer, component.InfectCost)) - { - OnInfect(args); - } - } - } - - private void OnInit(EntityUid uid, DiseaseRoleComponent component, ComponentInit args) - { - - foreach (var (id, charges) in component.Actions) - { - EntityUid? actionId = null; - if (_actionsSystem.AddAction(uid, ref actionId, id)) - _actionsSystem.SetCharges(actionId, charges < 0 ? null : charges); - } - component.NewBloodReagent = _random.Pick(new List() { "DiseaseBloodFirst", "DiseaseBloodSecond", "DiseaseBloodThird" }); - component.Symptoms.Add("Headache", (1, 4)); - } - - private void OnMapInit(EntityUid uid, DiseaseRoleComponent component, MapInitEvent args) - { - _actionsSystem.AddAction(uid, DiseaseShopId); - } - - private void OnShop(EntityUid uid, DiseaseRoleComponent component, DiseaseShopActionEvent args) - { - if (!TryComp(uid, out var store)) - return; - _store.ToggleUi(uid, uid, store); - } - - void AddMoney(EntityUid uid, FixedPoint2 value) - { - if (TryComp(uid, out var diseaseComp)) - { - if (TryComp(uid, out var store)) - { - bool f = _store.TryAddCurrency(new Dictionary - { - {diseaseComp.CurrencyPrototype, value} - }, uid); - _store.UpdateUserInterface(uid, uid, store); - } - } - } - - bool TryRemoveMoney(EntityUid uid, FixedPoint2 value) - { - if (TryComp(uid, out var diseaseComp)) - { - if (TryComp(uid, out var store)) - { - if (store.Balance[diseaseComp.CurrencyPrototype] >= value) - { - _store.TryAddCurrency(new Dictionary - { - {diseaseComp.CurrencyPrototype, -value} - }, uid); - _store.UpdateUserInterface(uid, uid, store); - return true; - } else - { - return false; - } - } - } - return false; - } - - private void OnAddSymptom(EntityUid uid, DiseaseRoleComponent component, DiseaseAddSymptomEvent args) - { - component.Symptoms.Add(args.Symptom, (args.MinLevel, args.MaxLevel)); - _actionsSystem.RemoveAction(uid, args.Action); - } - - //private void OnZombie(EntityUid uid, DiseaseRoleComponent component, DiseaseZombieEvent args) - //{ - // var inf = component.Infected.ToArray(); - // foreach(EntityUid infected in inf) - // { - // if (_random.Prob(0.8f)) { - // RemComp(infected); - // component.Infected.Remove(infected); - // EnsureComp(infected); - // EnsureComp(infected); - // } - // } - //} - -} diff --git a/Content.Server/Ligyb/MinimumBleedComponent.cs b/Content.Server/Ligyb/MinimumBleedComponent.cs deleted file mode 100644 index d66344946bb..00000000000 --- a/Content.Server/Ligyb/MinimumBleedComponent.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Content.Shared.StatusIcon; -using Robust.Shared.GameStates; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; - -namespace Content.Server.Ligyb; - -[RegisterComponent] -public sealed partial class MinimumBleedComponent : Component -{ - [DataField] public float MinValue = 1f; -} diff --git a/Content.Server/Ligyb/MinimumBleedSystem.cs b/Content.Server/Ligyb/MinimumBleedSystem.cs deleted file mode 100644 index 29db030f71b..00000000000 --- a/Content.Server/Ligyb/MinimumBleedSystem.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Robust.Shared.Configuration; -namespace Content.Server.Ligyb; -using Robust.Shared.Prototypes; -using Robust.Shared.Timing; -using Content.Server.Body.Components; -using Content.Server.Body.Systems; -using Content.Server.Chat.Systems; -using Robust.Server.GameObjects; -using Robust.Shared.Audio.Systems; -using Robust.Shared.Map; -using Robust.Shared.Random; -using Content.Server.Store.Systems; -using Content.Server.Popups; -using Content.Shared.Damage; -using Content.Shared.Mobs.Systems; -using Content.Server.Medical; -public sealed class MinimumBleedSystem : EntitySystem -{ - [Dependency] private readonly BloodstreamSystem _bloodstream = default!; - public override void Initialize() - { - base.Initialize(); - } - - public override void Update(float frameTime) - { - base.Update(frameTime); - - var query = EntityQueryEnumerator(); - while (query.MoveNext(out var uid, out var component)) - { - if(TryComp(uid, out var blood)) - { - if(blood.BleedAmount < component.MinValue) - { - _bloodstream.TryModifyBleedAmount(uid, component.MinValue, blood); - } - } - } - } -} diff --git a/Content.Server/Ligyb/SickSystem.cs b/Content.Server/Ligyb/SickSystem.cs deleted file mode 100644 index fc0e468c266..00000000000 --- a/Content.Server/Ligyb/SickSystem.cs +++ /dev/null @@ -1,287 +0,0 @@ -using Robust.Shared.Prototypes; -using Robust.Shared.Timing; -using Content.Shared.Ligyb; -using System.Numerics; -using Content.Server.Body.Components; -using Content.Server.Body.Systems; -using Content.Server.Chat.Systems; -using Content.Shared.Interaction.Events; -using Robust.Server.GameObjects; -using Robust.Shared.Map; -using Robust.Shared.Random; -using Content.Shared.Humanoid; -using Content.Server.Store.Components; -using Content.Server.Store.Systems; -using Content.Server.Popups; -using Content.Shared.Popups; -using Content.Server.Chat; -using Content.Shared.Stunnable; -using Content.Shared.Damage.Prototypes; -using Content.Shared.Damage; -using Content.Server.Emoting.Systems; -using Content.Server.Speech.EntitySystems; -using Content.Shared.FixedPoint; -using Content.Server.Medical; -using Content.Server.Traits.Assorted; -using Content.Shared.Traits.Assorted; -using Content.Shared.Eye.Blinding.Components; -using Content.Shared.Item; -using Content.Shared.Speech.Muting; -using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components; -namespace Content.Server.Ligyb; -public sealed class SickSystem : SharedSickSystem -{ - [Dependency] private readonly AutoEmoteSystem _autoEmote = default!; - [Dependency] private readonly StoreSystem _store = default!; - [Dependency] private readonly IRobustRandom _robustRandom = default!; - [Dependency] private readonly IServerEntityManager _entityManager = default!; - [Dependency] private readonly VomitSystem _vomitSystem = default!; - [Dependency] private readonly BloodstreamSystem _bloodstream = default!; - [Dependency] private readonly IGameTiming _gameTiming = default!; - [Dependency] private readonly PopupSystem _popupSystem = default!; - [Dependency] private readonly DamageableSystem _damageableSystem = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - [Dependency] private readonly SharedStunSystem _stun = default!; - private EntityLookupSystem _lookup => _entityManager.System(); - public override void Initialize() - { - base.Initialize(); - - SubscribeLocalEvent(OnShut); - SubscribeLocalEvent(OnEmote, before: - new[] { typeof(VocalSystem), typeof(BodyEmotesSystem) }); - } - - public void OnShut(EntityUid uid, SickComponent component, ComponentShutdown args) - { - foreach (var emote in EnsureComp(uid).Emotes) - { - if (emote.Contains("Infected")) - { - _autoEmote.RemoveEmote(uid, emote); - } - } - foreach (var key in component.Symptoms) - { - switch (key) - { - case "Narcolepsy": - if (TryComp(uid, out var narc)) - { - RemComp(uid); - } - break; - case "Muted": - if (TryComp(uid, out var mute)) - { - RemComp(uid); - } - break; - case "Blindness": - if (TryComp(uid, out var blind)) - { - RemComp(uid); - } - if (HasComp(uid)) - { - RemComp(uid); - } - if (HasComp(uid)) - { - RemComp(uid); - } - break; - case "Slowness": - if (TryComp(uid, out var slow)) - { - RemComp(uid); - } - break; - case "Bleed": - if (TryComp(uid, out var bleed)) - { - RemComp(uid); - } - break; - } - } - _bloodstream.ChangeBloodReagent(uid, component.BeforeInfectedBloodReagent); - } - public override void Update(float frameTime) - { - base.Update(frameTime); - - var query = EntityQueryEnumerator(); - while (query.MoveNext(out var uid, out var component)) - { - if (TryComp(component.owner, out var diseaseComp)) - { - UpdateInfection(uid, component, component.owner, diseaseComp); - if (!component.Inited) - { - //Infect - if (TryComp(uid, out var stream)) - component.BeforeInfectedBloodReagent = stream.BloodReagent; - _bloodstream.ChangeBloodReagent(uid, diseaseComp.NewBloodReagent); - - RaiseNetworkEvent(new ClientInfectEvent(GetNetEntity(uid), GetNetEntity(component.owner))); - AddMoney(uid, 5); - - component.Inited = true; - } - else - { - if (_gameTiming.CurTime >= component.NextStadyAt) - { - component.Stady++; - foreach (var emote in EnsureComp(uid).Emotes) - { - if (emote.Contains("Infected")) - { - _autoEmote.RemoveEmote(uid, emote); - } - } - component.Symptoms.Clear(); - component.NextStadyAt = _gameTiming.CurTime + component.StadyDelay; - } - } - } - } - } - - void AddMoney(EntityUid uid, FixedPoint2 value) - { - if (TryComp(uid, out var component)) - { - if (TryComp(component.owner, out var diseaseComp)) - { - if (TryComp(component.owner, out var store)) - { - bool f = _store.TryAddCurrency(new Dictionary - { - {diseaseComp.CurrencyPrototype, value} - }, component.owner); - _store.UpdateUserInterface(component.owner, component.owner, store); - } - } - } - } - - private void UpdateInfection(EntityUid uid, SickComponent component, EntityUid disease, DiseaseRoleComponent diseaseComponent) - { - foreach ((var key, (var min, var max)) in diseaseComponent.Symptoms) - { - if (!component.Symptoms.Contains(key)) - { - if (component.Stady >= min && component.Stady <= max) - { - component.Symptoms.Add(key); - EnsureComp(uid); - switch (key) - { - case "Headache": - _autoEmote.AddEmote(uid, "InfectedHeadache"); - break; - case "Cough": - _autoEmote.AddEmote(uid, "InfectedCough"); - break; - case "Sneeze": - _autoEmote.AddEmote(uid, "InfectedSneeze"); - break; - case "Vomit": - _autoEmote.AddEmote(uid, "InfectedVomit"); - break; - case "Crying": - _autoEmote.AddEmote(uid, "InfectedCrying"); - break; - case "Narcolepsy": - if (!HasComp(uid)) - { - var c = AddComp(uid); - EntityManager.EntitySysManager.GetEntitySystem().SetNarcolepsy(uid, new Vector2(10, 30), new Vector2(300, 600), c); - } - break; - case "Muted": - EnsureComp(uid); - break; - case "Blindness": - EnsureComp(uid); - break; - case "Slowness": - EnsureComp(uid); - break; - case "Bleed": - EnsureComp(uid); - break; - case "Insult": - _autoEmote.AddEmote(uid, "InfectedInsult"); - break; - } - } - } - } - } - - private void OnEmote(EntityUid uid, SickComponent component, ref EmoteEvent args) - { - if (args.Handled) - return; - args.Handled = true; - switch (args.Emote.ID) - { - case "Headache": - _popupSystem.PopupEntity("Вы чувствуете лёгкую головную боль.", uid, uid, PopupType.Small); - break; - case "Cough": - if (_robustRandom.Prob(0.9f)) - { - if (TryComp(component.owner, out var disease)) { - var kind = SuicideKind.Piercing; - if (_prototypeManager.TryIndex(kind.ToString(), out var damagePrototype)) - { - _damageableSystem.TryChangeDamage(uid, new(damagePrototype, 0.25f * disease.Lethal), true, origin: uid); - } - } - EntityCoordinates start = Transform(uid).Coordinates; - foreach (var entity in _lookup.GetEntitiesInRange(uid, 0.7f)) - { - if (HasComp(entity) && !HasComp(entity) && !HasComp(entity)) - { - OnInfected(entity, component.owner, Comp(component.owner).CoughInfectChance); - } - } - } - break; - case "Sneeze": - if (_robustRandom.Prob(0.9f)) - { - EntityCoordinates start = Transform(uid).Coordinates; - foreach (var entity in _lookup.GetEntitiesInRange(uid, 1.2f)) - { - if (HasComp(entity) && !HasComp(entity) && !HasComp(entity)) - { - OnInfected(entity, component.owner, Comp(component.owner).CoughInfectChance); - } - } - } - break; - case "Vomit": - if (_robustRandom.Prob(0.4f)) - { - _vomitSystem.Vomit(uid, -30, -20); - } - break; - case "Insult": - if (TryComp(component.owner, out var dis)) - { - _stun.TryParalyze(uid, TimeSpan.FromSeconds(5), false); - var kind = SuicideKind.Shock; - if (_prototypeManager.TryIndex(kind.ToString(), out var damagePrototype)) - { - _damageableSystem.TryChangeDamage(uid, new(damagePrototype, 0.35f * dis.Lethal), true, origin: uid); - } - } - break; - } - } -} diff --git a/Content.Server/Ligyb/SleepyComponent.cs b/Content.Server/Ligyb/SleepyComponent.cs deleted file mode 100644 index 51c76a850c5..00000000000 --- a/Content.Server/Ligyb/SleepyComponent.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Numerics; - -namespace Content.Server.Traits.Assorted; - -[RegisterComponent, Access(typeof(NarcolepsySystem), typeof(SleepySystem))] -public sealed partial class SleepyComponent : Component -{ - [DataField("timeBetweenIncidents", required: true)] - public Vector2 TimeBetweenIncidents = new Vector2(300, 600); - - [DataField("durationOfIncident", required: true)] - public Vector2 DurationOfIncident = new Vector2(10, 30); - - public float NextIncidentTime; -} diff --git a/Content.Server/Ligyb/SleepySystem.cs b/Content.Server/Ligyb/SleepySystem.cs deleted file mode 100644 index 091518d3476..00000000000 --- a/Content.Server/Ligyb/SleepySystem.cs +++ /dev/null @@ -1,67 +0,0 @@ -using Content.Shared.Bed.Sleep; -using Content.Shared.StatusEffect; -using Robust.Shared.Random; -using System.Numerics; - -namespace Content.Server.Traits.Assorted; - -public sealed class SleepySystem : EntitySystem -{ - [ValidatePrototypeId] - private const string StatusEffectKey = "ForcedSleep"; // Same one used by N2O and other sleep chems. - - [Dependency] private readonly StatusEffectsSystem _statusEffects = default!; - [Dependency] private readonly IRobustRandom _random = default!; - public override void Initialize() - { - SubscribeLocalEvent(SetupNarcolepsy); - } - - private void SetupNarcolepsy(EntityUid uid, SleepyComponent component, ComponentStartup args) - { - component.NextIncidentTime = - _random.NextFloat(component.TimeBetweenIncidents.X, component.TimeBetweenIncidents.Y); - } - - public void AdjustNarcolepsyTimer(EntityUid uid, int TimerReset, SleepyComponent? narcolepsy = null) - { - if (!Resolve(uid, ref narcolepsy, false)) - return; - - narcolepsy.NextIncidentTime = TimerReset; - } - - public void SetNarcolepsy(EntityUid uid, Vector2 timeBetweenIncidents, Vector2 durationOfIncident, SleepyComponent? narcolepsy = null) - { - if (!Resolve(uid, ref narcolepsy, false)) - return; - narcolepsy.DurationOfIncident = durationOfIncident; - narcolepsy.TimeBetweenIncidents = timeBetweenIncidents; - } - - public override void Update(float frameTime) - { - base.Update(frameTime); - - var query = EntityQueryEnumerator(); - while (query.MoveNext(out var uid, out var narcolepsy)) - { - narcolepsy.NextIncidentTime -= frameTime; - - if (narcolepsy.NextIncidentTime >= 0) - continue; - - // Set the new time. - narcolepsy.NextIncidentTime += - _random.NextFloat(narcolepsy.TimeBetweenIncidents.X, narcolepsy.TimeBetweenIncidents.Y); - - var duration = _random.NextFloat(narcolepsy.DurationOfIncident.X, narcolepsy.DurationOfIncident.Y); - - // Make sure the sleep time doesn't cut into the time to next incident. - narcolepsy.NextIncidentTime += duration; - - _statusEffects.TryAddStatusEffect(uid, StatusEffectKey, - TimeSpan.FromSeconds(duration), false); - } - } -} diff --git a/Content.Server/Ligyb/VaccinatorSystem.cs b/Content.Server/Ligyb/VaccinatorSystem.cs deleted file mode 100644 index 080d61cf1ff..00000000000 --- a/Content.Server/Ligyb/VaccinatorSystem.cs +++ /dev/null @@ -1,145 +0,0 @@ -using Content.Server.Power.Components; -using Content.Server.Power.EntitySystems; -using Content.Shared.Chemistry.Components; -using Content.Shared.Chemistry.EntitySystems; -using Content.Server.Paper; -using Content.Shared.Chemistry.Components; -using Content.Shared.Chemistry.Reaction; -using Content.Shared.Interaction; -using Content.Shared.Popups; -using Robust.Shared.Audio.Systems; -using Robust.Shared.Containers; -using Robust.Shared.Network; -using Robust.Shared.Timing; -using System.Collections.Frozen; -using Content.Shared.Paper; -using Robust.Shared.Utility; -using static Content.Shared.Paper.SharedPaperComponent; -using Robust.Shared.Prototypes; -using System.Linq; -using Robust.Shared.Serialization; -using Content.Shared.Chemistry.Reagent; -using System.Linq; -using System.Text; -namespace Content.Server.Chemistry.EntitySystems; - -/// -public sealed class VaccinatorSystem : SharedVaccinatorSystem -{ - /// - /// - [Dependency] private readonly PaperSystem _paperSystem = default!; - [Dependency] private readonly MetaDataSystem _metaData = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - - /// - /// A cache of all reactions indexed by at most ONE of their required reactants. - /// I.e., even if a reaction has more than one reagent, it will only ever appear once in this dictionary. - /// - private FrozenDictionary> _reactionsSingle = default!; - - /// - /// A cache of all reactions indexed by one of their required reactants. - /// - private FrozenDictionary> _reactions = default!; - - - - public override void Initialize() - { - base.Initialize(); - InitializeReactionCache(); - - SubscribeLocalEvent(OnPowerChanged); - SubscribeNetworkEvent(OnPaper); - } - - - /// - /// Handles building the reaction cache. - /// - private void InitializeReactionCache() - { - // Construct single-reaction dictionary. - var dict = new Dictionary>(); - foreach (var reaction in _prototypeManager.EnumeratePrototypes()) - { - // For this dictionary we only need to cache based on the first reagent. - var reagent = reaction.Reactants.Keys.First(); - var list = dict.GetOrNew(reagent); - list.Add(reaction); - } - _reactionsSingle = dict.ToFrozenDictionary(); - - dict.Clear(); - foreach (var reaction in _prototypeManager.EnumeratePrototypes()) - { - foreach (var reagent in reaction.Reactants.Keys) - { - var list = dict.GetOrNew(reagent); - list.Add(reaction); - } - } - _reactions = dict.ToFrozenDictionary(); - } - - private void OnPaper(PaperInputTextMessageLigyb args) - { - EntityUid? paper = null; - bool printeds = false; - List wasProto = new List(); - foreach (var reactant in args.ReagentQuantity) - { - if(_prototypeManager.TryIndex(reactant.Reagent.Prototype, out ReagentPrototype? protoss)) - { - if(protoss.Group != "Infect") - { - if(paper != null) - { - EntityManager.DeleteEntity(paper); - return; - } - } - } - - if (wasProto.Contains(reactant.Reagent.Prototype)) { continue; } else { wasProto.Add(reactant.Reagent.Prototype); } - if (_reactions.TryGetValue(reactant.Reagent.Prototype, out var reactantReactions)) - { - if (printeds) continue; - else printeds = true; - var printed = EntityManager.SpawnEntity("ForensicReportPaper", Transform(GetEntity(args.Uid)).Coordinates); - paper = printed; - _metaData.SetEntityName(printed, "Технология изготовления вакцины"); - var text = new StringBuilder(); - text.AppendLine("Для изготовления вакцины, требуется:"); - text.AppendLine(); - foreach(var r in reactantReactions) - { - foreach(var reactan in r.Reactants) - { - if (r.MixingCategories == null) - { - _prototypeManager.TryIndex(reactan.Key, out ReagentPrototype? proto); - string no = ""; - text.AppendLine($"{proto?.LocalizedName ?? no}: {reactan.Value.Amount}u"); - } - } - } - text.AppendLine("После чего положить полученную жидкость в вакцинатор, добавив одну каплю крови здорового человека."); - - _paperSystem.SetContent(printed, text.ToString()); - } - } - } - - private void OnPowerChanged(Entity ent, ref PowerChangedEvent args) - { - if (!args.Powered) - StopMix(ent); - } - - protected override bool HasPower(Entity entity) - { - return this.IsPowered(entity, EntityManager); - } -} diff --git a/Content.Shared/Ligyb/DiseaseImmuneClothingComponent.cs b/Content.Shared/Ligyb/DiseaseImmuneClothingComponent.cs deleted file mode 100644 index 42ba0b0b00e..00000000000 --- a/Content.Shared/Ligyb/DiseaseImmuneClothingComponent.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Content.Shared.Ligyb; - -[RegisterComponent] -public sealed partial class DiseaseImmuneClothingComponent : Component -{ - [DataField] public float Prob; - [DataField] public bool IsActive; -} diff --git a/Content.Shared/Ligyb/DiseaseImmuneComponent.cs b/Content.Shared/Ligyb/DiseaseImmuneComponent.cs deleted file mode 100644 index acdc18b0237..00000000000 --- a/Content.Shared/Ligyb/DiseaseImmuneComponent.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Content.Shared.Ligyb; - -[RegisterComponent] -public sealed partial class DiseaseImmuneComponent : Component -{ - -} diff --git a/Content.Shared/Ligyb/DiseaseRoleComponent.cs b/Content.Shared/Ligyb/DiseaseRoleComponent.cs deleted file mode 100644 index c7bf6a0cb35..00000000000 --- a/Content.Shared/Ligyb/DiseaseRoleComponent.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Robust.Shared.Prototypes; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; -using Content.Shared.Store; -using Content.Shared.Chemistry.Reagent; -namespace Content.Shared.Ligyb; - -[RegisterComponent] -public sealed partial class DiseaseRoleComponent : Component -{ - [DataField("actions", customTypeSerializer: typeof(PrototypeIdDictionarySerializer))] - [ViewVariables(VVAccess.ReadWrite)] - public Dictionary Actions = new(); - - [DataField("infected")] - public List Infected = new(); - - [DataField] public EntityUid? Action; - - [DataField] public Dictionary Symptoms = new(); - - [DataField] public int FreeInfects = 3; - [DataField] public int InfectCost = 10; - - [DataField("currencyPrototype", customTypeSerializer: typeof(PrototypeIdSerializer))] - public string CurrencyPrototype = "DiseasePoints"; - - - [DataField] public float BaseInfectChance = 0.6f; - [DataField] public float CoughInfectChance = 0.2f; - - [DataField] public int Lethal = 0; - [DataField] public int Shield = 1; - - [DataField("newBloodReagent", customTypeSerializer: typeof(PrototypeIdSerializer))] - public string NewBloodReagent = "ZombieBlood"; -} diff --git a/Content.Shared/Ligyb/DiseaseTempImmuneComponent.cs b/Content.Shared/Ligyb/DiseaseTempImmuneComponent.cs deleted file mode 100644 index 0e9b3f771d5..00000000000 --- a/Content.Shared/Ligyb/DiseaseTempImmuneComponent.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Content.Shared.Ligyb; - -[RegisterComponent] -public sealed partial class DiseaseTempImmuneComponent : Component -{ - [DataField] public float Prob = 0; -} diff --git a/Content.Shared/Ligyb/DiseaseVaccineTimerComponent.cs b/Content.Shared/Ligyb/DiseaseVaccineTimerComponent.cs deleted file mode 100644 index 0f6372650fa..00000000000 --- a/Content.Shared/Ligyb/DiseaseVaccineTimerComponent.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Content.Shared.Ligyb; - -[RegisterComponent] -public sealed partial class DiseaseVaccineTimerComponent : Component -{ - [ViewVariables(VVAccess.ReadOnly)] - public TimeSpan ReadyAt = TimeSpan.Zero; - - [DataField] public TimeSpan Delay = TimeSpan.FromMinutes(5); - - [DataField] public float SpeedBefore = 0; - [DataField] public bool Immune; -} diff --git a/Content.Shared/Ligyb/DiseaseVaccineTimerSystem.cs b/Content.Shared/Ligyb/DiseaseVaccineTimerSystem.cs deleted file mode 100644 index 2d22f64e7de..00000000000 --- a/Content.Shared/Ligyb/DiseaseVaccineTimerSystem.cs +++ /dev/null @@ -1,61 +0,0 @@ -namespace Content.Shared.Ligyb; -using Robust.Shared.Timing; -using Content.Shared.Movement.Components; -using Content.Shared.Movement.Systems; - -public sealed class DiseaseVaccineTimerSystem : SharedSickSystem -{ - [Dependency] private readonly IGameTiming _gameTiming = default!; - [Dependency] private readonly MovementSpeedModifierSystem _movementSpeed = default!; - public override void Initialize() - { - base.Initialize(); - SubscribeLocalEvent(OnShut); - SubscribeLocalEvent(OnInit); - } - public void OnInit(EntityUid uid, DiseaseVaccineTimerComponent component, ComponentInit args) - { - component.ReadyAt = _gameTiming.CurTime + component.Delay; - if(TryComp(uid, out var speed)) - { - component.SpeedBefore = speed.BaseSprintSpeed; - _movementSpeed.ChangeBaseSpeed(uid, speed.BaseWalkSpeed, speed.BaseSprintSpeed / 2, speed.Acceleration, speed); - } - } - public void OnShut(EntityUid uid, DiseaseVaccineTimerComponent component, ComponentShutdown args) - { - if(component.SpeedBefore != 0) - { - if(TryComp(uid, out var speed)) - { - _movementSpeed.ChangeBaseSpeed(uid, speed.BaseWalkSpeed, component.SpeedBefore, speed.Acceleration, speed); - } - } - - } - public override void Update(float frameTime) - { - base.Update(frameTime); - var query = EntityQueryEnumerator(); - while (query.MoveNext(out var uid, out var component)) - { - if (_gameTiming.CurTime >= component.ReadyAt) - { - if (!HasComp(uid)) - { - RemComp(uid); - return; - } - - RemComp(uid); - - if (component.Immune) - { - EnsureComp(uid); - } - RemComp(uid); - } - } - } - -} diff --git a/Content.Shared/Ligyb/InfectEvent.cs b/Content.Shared/Ligyb/InfectEvent.cs deleted file mode 100644 index a5412449664..00000000000 --- a/Content.Shared/Ligyb/InfectEvent.cs +++ /dev/null @@ -1,111 +0,0 @@ -using Content.Shared.Actions; -using Content.Shared.Store; -using Robust.Shared.GameObjects; -using Robust.Shared.Serialization; -using System.Linq; -using Content.Shared.Administration.Logs; -using Content.Shared.Damage.Prototypes; -using Content.Shared.FixedPoint; -using Content.Shared.Inventory; -using Content.Shared.Mind.Components; -using Content.Shared.Mobs.Components; -using Content.Shared.Mobs.Systems; -using Content.Shared.Radiation.Events; -using Content.Shared.Rejuvenate; -using Robust.Shared.GameStates; -using Robust.Shared.Network; -using Robust.Shared.Prototypes; -using Robust.Shared.Utility; - -namespace Content.Shared.Ligyb; - -public sealed partial class InfectEvent : EntityTargetActionEvent -{ -} - -[Serializable, NetSerializable] -public sealed class InfectWithChanceEvent : EntityEventArgs, IInventoryRelayEvent -{ - // Whenever locational damage is a thing, this should just check only that bit of armour. - public bool Handled = false; - public SlotFlags TargetSlots { get; } = ~SlotFlags.POCKET; - - public readonly NetEntity Target; - public readonly NetEntity Disease; - public float Prob; - - public InfectWithChanceEvent(NetEntity target, NetEntity disease, float prob) - { - Prob = prob; - Target = target; - Disease = disease; - } -} - -[Serializable, NetSerializable] -public sealed partial class ClientInfectEvent : EntityEventArgs -{ - public NetEntity Infected { get; } - public NetEntity Owner { get; } - public ClientInfectEvent(NetEntity infected, NetEntity owner) - { - Infected = infected; - Owner = owner; - } -} - -public sealed partial class DiseaseShopActionEvent : InstantActionEvent -{ -} - - -[Serializable, NetSerializable] -public sealed partial class DiseaseBuyEvent : EntityEventArgs -{ - public readonly string BuyId; - - public DiseaseBuyEvent(string buyId = "Sus") - { - BuyId = buyId; - } -} - - -public sealed partial class DiseaseAddSymptomEvent : InstantActionEvent -{ - [DataField] public string Symptom; - [DataField] public int MinLevel = 0; - [DataField] public int MaxLevel = 9999; -} - - -public sealed partial class DiseaseAddBaseChanceEvent : InstantActionEvent -{ -} - -public sealed partial class DiseaseAddCoughChanceEvent : InstantActionEvent -{ -} - -public sealed partial class DiseaseAddLethalEvent : InstantActionEvent -{ -} - -public sealed partial class DiseaseAddShieldEvent : InstantActionEvent -{ -} - -[Serializable, NetSerializable] -public sealed class UpdateInfectionsEvent : EntityEventArgs -{ - public NetEntity Uid { get; } - public UpdateInfectionsEvent(NetEntity id) - { - Uid = id; - } -} - - - - - diff --git a/Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs b/Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs deleted file mode 100644 index 0b7e7ec3077..00000000000 --- a/Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Robust.Shared.Random; -using Content.Shared.Humanoid; - -namespace Content.Shared.Ligyb; - -public abstract class SharedDiseaseRoleSystem : EntitySystem -{ - [Dependency] private readonly IRobustRandom _robustRandom = default!; - public override void Initialize() - { - base.Initialize(); - } - public void OnInfect(InfectEvent ev, float probability = 0) - { - if (ev.Handled) - return; - ev.Handled = true; - - if (!TryComp(ev.Performer, out var comp)) return; - if (!HasComp(ev.Target)) return; - if (HasComp(ev.Target)) return; - if (HasComp(ev.Target)) return; - - var prob = probability; - if (probability == 0) prob = comp.BaseInfectChance; - if (TryComp(ev.Target, out var immune)) - prob -= immune.Prob; - prob = Math.Max(Math.Min(prob, 0), 1); - if (_robustRandom.Prob(prob)) - { - var comps = AddComp(ev.Target); - comps.owner = ev.Performer; - comp.Infected.Add(ev.Target); - } - } -} diff --git a/Content.Shared/Ligyb/SharedSickSystem.cs b/Content.Shared/Ligyb/SharedSickSystem.cs deleted file mode 100644 index cc414f99f75..00000000000 --- a/Content.Shared/Ligyb/SharedSickSystem.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Content.Shared.CCVar; -using Content.Shared.Mind.Components; -using Content.Shared.Mobs.Systems; -using Content.Shared.NPC; -using Content.Shared.SSDIndicator; -using Content.Shared.StatusIcon; -using Content.Shared.StatusIcon.Components; -using Robust.Shared.Configuration; -using Robust.Shared.Prototypes; -using Content.Shared.Ligyb; -namespace Content.Shared.Ligyb; -using Content.Shared.Drunk; -using Content.Shared.StatusEffect; -using Robust.Shared.Enums; -using Robust.Shared.Prototypes; -using Robust.Shared.Timing; -using Content.Shared.Ligyb; -using Robust.Shared.Random; -public abstract class SharedSickSystem : EntitySystem -{ - - [Dependency] private readonly IRobustRandom _robustRandom = default!; - public override void Initialize() - { - base.Initialize(); - } - - public void OnInfected(EntityUid uid, EntityUid disease, float prob) - { - if (HasComp(uid)) return; - - - if (_robustRandom.Prob(prob)) - { - EnsureComp(uid).owner = disease; - if (TryComp(disease, out var compd)) - { - compd.Infected.Add(uid); - } - RaiseNetworkEvent(new UpdateInfectionsEvent(GetNetEntity(uid))); - } - - } -} diff --git a/Content.Shared/Ligyb/SharedVaccinatorSystem.cs b/Content.Shared/Ligyb/SharedVaccinatorSystem.cs deleted file mode 100644 index 818c3988f6a..00000000000 --- a/Content.Shared/Ligyb/SharedVaccinatorSystem.cs +++ /dev/null @@ -1,201 +0,0 @@ -using Content.Shared.Chemistry.Components; -using Content.Shared.Chemistry.Reaction; -using Content.Shared.Interaction; -using Content.Shared.Popups; -using Robust.Shared.Audio.Systems; -using Robust.Shared.Containers; -using Robust.Shared.Network; -using Robust.Shared.Timing; -using System.Collections.Frozen; -using Content.Shared.Paper; -using Robust.Shared.Utility; -using static Content.Shared.Paper.SharedPaperComponent; -using Robust.Shared.Prototypes; -using System.Linq; -using Robust.Shared.Serialization; -using Content.Shared.Chemistry.Reagent; -namespace Content.Shared.Chemistry.EntitySystems; - -/// -/// This handles -/// -public abstract class SharedVaccinatorSystem : EntitySystem -{ - [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly INetManager _net = default!; - [Dependency] private readonly SharedAppearanceSystem _appearance = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; - [Dependency] private readonly SharedContainerSystem _container = default!; - [Dependency] private readonly SharedPopupSystem _popup = default!; - [Dependency] private readonly SharedSolutionContainerSystem _solution = default!; - [Dependency] private readonly MetaDataSystem _metaData = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - [Dependency] private readonly IGameTiming _gameTiming = default!; - /// - /// A cache of all reactions indexed by at most ONE of their required reactants. - /// I.e., even if a reaction has more than one reagent, it will only ever appear once in this dictionary. - /// - private FrozenDictionary> _reactionsSingle = default!; - - /// - /// A cache of all reactions indexed by one of their required reactants. - /// - private FrozenDictionary> _reactions = default!; - - /// - public override void Initialize() - { - InitializeReactionCache(); - SubscribeLocalEvent(OnActivateInWorld); - SubscribeLocalEvent(OnRemoveAttempt); - } - - - /// - /// Handles building the reaction cache. - /// - private void InitializeReactionCache() - { - // Construct single-reaction dictionary. - var dict = new Dictionary>(); - foreach (var reaction in _prototypeManager.EnumeratePrototypes()) - { - // For this dictionary we only need to cache based on the first reagent. - var reagent = reaction.Reactants.Keys.First(); - var list = dict.GetOrNew(reagent); - list.Add(reaction); - } - _reactionsSingle = dict.ToFrozenDictionary(); - - dict.Clear(); - foreach (var reaction in _prototypeManager.EnumeratePrototypes()) - { - foreach (var reagent in reaction.Reactants.Keys) - { - var list = dict.GetOrNew(reagent); - list.Add(reaction); - } - } - _reactions = dict.ToFrozenDictionary(); - } - - private void OnActivateInWorld(Entity entity, ref ActivateInWorldEvent args) - { - TryStartMix(entity, args.User); - } - - private void OnRemoveAttempt(Entity ent, ref ContainerIsRemovingAttemptEvent args) - { - if (args.Container.ID == ent.Comp.ContainerId && ent.Comp.Mixing) - args.Cancel(); - } - - protected virtual bool HasPower(Entity entity) - { - return true; - } - - public void TryStartMix(Entity entity, EntityUid? user) - { - var (uid, comp) = entity; - if (comp.Mixing) - return; - - if (!HasPower(entity)) - { - if (user != null) - _popup.PopupClient(Loc.GetString("solution-container-mixer-no-power"), entity, user.Value); - return; - } - - if (!_container.TryGetContainer(uid, comp.ContainerId, out var container) || container.Count == 0) - { - if (user != null) - _popup.PopupClient(Loc.GetString("solution-container-mixer-popup-nothing-to-mix"), entity, user.Value); - return; - } - - comp.Mixing = true; - try - { - if (_net.IsServer) - comp.MixingSoundEntity = _audio.PlayPvs(comp.MixingSound, entity, comp.MixingSound?.Params.WithLoop(true)); - } - catch { } - comp.MixTimeEnd = _timing.CurTime + comp.MixDuration; - _appearance.SetData(entity, SolutionContainerMixerVisuals.Mixing, true); - Dirty(uid, comp); - } - - public void StopMix(Entity entity) - { - var (uid, comp) = entity; - if (!comp.Mixing) - return; - _audio.Stop(comp.MixingSoundEntity); - _appearance.SetData(entity, SolutionContainerMixerVisuals.Mixing, false); - comp.Mixing = false; - comp.MixingSoundEntity = null; - Dirty(uid, comp); - } - - public void FinishMix(Entity entity) - { - var (uid, comp) = entity; - if (!comp.Mixing) - return; - StopMix(entity); - - if (!TryComp(entity, out var reactionMixer) - || !_container.TryGetContainer(uid, comp.ContainerId, out var container)) - return; - bool printed = false; - foreach (var ent in container.ContainedEntities) - { - if (!_solution.TryGetFitsInDispenser(ent, out var soln, out _)) - continue; - if (!printed) - { - if (!(_gameTiming.CurTime < comp.PrintReadyAt)) - { - RaiseNetworkEvent(new PaperInputTextMessageLigyb(soln.Value.Comp.Solution.Contents, GetNetEntity(uid))); - printed = true; - comp.PrintReadyAt = _gameTiming.CurTime + comp.PrintCooldown; - } - } - _solution.UpdateChemicals(soln.Value, true, reactionMixer); - - } - } - - public override void Update(float frameTime) - { - base.Update(frameTime); - - var query = EntityQueryEnumerator(); - while (query.MoveNext(out var uid, out var comp)) - { - if (!comp.Mixing) - continue; - - if (_timing.CurTime < comp.MixTimeEnd) - continue; - - FinishMix((uid, comp)); - } - } -} - - - -[Serializable, NetSerializable] -public sealed class PaperInputTextMessageLigyb : EntityEventArgs -{ - public readonly List ReagentQuantity; - public readonly NetEntity Uid; - public PaperInputTextMessageLigyb(List reagentQuantity, NetEntity uid) - { - Uid = uid; - ReagentQuantity = reagentQuantity; - } -} diff --git a/Content.Shared/Ligyb/SickComponent.cs b/Content.Shared/Ligyb/SickComponent.cs deleted file mode 100644 index dae9db90e20..00000000000 --- a/Content.Shared/Ligyb/SickComponent.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Content.Shared.StatusIcon; -using Robust.Shared.GameStates; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; - -namespace Content.Shared.Ligyb; - -[RegisterComponent] -public sealed partial class SickComponent : Component -{ - [DataField("owner")] - [ViewVariables(VVAccess.ReadWrite)] - public EntityUid owner; - - [ViewVariables(VVAccess.ReadWrite)] - [DataField("icon", customTypeSerializer: typeof(PrototypeIdSerializer))] - public string Icon = "SickIcon"; - - [DataField("inited")] - public bool Inited = false; - - [DataField] public int Stady = 0; - - [DataField] public List Symptoms = new(); - - [ViewVariables(VVAccess.ReadOnly)] - public TimeSpan NextStadyAt = TimeSpan.Zero; - - [DataField("stadyDelay")] - public TimeSpan StadyDelay = TimeSpan.FromMinutes(5); - - [DataField("beforeInfectedBloodReagent")] - public string BeforeInfectedBloodReagent = string.Empty; -} diff --git a/Content.Shared/Ligyb/SpeedModifierOnComponent.cs b/Content.Shared/Ligyb/SpeedModifierOnComponent.cs deleted file mode 100644 index 4c85425daa1..00000000000 --- a/Content.Shared/Ligyb/SpeedModifierOnComponent.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Content.Shared.Clothing; -using Robust.Shared.GameStates; - -namespace Content.Shared.Item; - -/// -/// This is used for items that change your speed when they are held. -/// -/// -/// This is separate from because things like boots increase/decrease speed when worn, but -/// shouldn't do that when just held in hand. -/// -[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] -[Access(typeof(SpeedModifierOnSystem))] -public sealed partial class SpeedModifierOnComponent : Component -{ - /// - /// A multiplier applied to the walk speed. - /// - [DataField] [ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] - public float WalkModifier = 0.6f; - - /// - /// A multiplier applied to the sprint speed. - /// - [DataField] [ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] - public float SprintModifier = 0.6f; - - [DataField] public bool TurnedOff; -} diff --git a/Content.Shared/Ligyb/SpeedModifierOnSystem.cs b/Content.Shared/Ligyb/SpeedModifierOnSystem.cs deleted file mode 100644 index f7789d782b7..00000000000 --- a/Content.Shared/Ligyb/SpeedModifierOnSystem.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Content.Shared.Clothing; -using Content.Shared.Hands; -using Content.Shared.Movement.Systems; - -namespace Content.Shared.Item; - -/// -/// This handles -/// -public sealed class SpeedModifierOnSystem : EntitySystem -{ - [Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifier = default!; - - /// - public override void Initialize() - { - SubscribeLocalEvent(OnGotEquippedHand); - SubscribeLocalEvent(OnGotUnequippedHand); - SubscribeLocalEvent(OnRefreshMovementSpeedModifiers); - } - - private void OnGotEquippedHand(EntityUid uid, SpeedModifierOnComponent component, ComponentInit args) - { - _movementSpeedModifier.RefreshMovementSpeedModifiers(uid); - } - - private void OnGotUnequippedHand(EntityUid uid, SpeedModifierOnComponent component, ComponentShutdown args) - { - component.TurnedOff = true; - _movementSpeedModifier.RefreshMovementSpeedModifiers(uid); - } - - private void OnRefreshMovementSpeedModifiers(EntityUid uid, SpeedModifierOnComponent component, RefreshMovementSpeedModifiersEvent args) - { - if (!component.TurnedOff) - { - args.ModifySpeed(component.WalkModifier, component.SprintModifier); - } - } -} diff --git a/Content.Shared/Ligyb/VaccinatorComponent.cs b/Content.Shared/Ligyb/VaccinatorComponent.cs deleted file mode 100644 index e77a872c4e5..00000000000 --- a/Content.Shared/Ligyb/VaccinatorComponent.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Content.Shared.Chemistry.EntitySystems; -using Content.Shared.Chemistry.Reaction; -using Robust.Shared.Audio; -using Robust.Shared.Audio.Components; -using Robust.Shared.GameStates; -using Robust.Shared.Serialization; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; -using Robust.Shared.Prototypes; -namespace Content.Shared.Chemistry.Components; - -/// -/// This is used for an entity that uses to mix any container with a solution after a period of time. -/// -[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] -[Access(typeof(SharedVaccinatorSystem))] -public sealed partial class VaccinatorComponent : Component -{ - [DataField, ViewVariables(VVAccess.ReadWrite)] - public string ContainerId = "mixer"; - - [DataField, AutoNetworkedField] - public bool Mixing; - - /// - /// How long it takes for mixing to occurs. - /// - [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] - public TimeSpan MixDuration; - - [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] - public TimeSpan MixTimeEnd; - - [DataField, AutoNetworkedField] - public SoundSpecifier? MixingSound; - - [DataField] - public Entity? MixingSoundEntity; - - /// - /// The sound that's played when the scanner prints off a report. - /// - [DataField("soundPrint")] - public SoundSpecifier SoundPrint = new SoundPathSpecifier("/Audio/Machines/short_print_and_rip.ogg"); - - /// - /// What the machine will print - /// - [DataField("machineOutput", customTypeSerializer: typeof(PrototypeIdSerializer))] - public string MachineOutput = "ForensicReportPaper"; - - /// - /// When will the scanner be ready to print again? - /// - [ViewVariables(VVAccess.ReadOnly)] - public TimeSpan PrintReadyAt = TimeSpan.Zero; - - /// - /// How often can the scanner print out reports? - /// - [DataField("printCooldown")] - public TimeSpan PrintCooldown = TimeSpan.FromSeconds(5); -}