From c5b14cdc213b1aeabd17ed0b5d9a8f701acca7c7 Mon Sep 17 00:00:00 2001 From: Lgibb18 <65973111+Lgibb18@users.noreply.github.com> Date: Sat, 1 Jun 2024 20:38:16 +0500 Subject: [PATCH 01/13] disease --- Content.Client/Ligyb/DiseaseRoleSystem.cs | 40 +++ Content.Client/Ligyb/SickSystem.cs | 50 +++ Content.Client/Ligyb/VaccinatorSystem.cs | 9 + Content.Server/Ligyb/CureDiseaseInfection.cs | 34 ++ .../Ligyb/DiseaseImmuneClothingSystem.cs | 58 ++++ Content.Server/Ligyb/DiseaseRoleSystem.cs | 200 ++++++++++++ Content.Server/Ligyb/MinimumBleedComponent.cs | 11 + Content.Server/Ligyb/MinimumBleedSystem.cs | 41 +++ Content.Server/Ligyb/SickSystem.cs | 293 ++++++++++++++++++ Content.Server/Ligyb/SleepyComponent.cs | 15 + Content.Server/Ligyb/SleepySystem.cs | 67 ++++ Content.Server/Ligyb/VaccinatorSystem.cs | 145 +++++++++ .../Traits/Assorted/NarcolepsyComponent.cs | 6 +- .../Traits/Assorted/NarcolepsySystem.cs | 9 + .../Ligyb/DiseaseImmuneClothingComponent.cs | 8 + .../Ligyb/DiseaseImmuneComponent.cs | 7 + Content.Shared/Ligyb/DiseaseRoleComponent.cs | 45 +++ .../Ligyb/DiseaseTempImmuneComponent.cs | 7 + .../Ligyb/DiseaseVaccineTimerComponent.cs | 13 + .../Ligyb/DiseaseVaccineTimerSystem.cs | 67 ++++ Content.Shared/Ligyb/InfectEvent.cs | 165 ++++++++++ .../Ligyb/SharedDiseaseRoleSystem.cs | 83 +++++ Content.Shared/Ligyb/SharedSickSystem.cs | 44 +++ .../Ligyb/SharedVaccinatorSystem.cs | 201 ++++++++++++ Content.Shared/Ligyb/SickComponent.cs | 33 ++ .../Ligyb/SpeedModifierOnComponent.cs | 30 ++ Content.Shared/Ligyb/SpeedModifierOnSystem.cs | 40 +++ Content.Shared/Ligyb/VaccinatorComponent.cs | 63 ++++ .../Locale/ru-RU/ligyb/disease/disease.ftl | 8 + Resources/Locale/ru-RU/ligyb/disease/shop.ftl | 34 ++ Resources/Locale/ru-RU/ligyb/vaccine.ftl | 11 + .../Prototypes/Chemistry/mixing_types.yml | 7 + .../Entities/Clothing/Hands/gloves.yml | 4 + .../Entities/Clothing/Head/hoods.yml | 2 + .../Entities/Clothing/Masks/masks.yml | 4 + .../Entities/Clothing/OuterClothing/bio.yml | 2 + .../Clothing/OuterClothing/hardsuits.yml | 2 + .../Machines/Medical/vaccinator.yml | 15 + .../Prototypes/Ligyb/Disease/Actions.yml | 32 ++ .../Prototypes/Ligyb/Disease/DiseaseRole.yml | 82 +++++ .../Ligyb/Disease/Emotes/AutoEmotes.yml | 41 +++ .../Ligyb/Disease/Emotes/Emotes.yml | 17 + .../Ligyb/Disease/Store/Categories.yml | 17 + .../Ligyb/Disease/Store/Listings.yml | 197 ++++++++++++ .../Vaccine/Reactions/BloodToVaccine.yml | 38 +++ .../Ligyb/Vaccine/Reactions/Centrifuge.yml | 35 +++ .../Vaccine/Reactions/VaccinatorInspect.yml | 33 ++ .../Ligyb/Vaccine/Reactions/VaccineCreate.yml | 27 ++ .../Ligyb/Vaccine/Reagents/blood.yml | 95 ++++++ .../Ligyb/Vaccine/Reagents/vaccine.yml | 41 +++ .../Textures/Ligyb/disease.rsi/action.png | Bin 0 -> 329 bytes .../Textures/Ligyb/disease.rsi/baseChance.png | Bin 0 -> 317 bytes .../Textures/Ligyb/disease.rsi/bleed.png | Bin 0 -> 272 bytes .../Textures/Ligyb/disease.rsi/blindness.png | Bin 0 -> 440 bytes .../Textures/Ligyb/disease.rsi/cough.png | Bin 0 -> 379 bytes .../Ligyb/disease.rsi/coughChance.png | Bin 0 -> 294 bytes Resources/Textures/Ligyb/disease.rsi/icon.png | Bin 0 -> 436 bytes Resources/Textures/Ligyb/disease.rsi/idle.png | Bin 0 -> 226 bytes .../Textures/Ligyb/disease.rsi/lethal.png | Bin 0 -> 352 bytes .../Textures/Ligyb/disease.rsi/meta.json | 66 ++++ .../Textures/Ligyb/disease.rsi/muted.png | Bin 0 -> 443 bytes .../Textures/Ligyb/disease.rsi/narcolepsy.png | Bin 0 -> 220 bytes .../Textures/Ligyb/disease.rsi/shield.png | Bin 0 -> 290 bytes Resources/Textures/Ligyb/disease.rsi/shop.png | Bin 0 -> 222 bytes Resources/Textures/Ligyb/disease.rsi/sick.png | Bin 0 -> 235 bytes .../Textures/Ligyb/disease.rsi/slowness.png | Bin 0 -> 267 bytes .../Textures/Ligyb/disease.rsi/sneeze.png | Bin 0 -> 365 bytes Resources/Textures/Ligyb/disease.rsi/sob.png | Bin 0 -> 436 bytes .../Textures/Ligyb/disease.rsi/vomit.png | Bin 0 -> 321 bytes .../Textures/Ligyb/disease.rsi/zombie.png | Bin 0 -> 391 bytes 70 files changed, 2591 insertions(+), 3 deletions(-) create mode 100644 Content.Client/Ligyb/DiseaseRoleSystem.cs create mode 100644 Content.Client/Ligyb/SickSystem.cs create mode 100644 Content.Client/Ligyb/VaccinatorSystem.cs create mode 100644 Content.Server/Ligyb/CureDiseaseInfection.cs create mode 100644 Content.Server/Ligyb/DiseaseImmuneClothingSystem.cs create mode 100644 Content.Server/Ligyb/DiseaseRoleSystem.cs create mode 100644 Content.Server/Ligyb/MinimumBleedComponent.cs create mode 100644 Content.Server/Ligyb/MinimumBleedSystem.cs create mode 100644 Content.Server/Ligyb/SickSystem.cs create mode 100644 Content.Server/Ligyb/SleepyComponent.cs create mode 100644 Content.Server/Ligyb/SleepySystem.cs create mode 100644 Content.Server/Ligyb/VaccinatorSystem.cs create mode 100644 Content.Shared/Ligyb/DiseaseImmuneClothingComponent.cs create mode 100644 Content.Shared/Ligyb/DiseaseImmuneComponent.cs create mode 100644 Content.Shared/Ligyb/DiseaseRoleComponent.cs create mode 100644 Content.Shared/Ligyb/DiseaseTempImmuneComponent.cs create mode 100644 Content.Shared/Ligyb/DiseaseVaccineTimerComponent.cs create mode 100644 Content.Shared/Ligyb/DiseaseVaccineTimerSystem.cs create mode 100644 Content.Shared/Ligyb/InfectEvent.cs create mode 100644 Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs create mode 100644 Content.Shared/Ligyb/SharedSickSystem.cs create mode 100644 Content.Shared/Ligyb/SharedVaccinatorSystem.cs create mode 100644 Content.Shared/Ligyb/SickComponent.cs create mode 100644 Content.Shared/Ligyb/SpeedModifierOnComponent.cs create mode 100644 Content.Shared/Ligyb/SpeedModifierOnSystem.cs create mode 100644 Content.Shared/Ligyb/VaccinatorComponent.cs create mode 100644 Resources/Locale/ru-RU/ligyb/disease/disease.ftl create mode 100644 Resources/Locale/ru-RU/ligyb/disease/shop.ftl create mode 100644 Resources/Locale/ru-RU/ligyb/vaccine.ftl create mode 100644 Resources/Prototypes/Ligyb/Disease/Actions.yml create mode 100644 Resources/Prototypes/Ligyb/Disease/DiseaseRole.yml create mode 100644 Resources/Prototypes/Ligyb/Disease/Emotes/AutoEmotes.yml create mode 100644 Resources/Prototypes/Ligyb/Disease/Emotes/Emotes.yml create mode 100644 Resources/Prototypes/Ligyb/Disease/Store/Categories.yml create mode 100644 Resources/Prototypes/Ligyb/Disease/Store/Listings.yml create mode 100644 Resources/Prototypes/Ligyb/Vaccine/Reactions/BloodToVaccine.yml create mode 100644 Resources/Prototypes/Ligyb/Vaccine/Reactions/Centrifuge.yml create mode 100644 Resources/Prototypes/Ligyb/Vaccine/Reactions/VaccinatorInspect.yml create mode 100644 Resources/Prototypes/Ligyb/Vaccine/Reactions/VaccineCreate.yml create mode 100644 Resources/Prototypes/Ligyb/Vaccine/Reagents/blood.yml create mode 100644 Resources/Prototypes/Ligyb/Vaccine/Reagents/vaccine.yml create mode 100644 Resources/Textures/Ligyb/disease.rsi/action.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/baseChance.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/bleed.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/blindness.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/cough.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/coughChance.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/icon.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/idle.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/lethal.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/meta.json create mode 100644 Resources/Textures/Ligyb/disease.rsi/muted.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/narcolepsy.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/shield.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/shop.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/sick.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/slowness.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/sneeze.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/sob.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/vomit.png create mode 100644 Resources/Textures/Ligyb/disease.rsi/zombie.png diff --git a/Content.Client/Ligyb/DiseaseRoleSystem.cs b/Content.Client/Ligyb/DiseaseRoleSystem.cs new file mode 100644 index 00000000000..64360aa020b --- /dev/null +++ b/Content.Client/Ligyb/DiseaseRoleSystem.cs @@ -0,0 +1,40 @@ +using Content.Shared.Actions; +using Content.Shared.DoAfter; +using Content.Shared.Doors.Systems; +using Robust.Shared.Audio.Systems; +using Robust.Shared.Map; +using Robust.Shared.Random; +using Robust.Shared.Serialization.Manager; +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 new file mode 100644 index 00000000000..4976a8c2995 --- /dev/null +++ b/Content.Client/Ligyb/SickSystem.cs @@ -0,0 +1,50 @@ +using Content.Shared.CCVar; +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.Shared.Configuration; +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 new file mode 100644 index 00000000000..3e3045bb4fa --- /dev/null +++ b/Content.Client/Ligyb/VaccinatorSystem.cs @@ -0,0 +1,9 @@ +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 new file mode 100644 index 00000000000..6dfc81845b1 --- /dev/null +++ b/Content.Server/Ligyb/CureDiseaseInfection.cs @@ -0,0 +1,34 @@ +using Content.Server.Zombies; +using Content.Shared.Chemistry.Reagent; +using Robust.Shared.Configuration; +using Robust.Shared.Prototypes; +using Content.Shared.Ligyb; +using Content.Server.Spawners.Components; +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 new file mode 100644 index 00000000000..707b13576a5 --- /dev/null +++ b/Content.Server/Ligyb/DiseaseImmuneClothingSystem.cs @@ -0,0 +1,58 @@ +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.AddMarkup($"Защищает от заражения на {Convert.ToInt32(component.prob*100)}%"); + + _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 new file mode 100644 index 00000000000..b0fc5e8145f --- /dev/null +++ b/Content.Server/Ligyb/DiseaseRoleSystem.cs @@ -0,0 +1,200 @@ +using Content.Server.Body.Systems; +using Content.Server.Chat.Systems; +using Content.Server.Doors.Systems; +using Content.Server.Weapons.Ranged.Systems; +using Content.Shared.Actions; +using Content.Shared.DoAfter; +using Content.Shared.Doors.Systems; +using Robust.Server.GameObjects; +using Robust.Shared.Audio.Systems; +using Robust.Shared.Map; +using Robust.Shared.Random; +using Robust.Shared.Serialization.Manager; +using Content.Shared.Ligyb; +using Content.Server.Actions; +using Content.Server.Store.Components; +using Content.Server.Store.Systems; +using Robust.Shared.Prototypes; +using Content.Server.Zombies; +using Content.Shared.FixedPoint; +using Content.Shared.Zombies; +namespace Content.Server.Ligyb; + +public sealed class DiseaseRoleSystem : SharedDiseaseRoleSystem +{ + [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly SharedActionsSystem _actionsSystem = default!; + [Dependency] private readonly ActionsSystem _action = default!; + [Dependency] private readonly StoreSystem _store = default!; + + [ValidatePrototypeId] + private const string DiseaseShopId = "ActionDiseaseShop"; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnInit); + SubscribeLocalEvent(OnMapInit); + SubscribeLocalEvent(OnShop); + SubscribeLocalEvent(OnCough); + SubscribeLocalEvent(OnSneeze); + SubscribeLocalEvent(OnVomit); + SubscribeLocalEvent(OnCrying); + SubscribeLocalEvent(OnZombie); + SubscribeLocalEvent(OnNarcolepsy); + SubscribeLocalEvent(OnMuted); + SubscribeLocalEvent(OnSlowness); + SubscribeLocalEvent(OnBleed); + SubscribeLocalEvent(OnBlindness); + SubscribeLocalEvent(OnInsult); + SubscribeLocalEvent(OnInfects); + + } + + + private void OnInfects(InfectEvent args) + { + if (TryComp(args.Performer, out var component)) + { + if(component.FreeInfects > 0) + { + component.FreeInfects--; + OnInfect(args); + return; + } + 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) + { + _action.AddAction(uid, ref component.Action, 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) + { + bool f = _store.TryAddCurrency(new Dictionary + { + {diseaseComp.CurrencyPrototype, -value} + }, uid); + _store.UpdateUserInterface(uid, uid, store); + return true; + } else + { + return false; + } + } + } + return false; + } + + private void OnCough(EntityUid uid, DiseaseRoleComponent component, DiseaseStartCoughEvent args) + { + component.Symptoms.Add("Cough", (2, 9999)); + } + + private void OnSneeze(EntityUid uid, DiseaseRoleComponent component, DiseaseStartSneezeEvent args) + { + //component.Sneeze = true; + component.Symptoms.Add("Sneeze", (3, 9999)); + } + + private void OnVomit(EntityUid uid, DiseaseRoleComponent component, DiseaseStartVomitEvent args) + { + component.Symptoms.Add("Vomit", (3, 9999)); + } + + private void OnCrying(EntityUid uid, DiseaseRoleComponent component, DiseaseStartCryingEvent args) + { + component.Symptoms.Add("Crying", (0, 9999)); + } + + private void OnNarcolepsy(EntityUid uid, DiseaseRoleComponent component, DiseaseNarcolepsyEvent args) + { + component.Symptoms.Add("Narcolepsy", (3, 9999)); + } + + private void OnMuted(EntityUid uid, DiseaseRoleComponent component, DiseaseMutedEvent args) + { + component.Symptoms.Add("Muted", (4, 9999)); + } + + private void OnSlowness(EntityUid uid, DiseaseRoleComponent component, DiseaseSlownessEvent args) + { + component.Symptoms.Add("Slowness", (2, 9999)); + } + private void OnBleed(EntityUid uid, DiseaseRoleComponent component, DiseaseBleedEvent args) + { + component.Symptoms.Add("Bleed", (3, 9999)); + } + private void OnBlindness(EntityUid uid, DiseaseRoleComponent component, DiseaseBlindnessEvent args) + { + component.Symptoms.Add("Blindness", (4, 9999)); + } + private void OnInsult(EntityUid uid, DiseaseRoleComponent component, DiseaseInsultEvent args) + { + component.Symptoms.Add("Insult", (2, 9999)); + } + + + + 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 new file mode 100644 index 00000000000..d66344946bb --- /dev/null +++ b/Content.Server/Ligyb/MinimumBleedComponent.cs @@ -0,0 +1,11 @@ +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 new file mode 100644 index 00000000000..29db030f71b --- /dev/null +++ b/Content.Server/Ligyb/MinimumBleedSystem.cs @@ -0,0 +1,41 @@ +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 new file mode 100644 index 00000000000..202ba9d683c --- /dev/null +++ b/Content.Server/Ligyb/SickSystem.cs @@ -0,0 +1,293 @@ +using Robust.Shared.Configuration; +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.Audio.Systems; +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.Mobs.Systems; +using Content.Shared.FixedPoint; +using Content.Server.Medical; +using Content.Server.Traits.Assorted; +using Content.Server.Speech.Muting; +using Content.Shared.Traits.Assorted; +using Content.Shared.Eye.Blinding.Components; +using Content.Shared.Item; +using Content.Shared.Speech.Muting; +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": + var ss = 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; + if (args.Emote.ID == "Headache") + { + _popupSystem.PopupEntity("Вы чувствуете лёгкую головную боль.", uid, uid, PopupType.Small); + } + if (args.Emote.ID == "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); + } + } + } + } + if (args.Emote.ID == "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); + } + } + } + } + if (args.Emote.ID == "Vomit") + { + if (_robustRandom.Prob(0.4f)) + { + _vomitSystem.Vomit(uid, -30, -20); + } + } + if(args.Emote.ID == "Insult") + { + if (TryComp(component.owner, out var disease)) + { + _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 * disease.Lethal), true, origin: uid); + } + } + } + } +} diff --git a/Content.Server/Ligyb/SleepyComponent.cs b/Content.Server/Ligyb/SleepyComponent.cs new file mode 100644 index 00000000000..51c76a850c5 --- /dev/null +++ b/Content.Server/Ligyb/SleepyComponent.cs @@ -0,0 +1,15 @@ +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 new file mode 100644 index 00000000000..091518d3476 --- /dev/null +++ b/Content.Server/Ligyb/SleepySystem.cs @@ -0,0 +1,67 @@ +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 new file mode 100644 index 00000000000..080d61cf1ff --- /dev/null +++ b/Content.Server/Ligyb/VaccinatorSystem.cs @@ -0,0 +1,145 @@ +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.Server/Traits/Assorted/NarcolepsyComponent.cs b/Content.Server/Traits/Assorted/NarcolepsyComponent.cs index efa34584958..44a96bdce50 100644 --- a/Content.Server/Traits/Assorted/NarcolepsyComponent.cs +++ b/Content.Server/Traits/Assorted/NarcolepsyComponent.cs @@ -1,4 +1,4 @@ -using System.Numerics; +using System.Numerics; namespace Content.Server.Traits.Assorted; @@ -12,13 +12,13 @@ public sealed partial class NarcolepsyComponent : Component /// The random time between incidents, (min, max). /// [DataField("timeBetweenIncidents", required: true)] - public Vector2 TimeBetweenIncidents { get; private set; } + public Vector2 TimeBetweenIncidents = new Vector2(300, 600); /// /// The duration of incidents, (min, max). /// [DataField("durationOfIncident", required: true)] - public Vector2 DurationOfIncident { get; private set; } + public Vector2 DurationOfIncident = new Vector2(10, 30); public float NextIncidentTime; } diff --git a/Content.Server/Traits/Assorted/NarcolepsySystem.cs b/Content.Server/Traits/Assorted/NarcolepsySystem.cs index e4fa1ccbc73..0980dd82752 100644 --- a/Content.Server/Traits/Assorted/NarcolepsySystem.cs +++ b/Content.Server/Traits/Assorted/NarcolepsySystem.cs @@ -1,6 +1,7 @@ using Content.Shared.Bed.Sleep; using Content.Shared.StatusEffect; using Robust.Shared.Random; +using System.Numerics; namespace Content.Server.Traits.Assorted; @@ -35,6 +36,14 @@ public void AdjustNarcolepsyTimer(EntityUid uid, int TimerReset, NarcolepsyCompo narcolepsy.NextIncidentTime = TimerReset; } + public void SetNarcolepsy(EntityUid uid, Vector2 timeBetweenIncidents, Vector2 durationOfIncident, NarcolepsyComponent? narcolepsy = null) + { + if (!Resolve(uid, ref narcolepsy, false)) + return; + narcolepsy.DurationOfIncident = durationOfIncident; + narcolepsy.TimeBetweenIncidents = timeBetweenIncidents; + } + public override void Update(float frameTime) { base.Update(frameTime); diff --git a/Content.Shared/Ligyb/DiseaseImmuneClothingComponent.cs b/Content.Shared/Ligyb/DiseaseImmuneClothingComponent.cs new file mode 100644 index 00000000000..2988f8e0d63 --- /dev/null +++ b/Content.Shared/Ligyb/DiseaseImmuneClothingComponent.cs @@ -0,0 +1,8 @@ +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 new file mode 100644 index 00000000000..acdc18b0237 --- /dev/null +++ b/Content.Shared/Ligyb/DiseaseImmuneComponent.cs @@ -0,0 +1,7 @@ +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 new file mode 100644 index 00000000000..e8eff447750 --- /dev/null +++ b/Content.Shared/Ligyb/DiseaseRoleComponent.cs @@ -0,0 +1,45 @@ +using Robust.Shared.Prototypes; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; +using System.Numerics; +using Content.Shared.FixedPoint; +using Content.Shared.Store; +using Content.Shared.Whitelist; +using Robust.Shared.GameStates; +using Robust.Shared.Prototypes; +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; + + /// + /// The blood reagent to give the infected. In case you want infected that bleed milk, or something. + /// + [DataField("newBloodReagent", customTypeSerializer: typeof(PrototypeIdSerializer))] + public string NewBloodReagent = "ZombieBlood"; +} diff --git a/Content.Shared/Ligyb/DiseaseTempImmuneComponent.cs b/Content.Shared/Ligyb/DiseaseTempImmuneComponent.cs new file mode 100644 index 00000000000..0e9b3f771d5 --- /dev/null +++ b/Content.Shared/Ligyb/DiseaseTempImmuneComponent.cs @@ -0,0 +1,7 @@ +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 new file mode 100644 index 00000000000..4644d125fb0 --- /dev/null +++ b/Content.Shared/Ligyb/DiseaseVaccineTimerComponent.cs @@ -0,0 +1,13 @@ +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 new file mode 100644 index 00000000000..40e91e3c649 --- /dev/null +++ b/Content.Shared/Ligyb/DiseaseVaccineTimerSystem.cs @@ -0,0 +1,67 @@ +using Robust.Shared.Configuration; +namespace Content.Shared.Ligyb; +using Robust.Shared.Prototypes; +using Robust.Shared.Timing; +using Robust.Shared.Audio.Systems; +using Robust.Shared.Map; +using Robust.Shared.Random; +using Content.Shared.Mobs.Systems; +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 new file mode 100644 index 00000000000..4129375437a --- /dev/null +++ b/Content.Shared/Ligyb/InfectEvent.cs @@ -0,0 +1,165 @@ +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; + } +} + +[Serializable, NetSerializable] +public sealed partial class DiseaseStartCoughEvent : EntityEventArgs +{ +} + + +[Serializable, NetSerializable] +public sealed partial class DiseaseStartSneezeEvent : EntityEventArgs +{ +} + +[Serializable, NetSerializable] +public sealed partial class DiseaseStartVomitEvent : EntityEventArgs +{ +} + +[Serializable, NetSerializable] +public sealed partial class DiseaseZombieEvent : EntityEventArgs +{ +} + + +[Serializable, NetSerializable] +public sealed partial class DiseaseStartCryingEvent : EntityEventArgs +{ +} + + + +[Serializable, NetSerializable] +public sealed partial class DiseaseAddBaseChanceEvent : EntityEventArgs +{ +} + +[Serializable, NetSerializable] +public sealed partial class DiseaseAddCoughChanceEvent : EntityEventArgs +{ +} + +[Serializable, NetSerializable] +public sealed partial class DiseaseAddLethalEvent : EntityEventArgs +{ +} + +[Serializable, NetSerializable] +public sealed partial class DiseaseAddShieldEvent : EntityEventArgs +{ +} + +[Serializable, NetSerializable] +public sealed partial class DiseaseNarcolepsyEvent : EntityEventArgs +{ +} + +[Serializable, NetSerializable] +public sealed partial class DiseaseMutedEvent : EntityEventArgs +{ +} + +[Serializable, NetSerializable] +public sealed partial class DiseaseSlownessEvent : EntityEventArgs +{ +} + +[Serializable, NetSerializable] +public sealed partial class DiseaseBleedEvent : EntityEventArgs +{ +} + +[Serializable, NetSerializable] +public sealed partial class DiseaseBlindnessEvent : EntityEventArgs +{ +} + +[Serializable, NetSerializable] +public sealed partial class DiseaseInsultEvent : EntityEventArgs +{ +} + +[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 new file mode 100644 index 00000000000..011c3b99ae4 --- /dev/null +++ b/Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs @@ -0,0 +1,83 @@ +using Content.Shared.Actions; +using Content.Shared.DoAfter; +using Content.Shared.Doors.Systems; +using Robust.Shared.Audio.Systems; +using Robust.Shared.Map; +using Robust.Shared.Random; +using Robust.Shared.Serialization.Manager; +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(); + + + SubscribeLocalEvent(OnBaseChance); + SubscribeLocalEvent(OnCoughChance); + SubscribeLocalEvent(OnLethal); + SubscribeLocalEvent(OnShield); + } + + + private void OnLethal(EntityUid uid, DiseaseRoleComponent component, DiseaseAddLethalEvent args) + { + component.Lethal += 1; + } + + private void OnShield(EntityUid uid, DiseaseRoleComponent component, DiseaseAddShieldEvent args) + { + component.Shield += 1; + } + + private void OnBaseChance(EntityUid uid, DiseaseRoleComponent component, DiseaseAddBaseChanceEvent args) + { + if (component.BaseInfectChance < 0.9f) + component.BaseInfectChance += 0.1f; + else + component.BaseInfectChance = 1; + } + + private void OnCoughChance(EntityUid uid, DiseaseRoleComponent component, DiseaseAddCoughChanceEvent args) + { + if (component.CoughInfectChance < 0.85f) + component.CoughInfectChance += 0.05f; + else + component.CoughInfectChance = 1; + } + public void OnInfect(InfectEvent ev) + { + if (ev.Handled) + return; + if (TryComp(ev.Performer, out var comp)) + { + ev.Handled = true; + + if (!TryComp(ev.Target, out var body)) + return; + if (HasComp(ev.Target)) return; + if (HasComp(ev.Target)) return; + var prob = comp.BaseInfectChance; + if (TryComp(ev.Target, out var immune)) + { + prob -= immune.Prob; + + } + if (prob < 0) prob = 0; + if (prob > 1) prob = 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 new file mode 100644 index 00000000000..cc414f99f75 --- /dev/null +++ b/Content.Shared/Ligyb/SharedSickSystem.cs @@ -0,0 +1,44 @@ +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 new file mode 100644 index 00000000000..818c3988f6a --- /dev/null +++ b/Content.Shared/Ligyb/SharedVaccinatorSystem.cs @@ -0,0 +1,201 @@ +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 new file mode 100644 index 00000000000..dae9db90e20 --- /dev/null +++ b/Content.Shared/Ligyb/SickComponent.cs @@ -0,0 +1,33 @@ +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 new file mode 100644 index 00000000000..4c85425daa1 --- /dev/null +++ b/Content.Shared/Ligyb/SpeedModifierOnComponent.cs @@ -0,0 +1,30 @@ +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 new file mode 100644 index 00000000000..f7789d782b7 --- /dev/null +++ b/Content.Shared/Ligyb/SpeedModifierOnSystem.cs @@ -0,0 +1,40 @@ +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 new file mode 100644 index 00000000000..e77a872c4e5 --- /dev/null +++ b/Content.Shared/Ligyb/VaccinatorComponent.cs @@ -0,0 +1,63 @@ +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); +} diff --git a/Resources/Locale/ru-RU/ligyb/disease/disease.ftl b/Resources/Locale/ru-RU/ligyb/disease/disease.ftl new file mode 100644 index 00000000000..a7041c10534 --- /dev/null +++ b/Resources/Locale/ru-RU/ligyb/disease/disease.ftl @@ -0,0 +1,8 @@ +mob-name-disease = разумный вирус +mob-description-disease = plague inc 2.0 +ghostrole-disease-name = разумный вирус +ghostrole-disease-description = Обычный вирус, который вдруг решил стать разумным. С кем не бывает? +action-disease-infect-name = Заразить [10] +action-disease-infect-description = Попытка заразить существо (-10 очков эволюции). Первые три попытки заражения не требуют очков эволюции. Выберите способность и нажмите ЛКМ по сущности, чтобы заразить. +action-disease-shop-name = Мутация +action-disease-shop-description = Открывает меню мутации \ No newline at end of file diff --git a/Resources/Locale/ru-RU/ligyb/disease/shop.ftl b/Resources/Locale/ru-RU/ligyb/disease/shop.ftl new file mode 100644 index 00000000000..5a1a3c39219 --- /dev/null +++ b/Resources/Locale/ru-RU/ligyb/disease/shop.ftl @@ -0,0 +1,34 @@ +shop-disease-category-infect = Передача +shop-disease-category-symptoms = Симптомы +shop-disease-category-evolution = Улучшение +shop-disease-currency = Очки эволюции +listing-disease-cough-name = Кашель +listing-disease-cough-description = Заражённые начинают кашлять. +listing-disease-sneeze-name = Чих +listing-disease-sneeze-description = Заражённые начинают чихать. +listing-disease-vomit-name = Тошнота +listing-disease-vomit-description = Заражённых начинает тоншить, вызывая рвоту. +listing-disease-zombie-name = Зомбирование +listing-disease-zombie-description = 70% текущих заражённых становятся зомби. Они так-же перестают быть заражёнными. +listing-disease-cry-name = Непроизвольные слёзы +listing-disease-cry-description = У заражённых активно слезятся глаза, из-за чего кажется, что они плачут. +listing-disease-base-chance-name = Улучшение заражения. +listing-disease-base-chance-description = Действие 'заразить' имеет больший шанс на успех. +listing-disease-infect-chance-name = Повышение заразности. +listing-disease-infect-chance-description = Увеличивает заразность вируса. Влияет на шанс заражения. +listing-disease-shield-name = Повышение устойчивости. +listing-disease-shield-description = Повышает устойчивость болезни к лекарствам. Влияет на скорость лечения при употреблении лекарства. +listing-disease-lethal-name = Повышение летальности. +listing-disease-lethal-description = Увеличивает получаемый урон от симптомов. Влияет на получаемый при кашле урон. +listing-disease-narcolepsy-name = Сонливость +listing-disease-narcolepsy-description = У заражённых появляется постоянное желание спать, с которым они иногда не могут справиться. +listing-disease-muted-name = Немота +listing-disease-muted-description = Мутация вызывает повреждение подъязычного нерва, приводя к параличу мышц языка, из-за чего больные теряют возможность нормально говорить. +listing-disease-slowness-name = Изнеможение +listing-disease-slowness-description = Вирус вызывает разрушение мышечных волокон, приводящее к атрофие и сопровождающееся слабостью. Снижает общую мобильность +listing-disease-bleed-name = Кровопотеря +listing-disease-bleed-description = Вирус вызывает денатурацию гемоглобина крови, из-за чего у всех носителей появляется тяжелая степень анемии +listing-disease-blindness-name = Слепота +listing-disease-blindness-description = Длительная болезнь приводит к отмиранию зрительного нерва, что приводит к практически полной слепоте больного. +listing-disease-insult-name = Судороги +listing-disease-insult-description = Длительная болезнь вызывает гиперстимуляцию двигательных нейронов, в результате чего больные могут испытывать перенапряжение мышц, приводящие к судорогам. \ No newline at end of file diff --git a/Resources/Locale/ru-RU/ligyb/vaccine.ftl b/Resources/Locale/ru-RU/ligyb/vaccine.ftl new file mode 100644 index 00000000000..a64fe178e86 --- /dev/null +++ b/Resources/Locale/ru-RU/ligyb/vaccine.ftl @@ -0,0 +1,11 @@ +reagent-name-disease-blood = мутная кровь +reagent-description-disease-blood = очень странная жидкость. Напоминает кровь +reagent-name-disease-blood-reagent = заражённая жидкость +reagent-name-notready-vaccine = вирусин +reagent-description-notready-vaccine = эта мерзкая жидкость не то, что не вылечит вас, она ещё и заразит. Очень опасно. +reagent-name-vaccine = антивирусин +reagent-description-vaccine = с лёгкостью сможет освободить вас от оков вируса! Не связывается с иммунитетом. +reagent-name-vaccine-plus = антивирусин Плюс +reagent-description-vaccine-plus = наделит вас иммунитетом перед вирусом! + + diff --git a/Resources/Prototypes/Chemistry/mixing_types.yml b/Resources/Prototypes/Chemistry/mixing_types.yml index 20d58e70abd..b8ac46c5ec7 100644 --- a/Resources/Prototypes/Chemistry/mixing_types.yml +++ b/Resources/Prototypes/Chemistry/mixing_types.yml @@ -38,6 +38,13 @@ sprite: Structures/Machines/Medical/centrifuge.rsi state: base +- type: mixingCategory + id: Vaccinator + verbText: Вакцинатор + icon: + sprite: Structures/Machines/Medical/centrifuge.rsi + state: base + - type: mixingCategory id: Electrolysis verbText: mixing-verb-electrolysis diff --git a/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml b/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml index 8b73eee0d24..5a4a6ff34e9 100644 --- a/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml +++ b/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml @@ -6,6 +6,8 @@ components: - type: Sprite sprite: Clothing/Hands/Gloves/Boxing/boxingred.rsi + - type: DiseaseImmuneClothing + prob: 0.2 - type: Clothing sprite: Clothing/Hands/Gloves/Boxing/boxingred.rsi - type: StaminaDamageOnHit @@ -153,6 +155,8 @@ components: - type: Sprite sprite: Clothing/Hands/Gloves/nitrile.rsi + - type: DiseaseImmuneClothing + prob: 0.4 - type: Clothing sprite: Clothing/Hands/Gloves/nitrile.rsi - type: Fiber diff --git a/Resources/Prototypes/Entities/Clothing/Head/hoods.yml b/Resources/Prototypes/Entities/Clothing/Head/hoods.yml index b62834dd98e..40147b67ee3 100644 --- a/Resources/Prototypes/Entities/Clothing/Head/hoods.yml +++ b/Resources/Prototypes/Entities/Clothing/Head/hoods.yml @@ -7,6 +7,8 @@ components: - type: Sprite sprite: Clothing/Head/Hoods/Bio/general.rsi + - type: DiseaseImmuneClothing + prob: 0.3 - type: Clothing sprite: Clothing/Head/Hoods/Bio/general.rsi - type: BreathMask diff --git a/Resources/Prototypes/Entities/Clothing/Masks/masks.yml b/Resources/Prototypes/Entities/Clothing/Masks/masks.yml index 1f2ed875a60..877fca391ca 100644 --- a/Resources/Prototypes/Entities/Clothing/Masks/masks.yml +++ b/Resources/Prototypes/Entities/Clothing/Masks/masks.yml @@ -4,6 +4,8 @@ name: gas mask description: A face-covering mask that can be connected to an air supply. components: + - type: DiseaseImmuneClothing + prob: 0.35 - type: Sprite sprite: Clothing/Mask/gas.rsi - type: Clothing @@ -274,6 +276,8 @@ components: - type: Sprite sprite: Clothing/Mask/sterile.rsi + - type: DiseaseImmuneClothing + prob: 0.4 - type: Clothing sprite: Clothing/Mask/sterile.rsi - type: IngestionBlocker diff --git a/Resources/Prototypes/Entities/Clothing/OuterClothing/bio.yml b/Resources/Prototypes/Entities/Clothing/OuterClothing/bio.yml index fec4d4df6c7..e0d2b01df46 100644 --- a/Resources/Prototypes/Entities/Clothing/OuterClothing/bio.yml +++ b/Resources/Prototypes/Entities/Clothing/OuterClothing/bio.yml @@ -7,6 +7,8 @@ components: - type: Sprite sprite: Clothing/OuterClothing/Bio/general.rsi + - type: DiseaseImmuneClothing + prob: 0.8 - type: Clothing sprite: Clothing/OuterClothing/Bio/general.rsi - type: Armor diff --git a/Resources/Prototypes/Entities/Clothing/OuterClothing/hardsuits.yml b/Resources/Prototypes/Entities/Clothing/OuterClothing/hardsuits.yml index 1f69f7efb32..4655e1d01f3 100644 --- a/Resources/Prototypes/Entities/Clothing/OuterClothing/hardsuits.yml +++ b/Resources/Prototypes/Entities/Clothing/OuterClothing/hardsuits.yml @@ -10,6 +10,8 @@ components: - type: Sprite sprite: Clothing/OuterClothing/Hardsuits/basic.rsi + - type: DiseaseImmuneClothing + prob: 0.25 - type: Clothing sprite: Clothing/OuterClothing/Hardsuits/basic.rsi - type: ExplosionResistance diff --git a/Resources/Prototypes/Entities/Structures/Machines/Medical/vaccinator.yml b/Resources/Prototypes/Entities/Structures/Machines/Medical/vaccinator.yml index 041bca7c905..223c8f240de 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/Medical/vaccinator.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/Medical/vaccinator.yml @@ -18,6 +18,21 @@ - type: DiseaseMachineVisuals idleState: icon runningState: running + - type: Vaccinator + mixDuration: 10 + mixingSound: + path: /Audio/Machines/spinning.ogg + params: + volume: -4 + - type: ReactionMixer + reactionTypes: + - Vaccinator + - type: ItemSlots + slots: + mixer: + whitelist: + tags: + - CentrifugeCompatible - type: Machine board: VaccinatorMachineCircuitboard - type: ContainerContainer diff --git a/Resources/Prototypes/Ligyb/Disease/Actions.yml b/Resources/Prototypes/Ligyb/Disease/Actions.yml new file mode 100644 index 00000000000..3478e819777 --- /dev/null +++ b/Resources/Prototypes/Ligyb/Disease/Actions.yml @@ -0,0 +1,32 @@ +- type: entity + id: ActionInfect + name: action-disease-infect-name + description: action-disease-infect-description + noSpawn: true + components: + - type: EntityTargetAction + useDelay: 1 + itemIconStyle: BigAction + whitelist: + components: + - HumanoidAppearance + canTargetSelf: false + interactOnMiss: false + #sound: !type:SoundPathSpecifier + #path: /Audio/Magic/disintegrate.ogg + icon: + sprite: Ligyb/disease.rsi + state: action + event: !type:InfectEvent + +- type: entity + id: ActionDiseaseShop + name: action-disease-shop-name + description: action-disease-shop-description + noSpawn: true + components: + - type: InstantAction + icon: + sprite: Ligyb/disease.rsi + state: shop + event: !type:DiseaseShopActionEvent \ No newline at end of file diff --git a/Resources/Prototypes/Ligyb/Disease/DiseaseRole.yml b/Resources/Prototypes/Ligyb/Disease/DiseaseRole.yml new file mode 100644 index 00000000000..3d95498a0d3 --- /dev/null +++ b/Resources/Prototypes/Ligyb/Disease/DiseaseRole.yml @@ -0,0 +1,82 @@ +- type: entity + id: MobDisease + name: Разумный вирус + description: plague inc 2.0 + components: + - type: MindContainer + - type: InputMover + - type: MobMover + - type: Input + context: "ghost" + - type: MovementSpeedModifier + baseWalkSpeed: 6 + baseSprintSpeed: 6 + - type: Sprite + noRot: true + drawdepth: Ghosts + sprite: Ligyb/disease.rsi + layers: + - state: idle + - type: Clickable + - type: InteractionOutline + - type: Physics + bodyType: KinematicController + - type: Fixtures + fixtures: + fix1: + shape: + !type:PhysShapeCircle + radius: 0.40 + density: 80 + mask: + - GhostImpassable + - type: MovementIgnoreGravity + - type: Damageable + damageContainer: Biological + - type: Examiner + - type: NoSlip + - type: Actions + - type: Eye + drawFov: false + visMask: + - Normal + - Ghost + - type: ContentEye + maxZoom: 1.2, 1.2 + - type: DoAfter + - type: Alerts + - type: GhostRole + makeSentient: true + name: ghostrole-disease-name + description: ghostrole-disease-description + - type: GhostTakeoverAvailable + - type: PointLight + color: MediumPurple + radius: 2 + softness: 1 + - type: UserInterface + interfaces: + enum.StoreUiKey.Key: + type: StoreBoundUserInterface + - type: Visibility + layer: 2 #ghost vis layer + - type: Store + categories: + - DiseaseInfectCategory + - DiseaseSymptomsCategory + - DiseaseEvolutionCategory + currencyWhitelist: + - DiseasePoints + balance: + DiseasePoints: 20 + - type: DiseaseRole + actions: + ActionInfect: -1 + +- type: statusIcon + id: SickIcon + icon: + sprite: /Textures/Ligyb/disease.rsi + state: sick + priority: 2 + diff --git a/Resources/Prototypes/Ligyb/Disease/Emotes/AutoEmotes.yml b/Resources/Prototypes/Ligyb/Disease/Emotes/AutoEmotes.yml new file mode 100644 index 00000000000..4c23aeb185b --- /dev/null +++ b/Resources/Prototypes/Ligyb/Disease/Emotes/AutoEmotes.yml @@ -0,0 +1,41 @@ +- type: autoEmote + id: InfectedCough + emote: Cough + interval: 8.0 + chance: 0.15 + withChat: true + +- type: autoEmote + id: InfectedSneeze + emote: Sneeze + interval: 13.0 + chance: 0.1 + withChat: true + +- type: autoEmote + id: InfectedVomit + emote: Vomit + interval: 23.0 + chance: 0.1 + withChat: false + +- type: autoEmote + id: InfectedCrying + emote: Crying + interval: 12 + chance: 0.08 + withChat: true + +- type: autoEmote + id: InfectedHeadache + emote: Headache + interval: 12 + chance: 0.5 + withChat: false + +- type: autoEmote + id: InfectedInsult + emote: Insult + interval: 16 + chance: 0.3 + withChat: false \ No newline at end of file diff --git a/Resources/Prototypes/Ligyb/Disease/Emotes/Emotes.yml b/Resources/Prototypes/Ligyb/Disease/Emotes/Emotes.yml new file mode 100644 index 00000000000..408cc8158bf --- /dev/null +++ b/Resources/Prototypes/Ligyb/Disease/Emotes/Emotes.yml @@ -0,0 +1,17 @@ +- type: emote + id: Vomit + name: Тошнота + category: Vocal + chatMessages: [тошнитыы] + +- type: emote + id: Headache + name: Головная боль + category: Vocal + chatMessages: [голова болитыы] + +- type: emote + id: Insult + name: Инсульт + category: Vocal + chatMessages: [инсультыы] diff --git a/Resources/Prototypes/Ligyb/Disease/Store/Categories.yml b/Resources/Prototypes/Ligyb/Disease/Store/Categories.yml new file mode 100644 index 00000000000..fe99baa5a3d --- /dev/null +++ b/Resources/Prototypes/Ligyb/Disease/Store/Categories.yml @@ -0,0 +1,17 @@ +- type: storeCategory + id: DiseaseInfectCategory + name: shop-disease-category-infect + +- type: storeCategory + id: DiseaseSymptomsCategory + name: shop-disease-category-symptoms + +- type: storeCategory + id: DiseaseEvolutionCategory + name: shop-disease-category-evolution + + +- type: currency + id: DiseasePoints + displayName: shop-disease-currency + canWithdraw: false \ No newline at end of file diff --git a/Resources/Prototypes/Ligyb/Disease/Store/Listings.yml b/Resources/Prototypes/Ligyb/Disease/Store/Listings.yml new file mode 100644 index 00000000000..ff2b709bf9a --- /dev/null +++ b/Resources/Prototypes/Ligyb/Disease/Store/Listings.yml @@ -0,0 +1,197 @@ +- type: listing + id: Cough + name: listing-disease-cough-name + description: listing-disease-cough-description + icon: { sprite: /Textures/Ligyb/disease.rsi, state: cough } + productEvent: !type:DiseaseStartCoughEvent + cost: + DiseasePoints: 15 + categories: + - DiseaseInfectCategory + conditions: + - !type:ListingLimitedStockCondition + stock: 1 + +- type: listing + id: Sneeze + name: listing-disease-sneeze-name + description: listing-disease-sneeze-description + icon: { sprite: /Textures/Ligyb/disease.rsi, state: sneeze } + productEvent: !type:DiseaseStartSneezeEvent + cost: + DiseasePoints: 20 + categories: + - DiseaseInfectCategory + conditions: + - !type:ListingLimitedStockCondition + stock: 1 + +- type: listing + id: Vomit + name: listing-disease-vomit-name + description: listing-disease-vomit-description + icon: { sprite: /Textures/Ligyb/disease.rsi, state: vomit } + productEvent: !type:DiseaseStartVomitEvent + cost: + DiseasePoints: 25 + categories: + - DiseaseSymptomsCategory + conditions: + - !type:ListingLimitedStockCondition + stock: 1 + +- type: listing + id: Narcolepsy + name: listing-disease-narcolepsy-name + description: listing-disease-narcolepsy-description + icon: { sprite: /Textures/Ligyb/disease.rsi, state: narcolepsy } + productEvent: !type:DiseaseNarcolepsyEvent + cost: + DiseasePoints: 20 + categories: + - DiseaseSymptomsCategory + conditions: + - !type:ListingLimitedStockCondition + stock: 1 + +- type: listing + id: Crying + name: listing-disease-cry-name + description: listing-disease-cry-description + icon: { sprite: /Textures/Ligyb/disease.rsi, state: sob } + productEvent: !type:DiseaseStartCryingEvent + cost: + DiseasePoints: 10 + categories: + - DiseaseSymptomsCategory + conditions: + - !type:ListingLimitedStockCondition + stock: 1 + + + +- type: listing + id: BaseChance + name: listing-disease-base-chance-name + description: listing-disease-base-chance-description + icon: { sprite: /Textures/Ligyb/disease.rsi, state: baseChance } + productEvent: !type:DiseaseAddBaseChanceEvent + cost: + DiseasePoints: 20 + categories: + - DiseaseEvolutionCategory + conditions: + - !type:ListingLimitedStockCondition + stock: 4 + +- type: listing + id: CoughChance + name: listing-disease-infect-chance-name + description: listing-disease-infect-chance-description + icon: { sprite: /Textures/Ligyb/disease.rsi, state: coughChance } + productEvent: !type:DiseaseAddBaseChanceEvent + cost: + DiseasePoints: 15 + categories: + - DiseaseEvolutionCategory + conditions: + - !type:ListingLimitedStockCondition + stock: 8 + +- type: listing + id: Shield + name: listing-disease-shield-name + description: listing-disease-shield-description + icon: { sprite: /Textures/Ligyb/disease.rsi, state: shield } + productEvent: !type:DiseaseAddShieldEvent + cost: + DiseasePoints: 15 + categories: + - DiseaseEvolutionCategory + conditions: + - !type:ListingLimitedStockCondition + stock: 5 + +- type: listing + id: Lethal + name: listing-disease-lethal-name + description: listing-disease-lethal-description + icon: { sprite: /Textures/Ligyb/disease.rsi, state: lethal } + productEvent: !type:DiseaseAddLethalEvent + cost: + DiseasePoints: 15 + categories: + - DiseaseEvolutionCategory + conditions: + - !type:ListingLimitedStockCondition + stock: 5 + +- type: listing + id: Muted + name: listing-disease-muted-name + description: listing-disease-muted-description + icon: { sprite: /Textures/Ligyb/disease.rsi, state: muted } + productEvent: !type:DiseaseMutedEvent + cost: + DiseasePoints: 25 + categories: + - DiseaseSymptomsCategory + conditions: + - !type:ListingLimitedStockCondition + stock: 1 + +- type: listing + id: Slowness + name: listing-disease-slowness-name + description: listing-disease-slowness-description + icon: { sprite: /Textures/Ligyb/disease.rsi, state: slowness } + productEvent: !type:DiseaseSlownessEvent + cost: + DiseasePoints: 15 + categories: + - DiseaseSymptomsCategory + conditions: + - !type:ListingLimitedStockCondition + stock: 1 + +- type: listing + id: Bleed + name: listing-disease-bleed-name + description: listing-disease-bleed-description + icon: { sprite: /Textures/Ligyb/disease.rsi, state: bleed } + productEvent: !type:DiseaseBleedEvent + cost: + DiseasePoints: 30 + categories: + - DiseaseSymptomsCategory + conditions: + - !type:ListingLimitedStockCondition + stock: 1 + +- type: listing + id: Blindness + name: listing-disease-blindness-name + description: listing-disease-blindness-description + icon: { sprite: /Textures/Ligyb/disease.rsi, state: blindness } + productEvent: !type:DiseaseBlindnessEvent + cost: + DiseasePoints: 40 + categories: + - DiseaseSymptomsCategory + conditions: + - !type:ListingLimitedStockCondition + stock: 1 + +- type: listing + id: Insult + name: listing-disease-insult-name + description: listing-disease-insult-description + icon: { sprite: /Textures/Ligyb/disease.rsi, state: blindness } + productEvent: !type:DiseaseInsultEvent + cost: + DiseasePoints: 20 + categories: + - DiseaseSymptomsCategory + conditions: + - !type:ListingLimitedStockCondition + stock: 1 \ No newline at end of file diff --git a/Resources/Prototypes/Ligyb/Vaccine/Reactions/BloodToVaccine.yml b/Resources/Prototypes/Ligyb/Vaccine/Reactions/BloodToVaccine.yml new file mode 100644 index 00000000000..3f94b890d65 --- /dev/null +++ b/Resources/Prototypes/Ligyb/Vaccine/Reactions/BloodToVaccine.yml @@ -0,0 +1,38 @@ +- type: reaction + id: NotReadyVaccineFirst + reactants: + Dylovene: + amount: 2 + Ammonia: + amount: 3 + DiseaseBloodFirst: + amount: 15 + products: + Blood: 15 + NotReadyVaccine: 5 + +- type: reaction + id: NotReadyVaccineSecond + reactants: + Dylovene: + amount: 2 + Leporazine: + amount: 6 + DiseaseBloodSecond: + amount: 15 + products: + Blood: 15 + NotReadyVaccine: 8 + +- type: reaction + id: NotReadyVaccineThird + reactants: + Lipozine: + amount: 3 + Leporazine: + amount: 3 + DiseaseBloodThird: + amount: 15 + products: + Blood: 15 + NotReadyVaccine: 6 \ No newline at end of file diff --git a/Resources/Prototypes/Ligyb/Vaccine/Reactions/Centrifuge.yml b/Resources/Prototypes/Ligyb/Vaccine/Reactions/Centrifuge.yml new file mode 100644 index 00000000000..544e594dc56 --- /dev/null +++ b/Resources/Prototypes/Ligyb/Vaccine/Reactions/Centrifuge.yml @@ -0,0 +1,35 @@ +- type: reaction + id: DiseaseBloodBreakdownFirst + source: true + requiredMixerCategories: + - Centrifuge + reactants: + DiseaseBloodFirst: + amount: 15 + products: + Water: 6 + DiseaseBloodReagent: 9 + +- type: reaction + id: DiseaseBloodBreakdownSecond + source: true + requiredMixerCategories: + - Centrifuge + reactants: + DiseaseBloodSecond: + amount: 15 + products: + Water: 6 + DiseaseBloodReagent: 9 + +- type: reaction + id: DiseaseBloodBreakdownThird + source: true + requiredMixerCategories: + - Centrifuge + reactants: + DiseaseBloodThird: + amount: 15 + products: + Water: 6 + DiseaseBloodReagent: 9 \ No newline at end of file diff --git a/Resources/Prototypes/Ligyb/Vaccine/Reactions/VaccinatorInspect.yml b/Resources/Prototypes/Ligyb/Vaccine/Reactions/VaccinatorInspect.yml new file mode 100644 index 00000000000..090de108cbf --- /dev/null +++ b/Resources/Prototypes/Ligyb/Vaccine/Reactions/VaccinatorInspect.yml @@ -0,0 +1,33 @@ +- type: reaction + id: VaccineInspectFirst + source: true + requiredMixerCategories: + - Vaccinator + reactants: + DiseaseBloodFirst: + amount: 20 + products: + DiseaseBloodFirst: 1 + +- type: reaction + id: VaccineInspectSecond + source: true + requiredMixerCategories: + - Vaccinator + reactants: + DiseaseBloodSecond: + amount: 20 + products: + DiseaseBloodSecond: 1 + +- type: reaction + id: VaccineInspectThird + source: true + requiredMixerCategories: + - Vaccinator + reactants: + DiseaseBloodThird: + amount: 20 + products: + DiseaseBloodThird: 1 + diff --git a/Resources/Prototypes/Ligyb/Vaccine/Reactions/VaccineCreate.yml b/Resources/Prototypes/Ligyb/Vaccine/Reactions/VaccineCreate.yml new file mode 100644 index 00000000000..ddc913274eb --- /dev/null +++ b/Resources/Prototypes/Ligyb/Vaccine/Reactions/VaccineCreate.yml @@ -0,0 +1,27 @@ +- type: reaction + id: VaccineCreate + source: true + requiredMixerCategories: + - Vaccinator + reactants: + NotReadyVaccine: + amount: 19 + Blood: + amount: 1 + products: + Vaccine: 20 + +- type: reaction + id: VaccinePlusCreate + reactants: + Cryptobiolin: + amount: 5 + Sigynate: + amount: 5 + Vaccine: + amount: 7 + DiseaseBloodReagent: + amount: 11 + products: + VaccinePlus: 15 + Water: 10 diff --git a/Resources/Prototypes/Ligyb/Vaccine/Reagents/blood.yml b/Resources/Prototypes/Ligyb/Vaccine/Reagents/blood.yml new file mode 100644 index 00000000000..78f53ddc465 --- /dev/null +++ b/Resources/Prototypes/Ligyb/Vaccine/Reagents/blood.yml @@ -0,0 +1,95 @@ +- type: reagent + id: DiseaseBloodFirst + name: reagent-name-disease-blood + group: Infect + desc: reagent-description-disease-blood + physicalDesc: мерзкое + flavor: bitter + color: "#722222" + slippery: false + metabolisms: + Drink: + # Disgusting! + effects: + - !type:SatiateThirst + factor: -0.5 + Poison: + effects: + - !type:HealthChange + damage: + types: + Poison: 4 + - !type:ChemVomit + probability: 0.25 + +- type: reagent + id: DiseaseBloodSecond + name: reagent-name-disease-blood + group: Infect + desc: reagent-description-disease-blood + physicalDesc: мерзкое + flavor: bitter + color: "#733333" + slippery: false + metabolisms: + Drink: + # Disgusting! + effects: + - !type:SatiateThirst + factor: -0.5 + Poison: + effects: + - !type:HealthChange + damage: + types: + Poison: 4 + - !type:ChemVomit + probability: 0.25 + +- type: reagent + id: DiseaseBloodThird + name: reagent-name-disease-blood + group: Infect + desc: reagent-description-disease-blood + physicalDesc: мерзкое + flavor: bitter + color: "#815131" + slippery: false + metabolisms: + Drink: + # Disgusting! + effects: + - !type:SatiateThirst + factor: -0.5 + Poison: + effects: + - !type:HealthChange + damage: + types: + Poison: 4 + - !type:ChemVomit + probability: 0.88 + +- type: reagent + id: DiseaseBloodReagent + name: reagent-name-disease-blood-reagent + group: Biological + desc: reagent-description-disease-blood + physicalDesc: мерзкое + flavor: bitter + color: "#737373" + slippery: false + metabolisms: + Drink: + # Disgusting! + effects: + - !type:SatiateThirst + factor: -0.5 + Poison: + effects: + - !type:HealthChange + damage: + types: + Poison: 8 + - !type:ChemVomit + probability: 1 \ No newline at end of file diff --git a/Resources/Prototypes/Ligyb/Vaccine/Reagents/vaccine.yml b/Resources/Prototypes/Ligyb/Vaccine/Reagents/vaccine.yml new file mode 100644 index 00000000000..827bcf1b0b0 --- /dev/null +++ b/Resources/Prototypes/Ligyb/Vaccine/Reagents/vaccine.yml @@ -0,0 +1,41 @@ +- type: reagent + id: NotReadyVaccine + name: reagent-name-notready-vaccine + group: Medicine + desc: reagent-description-notready-vaccine + physicalDesc: странное + flavor: medicine + color: "#83a7b1" + +- type: reagent + id: Vaccine + name: reagent-name-vaccine + group: Medicine + desc: reagent-description-vaccine + physicalDesc: странное + flavor: medicine + color: "#86caf7" + metabolisms: + Medicine: + effects: + - !type:CureDiseaseInfection + conditions: + - !type:ReagentThreshold + min: 10 + +- type: reagent + id: VaccinePlus + name: reagent-name-vaccine-plus + group: Medicine + desc: reagent-description-vaccine-plus + physicalDesc: сладкое + flavor: medicine + color: "#8192ea" + metabolisms: + Medicine: + effects: + - !type:CureDiseaseInfection + innoculate: true + conditions: + - !type:ReagentThreshold + min: 7 \ No newline at end of file diff --git a/Resources/Textures/Ligyb/disease.rsi/action.png b/Resources/Textures/Ligyb/disease.rsi/action.png new file mode 100644 index 0000000000000000000000000000000000000000..90b2ae8bcabb45761e2672ae07e20362cc218ef5 GIT binary patch literal 329 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6-+0X`wF+Mb5|{QOqQPG-@z*2zvz1zt5j&U^&Qau#?*7BevL9RXp+soH$f zK*0l^E{-7@=W8!E3N|b7FgWaT6n@R%`I^Bj_P{BoEyw?@Hc?zraL;r(lRqD4ORE4w&+S#8%xn~WU5b64 zPtKZk4Z)NCB+lDc{EUf{#qE&EnF*c;%@`-R1u!tj=FiQ&&&$Kt{qNMnFoy*8x5~Wh z*%m3B4B}rQ6JKMWRQ~F~m3U?&`Gn#)`3d3PR@bsPvbGvLoAWohVAmTvryq=uRdh1N T7H69R{lehs>gTe~DWM4fz{POp literal 0 HcmV?d00001 diff --git a/Resources/Textures/Ligyb/disease.rsi/baseChance.png b/Resources/Textures/Ligyb/disease.rsi/baseChance.png new file mode 100644 index 0000000000000000000000000000000000000000..18beae1c39b5b6d1c20d48b997f9bbf5822dbee4 GIT binary patch literal 317 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;v0X`wF+Mb5|{QPFowz@t>b{TFKarRcpPF4wy*2zvz1zxskF1@$E+yW}* zEbxddW?3!4o5Y}6m$aLiGVVv`?mzpo1AaUHx3v IIVCg!0D@j|4*&oF literal 0 HcmV?d00001 diff --git a/Resources/Textures/Ligyb/disease.rsi/bleed.png b/Resources/Textures/Ligyb/disease.rsi/bleed.png new file mode 100644 index 0000000000000000000000000000000000000000..4e6e57506146f32b1bc62e9867f9803d71470407 GIT binary patch literal 272 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI62 zD|IC7s@YQz<8=Pif)1gUFYGM*zP$ooZW=SK*>m{=DnE1vY}8<=&R|s(mt;uceer|o zcS{yew7lcStyY!>&IYp=hhMXCN-Xn<*}v7e;Qg03_IIBa=IAV9t@~no$Ud^~3eY7C Mp00i_>zopr06>0TasU7T literal 0 HcmV?d00001 diff --git a/Resources/Textures/Ligyb/disease.rsi/blindness.png b/Resources/Textures/Ligyb/disease.rsi/blindness.png new file mode 100644 index 0000000000000000000000000000000000000000..72248efb6b9bda287e2f7edf4d4d187a0b250258 GIT binary patch literal 440 zcmV;p0Z0CcP)Px#1ZP1_K>z@;j|==^1poj5El^BUMJq`$4-XFj002I2FgIT+FH$8ZL>?eG7#1oL z5F89pP*7@WYJ`M@pP!%9)YQ|MQrZ9j010qNS#tmY4#NNd4#NS*Z>VGd009(9L_t(2 z&u!Adaf2`r1yE&T7ZAGxy97}Jy5}ODeX(@)3DE(f1Hcsk;|45u5Zr(#l#tYrzmiEp zoPX2PvXXXSk9k2>8=g{xWb7%xHVGi*>m7L9pJ2n2xIe-6yC4E}l=u7#E1n3ckqOp3 zQQ9K=Sh41*FtoPWJ^)XpveqFslX}OV6QND+TwS{&Q-DQE`(@p=5KSPo&C8>I^IhdE z0Tnct@qO?uWXG0hQ1;i)aU9N&1E8#%{`zq{4gTB$7Akjje;IG5k=g)+ajx+LK0!qh zPeBtuVBJ*#q|RN_d#qbWJunx8i&3hA08domDM*HUJiwC162^fTdx)TP2*xr48q*By i59nXO=J5AdVC)N!L%e{o?%@Fd0000!lvI6*~g4aD=978nDmtNY)*JL2TaN!qw7)N*E z0@F=9E^wDjd&T~P^T?9L%{*^5{ot*eET6i5>6N4%Z{yZ|S;zj9Uy4<6wZygV1E)Ad z8WOHEa3;K&t{7^Zv4gen(*rJsTY_dh3!Fc=+k^;FVdQ&MBb@0H!dB>;M1& literal 0 HcmV?d00001 diff --git a/Resources/Textures/Ligyb/disease.rsi/coughChance.png b/Resources/Textures/Ligyb/disease.rsi/coughChance.png new file mode 100644 index 0000000000000000000000000000000000000000..ee5e910ed7473425104f43d07ad626652738c375 GIT binary patch literal 294 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6-+0X`wF+Mb5|{QOqQPP#ruX3@4z1zu-Pa9jn-au#?*7BevL9RguSQ4OyK zpx|6j7sn8d^SzfY^0p}Ouszt-IKjf9eh1@`XottV2UOqf@6t_TId??4Wm3P{Tjnpj zeYSS&lB#-@!~I}6kEN-n*)blmfDHwbOb47ABTh_RX(+hE!lobZ_C&zc7A2?{a>3md=deyDG7KcTwtZ4rO! j$ytql5kVRInJ)6hOBh9Hcy2rabSQ(TtDnm{r-UW|k+Wu$ literal 0 HcmV?d00001 diff --git a/Resources/Textures/Ligyb/disease.rsi/icon.png b/Resources/Textures/Ligyb/disease.rsi/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..197b7e1ab8498c7d1752b04a396e0709d572abb0 GIT binary patch literal 436 zcmV;l0ZaagP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0ZBU0RM1aTD4!IRFhUH;Fhxu8<}LWl}`AFd~vA%goqgX)(l} zT|gAsCoQwKh4-yzXM#M>aY;H7FNPQJ0$#ui9MuUIn6D_@mRBXum;^Fa;Uqu{SAU8n z?m!X)nYLmrz`IV-k9eLT`nti&lz5=QUnJH_SP4`+CxLYr$;T4oS@A#^;(aPYg@`5{ z>O&~`=9kC3^Ir^ha?gBY^lIEcn4UT|RZzY7lYe-z;_3h-@xxK18*wVbrp0T|_P$b` zllK8W2QpQ0mPS;oj7Ds$fOFcX952f|CFW@C=S^lyL?R1yXs;c z(mc`hf}J3`31=5EbxddW?8eR=RL4Qvd#}Etu!lvI63TgFE!1{KdabU2Qcy*}l;gG>Ejrb6dzM)h-#FXwA-^vzswW`&gN?nZLm; z%!}Ca`lm3@Kb~uRG_dAs>H^p2DaR(HYDXSC^@}yGCz1OBgXzX4y$_5y)%Y9EKRJ@a zQvT`uArT{)H{lVbr>gTe~DWM4f>=Al^ literal 0 HcmV?d00001 diff --git a/Resources/Textures/Ligyb/disease.rsi/meta.json b/Resources/Textures/Ligyb/disease.rsi/meta.json new file mode 100644 index 00000000000..1796e9346d4 --- /dev/null +++ b/Resources/Textures/Ligyb/disease.rsi/meta.json @@ -0,0 +1,66 @@ +{ + "version": 1, + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "icon" + }, + { + "name": "idle" + }, + { + "name": "action" + }, + { + "name": "sick" + }, + { + "name": "shop" + }, + { + "name": "cough" + }, + { + "name": "sneeze" + }, + { + "name": "vomit" + }, + { + "name": "sob" + }, + { + "name": "baseChance" + }, + { + "name": "coughChance" + }, + { + "name": "zombie" + }, + { + "name": "lethal" + }, + { + "name": "shield" + }, + { + "name": "narcolepsy" + }, + { + "name": "muted" + }, + { + "name": "slowness" + }, + { + "name": "bleed" + }, + { + "name": "blindness" + } + ] +} diff --git a/Resources/Textures/Ligyb/disease.rsi/muted.png b/Resources/Textures/Ligyb/disease.rsi/muted.png new file mode 100644 index 0000000000000000000000000000000000000000..2e5da499243f75319b3e8dcc9183176e6b1d7564 GIT binary patch literal 443 zcmV;s0Yv_ZP)Px#1ZP1_K>z@;j|==^1poj5Fi=cXMJq`$4-XG|R{%>l22MWD0Tf9@ zK~yNuZIQ8R!!Qtr)i-DiT{;x>2h%t-6zo2U;W`vLWbq61C6p=PDFQ9Y(7{_@!JEOW z$1Z`a8S(<{og@z?xkb89ztFG$)OF1!rPSRN+}{Q|b~=Itp_kPIAV_2tkj!%gK>-g? zydkBk!t+izj6uu;W{dOr`1+T}JQn66k)bG{1K5Vd<`E>g#7yHA4tGpl l$1#j^!Oh8C4SQNj{R0CyWxP{3vNHex002ovPDHLkV1fa)t$F|e literal 0 HcmV?d00001 diff --git a/Resources/Textures/Ligyb/disease.rsi/narcolepsy.png b/Resources/Textures/Ligyb/disease.rsi/narcolepsy.png new file mode 100644 index 0000000000000000000000000000000000000000..2f935fe39c2b375d71d540b8fd582c3a7ddf24c6 GIT binary patch literal 220 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>0X`wF+Mb5|{QOqQPWiLWgN)!T@Q5sCVBk9p!i>lBSEK+1V?13PLp07$ zy%^2aV8G*YaR>8k*(dMnCn|CHEekWOw|o*RRoo*c7~TF?UgfDM-%DdJg@-y9y1p!Y znSGkUTIXrd4zm)5+=KGZ3!ZaN_#!lvI6-M0X`wF+Mb5|{QOqQPG-@zN_rN$K1NOjUMdDw*LjRz0o8C8ctjR6Fz_7) zVaDV6D^h@hlRaG=Lp09!UJT@FHsE1obKk<}#~wSaF-bdiUGXApFIA-b>6ULwa}%4xDz!lvI6-+0X`wF+Mb5|{QSB;MpnsAX3@4z1zy3wYTbacoCO|{#S9F5he4R}c>anM zpkSz{i(`n!`Q!sEO&Sf2je?;L49goPD9vivBxuVr$JawpASfuPu+Xfq5J&IP@ZyfWvY3H^?+^$xifVW@00n(KT^vI!{NG-%!lvI6=10X`wF+Mb5|{QOo4j`GGz!JV;I-8nyjQk(@Ik;M!Qe1}1p@p%4<6rfIg@V+O7JzZ%soCiaq}F`W9zxEP3!V>8bVw z#^s_~XHGHRd~e>(m%?>iuhF=@zv{{Z{rq2wF?Q8_n|b#YDl79%=}reah{4m<&t;uc GLK6U9?pkU9 literal 0 HcmV?d00001 diff --git a/Resources/Textures/Ligyb/disease.rsi/sneeze.png b/Resources/Textures/Ligyb/disease.rsi/sneeze.png new file mode 100644 index 0000000000000000000000000000000000000000..5005e8d056be3124474f8f721bd48fbc69a38874 GIT binary patch literal 365 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI62NV4 zYZs@(PP4BY+UMWu>khTcZ`TwMmSC<4E?{Mhn=8ftMKAW=+yj299x(?$C#0vD9{kn! zYvXqBge%`CtgwGj{Y`y}`KuW%<{rlNSL$cj&Tbcozq-#ZarK+(tw2vPc)I$ztaD0e F0s!UOgB<_> literal 0 HcmV?d00001 diff --git a/Resources/Textures/Ligyb/disease.rsi/sob.png b/Resources/Textures/Ligyb/disease.rsi/sob.png new file mode 100644 index 0000000000000000000000000000000000000000..0ec8b29e31b67b529401c6b8b6ac94acf792782a GIT binary patch literal 436 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCil=1AIbUwLJ~_`T2EyjLf2KtdgC~qHS%`oGs$)3<6D6?KE_Jj6_u>L{-Ga zHKkGVS+#Q(Z+dYf*Li%24LyUl)^pGrw!QUu62`K7UM0?1yg) z*EFTrHPmhw-oSB?`DAjB$eRMeg4j!qviu9Lm-AJh6w!GR!+Kgi*ZYTTJ6rG!=AepI z3mZ94)Ou*jX6<>>WBO`>rj66N^_E=$Gd5POm1sI3)e*2^n|q04{DnNehbD(uINgMG zovup8YWz9kRVsK(IYfii+HQ{+&qA|C=gR7QCvAx)IoUBc<{s*tFVq{HPSN31U;&>46jJFJPSTY6QI9qbhpDr6CwePe3p|y%Xb#H%T X&3?zjYy8v$6!Hw7u6{1-oD!M!lvI6;{0X`wF+Mb5|{QOqQPEG}07IF4g365sbwwD%i%K{Z}7I;J!GcfQS24TkI z`72U@f?GXZ978nDr(X2tYgQ0odtjIuvsfi|_WeV0o_D-$88yW>aDKOU3e?t5KhA!J zhxzVe?WPr)jei@p5;D9Vn3gcuUSrZJn6oQkQ-op4h3@{s2%&-<1?tTcwl+!nJ(zk> z_*&?L97dmr=5i*tB-6+sw|g`9cm)yt0VzEz~JfX K=d#Wzp$PzW7HpmX literal 0 HcmV?d00001 diff --git a/Resources/Textures/Ligyb/disease.rsi/zombie.png b/Resources/Textures/Ligyb/disease.rsi/zombie.png new file mode 100644 index 0000000000000000000000000000000000000000..6bf35137dd62511d3959268843e71adf9be1f861 GIT binary patch literal 391 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6<)0X`wF+Mb5|{QSB;M#73>R>@8#VOD0*wpIy_Dz=)sKE`s!N(O;uP6b{Z z{fUu4Et~}&k;M!Qe1}1p@p%4<6rkWsPZ!4!jq^({ZuDm|lwkevOP-@JWnzqvgr{uB z?U#$cHf=uk_t4RcOHS_IWpyBr)%x+Vyq?>tJ%1O6yyLTwsC=ydchN zsTF#>zczhcNZKFqhapk>77H^OF8Y=%^7T9Of|-AObACmv+{n4`hLd_jwJ6)0@?Z7^ jcciuzYgTe~DWM4fV8owF literal 0 HcmV?d00001 From b568df1e80c942c9c97090d20bdaba038799709e Mon Sep 17 00:00:00 2001 From: Lgibb18 <65973111+Lgibb18@users.noreply.github.com> Date: Tue, 18 Jun 2024 10:55:12 +0500 Subject: [PATCH 02/13] eula --- Content.Client/Ligyb/DiseaseRoleSystem.cs | 2 ++ Content.Client/Ligyb/SickSystem.cs | 1 + Content.Client/Ligyb/VaccinatorSystem.cs | 1 + Content.Server/Ligyb/CureDiseaseInfection.cs | 1 + .../Ligyb/DiseaseImmuneClothingSystem.cs | 1 + Content.Server/Ligyb/DiseaseRoleSystem.cs | 1 + Content.Server/Ligyb/MinimumBleedComponent.cs | 1 + Content.Server/Ligyb/MinimumBleedSystem.cs | 1 + Content.Server/Ligyb/SickSystem.cs | 30 ++++++++++--------- Content.Server/Ligyb/SleepyComponent.cs | 1 + Content.Server/Ligyb/SleepySystem.cs | 1 + Content.Server/Ligyb/VaccinatorSystem.cs | 11 +++---- .../Ligyb/DiseaseImmuneClothingComponent.cs | 1 + .../Ligyb/DiseaseImmuneComponent.cs | 1 + Content.Shared/Ligyb/DiseaseRoleComponent.cs | 1 + .../Ligyb/DiseaseTempImmuneComponent.cs | 1 + .../Ligyb/DiseaseVaccineTimerComponent.cs | 1 + .../Ligyb/DiseaseVaccineTimerSystem.cs | 9 +++--- Content.Shared/Ligyb/InfectEvent.cs | 1 + .../Ligyb/SharedDiseaseRoleSystem.cs | 5 ++-- Content.Shared/Ligyb/SharedSickSystem.cs | 1 + .../Ligyb/SharedVaccinatorSystem.cs | 3 +- Content.Shared/Ligyb/SickComponent.cs | 1 + .../Ligyb/SpeedModifierOnComponent.cs | 7 +++-- Content.Shared/Ligyb/SpeedModifierOnSystem.cs | 1 + Content.Shared/Ligyb/VaccinatorComponent.cs | 1 + 26 files changed, 58 insertions(+), 28 deletions(-) diff --git a/Content.Client/Ligyb/DiseaseRoleSystem.cs b/Content.Client/Ligyb/DiseaseRoleSystem.cs index 64360aa020b..fa6ff2cd8fb 100644 --- a/Content.Client/Ligyb/DiseaseRoleSystem.cs +++ b/Content.Client/Ligyb/DiseaseRoleSystem.cs @@ -1,3 +1,5 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt + using Content.Shared.Actions; using Content.Shared.DoAfter; using Content.Shared.Doors.Systems; diff --git a/Content.Client/Ligyb/SickSystem.cs b/Content.Client/Ligyb/SickSystem.cs index 4976a8c2995..67e87dac00e 100644 --- a/Content.Client/Ligyb/SickSystem.cs +++ b/Content.Client/Ligyb/SickSystem.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Shared.CCVar; using Content.Shared.Mind.Components; using Content.Shared.Mobs.Systems; diff --git a/Content.Client/Ligyb/VaccinatorSystem.cs b/Content.Client/Ligyb/VaccinatorSystem.cs index 3e3045bb4fa..e553646f095 100644 --- a/Content.Client/Ligyb/VaccinatorSystem.cs +++ b/Content.Client/Ligyb/VaccinatorSystem.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Shared.Chemistry.EntitySystems; namespace Content.Client.Chemistry.EntitySystems; diff --git a/Content.Server/Ligyb/CureDiseaseInfection.cs b/Content.Server/Ligyb/CureDiseaseInfection.cs index 6dfc81845b1..934f4c28310 100644 --- a/Content.Server/Ligyb/CureDiseaseInfection.cs +++ b/Content.Server/Ligyb/CureDiseaseInfection.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Server.Zombies; using Content.Shared.Chemistry.Reagent; using Robust.Shared.Configuration; diff --git a/Content.Server/Ligyb/DiseaseImmuneClothingSystem.cs b/Content.Server/Ligyb/DiseaseImmuneClothingSystem.cs index 707b13576a5..11d453bd519 100644 --- a/Content.Server/Ligyb/DiseaseImmuneClothingSystem.cs +++ b/Content.Server/Ligyb/DiseaseImmuneClothingSystem.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Shared.Clothing.Components; using Content.Shared.Inventory.Events; using Content.Shared.Ligyb; diff --git a/Content.Server/Ligyb/DiseaseRoleSystem.cs b/Content.Server/Ligyb/DiseaseRoleSystem.cs index b0fc5e8145f..d79ac01d767 100644 --- a/Content.Server/Ligyb/DiseaseRoleSystem.cs +++ b/Content.Server/Ligyb/DiseaseRoleSystem.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Server.Body.Systems; using Content.Server.Chat.Systems; using Content.Server.Doors.Systems; diff --git a/Content.Server/Ligyb/MinimumBleedComponent.cs b/Content.Server/Ligyb/MinimumBleedComponent.cs index d66344946bb..f674e76739b 100644 --- a/Content.Server/Ligyb/MinimumBleedComponent.cs +++ b/Content.Server/Ligyb/MinimumBleedComponent.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Shared.StatusIcon; using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; diff --git a/Content.Server/Ligyb/MinimumBleedSystem.cs b/Content.Server/Ligyb/MinimumBleedSystem.cs index 29db030f71b..c23b9b7dda2 100644 --- a/Content.Server/Ligyb/MinimumBleedSystem.cs +++ b/Content.Server/Ligyb/MinimumBleedSystem.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Robust.Shared.Configuration; namespace Content.Server.Ligyb; using Robust.Shared.Prototypes; diff --git a/Content.Server/Ligyb/SickSystem.cs b/Content.Server/Ligyb/SickSystem.cs index 202ba9d683c..d4673347924 100644 --- a/Content.Server/Ligyb/SickSystem.cs +++ b/Content.Server/Ligyb/SickSystem.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Robust.Shared.Configuration; using Robust.Shared.Prototypes; using Robust.Shared.Timing; @@ -57,7 +58,7 @@ public override void Initialize() public void OnShut(EntityUid uid, SickComponent component, ComponentShutdown args) { - foreach(var emote in EnsureComp(uid).Emotes) + foreach (var emote in EnsureComp(uid).Emotes) { if (emote.Contains("Infected")) { @@ -66,10 +67,10 @@ public void OnShut(EntityUid uid, SickComponent component, ComponentShutdown arg } foreach (var key in component.Symptoms) { - switch(key) + switch (key) { case "Narcolepsy": - if(TryComp(uid, out var narc)) + if (TryComp(uid, out var narc)) { RemComp(uid); } @@ -85,11 +86,11 @@ public void OnShut(EntityUid uid, SickComponent component, ComponentShutdown arg { RemComp(uid); } - if(HasComp(uid)) + if (HasComp(uid)) { RemComp(uid); } - if(HasComp(uid)) + if (HasComp(uid)) { RemComp(uid); } @@ -108,7 +109,7 @@ public void OnShut(EntityUid uid, SickComponent component, ComponentShutdown arg break; } } - _bloodstream.ChangeBloodReagent(uid, component.BeforeInfectedBloodReagent); + _bloodstream.ChangeBloodReagent(uid, component.BeforeInfectedBloodReagent); } public override void Update(float frameTime) { @@ -134,7 +135,7 @@ public override void Update(float frameTime) } else { - if(_gameTiming.CurTime >= component.NextStadyAt) + if (_gameTiming.CurTime >= component.NextStadyAt) { component.Stady++; foreach (var emote in EnsureComp(uid).Emotes) @@ -172,9 +173,9 @@ void AddMoney(EntityUid uid, FixedPoint2 value) private void UpdateInfection(EntityUid uid, SickComponent component, EntityUid disease, DiseaseRoleComponent diseaseComponent) { - foreach((var key, (var min, var max)) in diseaseComponent.Symptoms) + foreach ((var key, (var min, var max)) in diseaseComponent.Symptoms) { - if(!component.Symptoms.Contains(key)) + if (!component.Symptoms.Contains(key)) { if (component.Stady >= min && component.Stady <= max) { @@ -198,9 +199,9 @@ private void UpdateInfection(EntityUid uid, SickComponent component, EntityUid d _autoEmote.AddEmote(uid, "InfectedCrying"); break; case "Narcolepsy": - if(!HasComp(uid)) + if (!HasComp(uid)) { - var c= AddComp(uid); + var c = AddComp(uid); EntityManager.EntitySysManager.GetEntitySystem().SetNarcolepsy(uid, new Vector2(10, 30), new Vector2(300, 600), c); } break; @@ -238,14 +239,15 @@ private void OnEmote(EntityUid uid, SickComponent component, ref EmoteEvent args { if (_robustRandom.Prob(0.9f)) { - if(TryComp(component.owner, out var disease)) { + 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)) { @@ -277,7 +279,7 @@ private void OnEmote(EntityUid uid, SickComponent component, ref EmoteEvent args _vomitSystem.Vomit(uid, -30, -20); } } - if(args.Emote.ID == "Insult") + if (args.Emote.ID == "Insult") { if (TryComp(component.owner, out var disease)) { diff --git a/Content.Server/Ligyb/SleepyComponent.cs b/Content.Server/Ligyb/SleepyComponent.cs index 51c76a850c5..744eb0ec77b 100644 --- a/Content.Server/Ligyb/SleepyComponent.cs +++ b/Content.Server/Ligyb/SleepyComponent.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using System.Numerics; namespace Content.Server.Traits.Assorted; diff --git a/Content.Server/Ligyb/SleepySystem.cs b/Content.Server/Ligyb/SleepySystem.cs index 091518d3476..eeb70752299 100644 --- a/Content.Server/Ligyb/SleepySystem.cs +++ b/Content.Server/Ligyb/SleepySystem.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Shared.Bed.Sleep; using Content.Shared.StatusEffect; using Robust.Shared.Random; diff --git a/Content.Server/Ligyb/VaccinatorSystem.cs b/Content.Server/Ligyb/VaccinatorSystem.cs index 080d61cf1ff..c8053393d7e 100644 --- a/Content.Server/Ligyb/VaccinatorSystem.cs +++ b/Content.Server/Ligyb/VaccinatorSystem.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Server.Power.Components; using Content.Server.Power.EntitySystems; using Content.Shared.Chemistry.Components; @@ -90,11 +91,11 @@ private void OnPaper(PaperInputTextMessageLigyb args) List wasProto = new List(); foreach (var reactant in args.ReagentQuantity) { - if(_prototypeManager.TryIndex(reactant.Reagent.Prototype, out ReagentPrototype? protoss)) + if (_prototypeManager.TryIndex(reactant.Reagent.Prototype, out ReagentPrototype? protoss)) { - if(protoss.Group != "Infect") + if (protoss.Group != "Infect") { - if(paper != null) + if (paper != null) { EntityManager.DeleteEntity(paper); return; @@ -113,9 +114,9 @@ private void OnPaper(PaperInputTextMessageLigyb args) var text = new StringBuilder(); text.AppendLine("Для изготовления вакцины, требуется:"); text.AppendLine(); - foreach(var r in reactantReactions) + foreach (var r in reactantReactions) { - foreach(var reactan in r.Reactants) + foreach (var reactan in r.Reactants) { if (r.MixingCategories == null) { diff --git a/Content.Shared/Ligyb/DiseaseImmuneClothingComponent.cs b/Content.Shared/Ligyb/DiseaseImmuneClothingComponent.cs index 2988f8e0d63..ef2519c59cf 100644 --- a/Content.Shared/Ligyb/DiseaseImmuneClothingComponent.cs +++ b/Content.Shared/Ligyb/DiseaseImmuneClothingComponent.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt namespace Content.Shared.Ligyb; [RegisterComponent] diff --git a/Content.Shared/Ligyb/DiseaseImmuneComponent.cs b/Content.Shared/Ligyb/DiseaseImmuneComponent.cs index acdc18b0237..44b4d56f52b 100644 --- a/Content.Shared/Ligyb/DiseaseImmuneComponent.cs +++ b/Content.Shared/Ligyb/DiseaseImmuneComponent.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt namespace Content.Shared.Ligyb; [RegisterComponent] diff --git a/Content.Shared/Ligyb/DiseaseRoleComponent.cs b/Content.Shared/Ligyb/DiseaseRoleComponent.cs index e8eff447750..4046672fe2c 100644 --- a/Content.Shared/Ligyb/DiseaseRoleComponent.cs +++ b/Content.Shared/Ligyb/DiseaseRoleComponent.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; diff --git a/Content.Shared/Ligyb/DiseaseTempImmuneComponent.cs b/Content.Shared/Ligyb/DiseaseTempImmuneComponent.cs index 0e9b3f771d5..c745f9ac86c 100644 --- a/Content.Shared/Ligyb/DiseaseTempImmuneComponent.cs +++ b/Content.Shared/Ligyb/DiseaseTempImmuneComponent.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt namespace Content.Shared.Ligyb; [RegisterComponent] diff --git a/Content.Shared/Ligyb/DiseaseVaccineTimerComponent.cs b/Content.Shared/Ligyb/DiseaseVaccineTimerComponent.cs index 4644d125fb0..2ebbb40f67d 100644 --- a/Content.Shared/Ligyb/DiseaseVaccineTimerComponent.cs +++ b/Content.Shared/Ligyb/DiseaseVaccineTimerComponent.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt namespace Content.Shared.Ligyb; [RegisterComponent] diff --git a/Content.Shared/Ligyb/DiseaseVaccineTimerSystem.cs b/Content.Shared/Ligyb/DiseaseVaccineTimerSystem.cs index 40e91e3c649..d54fa9291b2 100644 --- a/Content.Shared/Ligyb/DiseaseVaccineTimerSystem.cs +++ b/Content.Shared/Ligyb/DiseaseVaccineTimerSystem.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Robust.Shared.Configuration; namespace Content.Shared.Ligyb; using Robust.Shared.Prototypes; @@ -22,7 +23,7 @@ public override void Initialize() public void OnInit(EntityUid uid, DiseaseVaccineTimerComponent component, ComponentInit args) { component.ReadyAt = _gameTiming.CurTime + component.delay; - if(TryComp(uid, out var speed)) + if (TryComp(uid, out var speed)) { component.SpeedBefore = speed.BaseSprintSpeed; _movementSpeed.ChangeBaseSpeed(uid, speed.BaseWalkSpeed, speed.BaseSprintSpeed / 2, speed.Acceleration, speed); @@ -30,14 +31,14 @@ public void OnInit(EntityUid uid, DiseaseVaccineTimerComponent component, Compon } public void OnShut(EntityUid uid, DiseaseVaccineTimerComponent component, ComponentShutdown args) { - if(component.SpeedBefore != 0) + if (component.SpeedBefore != 0) { - if(TryComp(uid, out var speed)) + if (TryComp(uid, out var speed)) { _movementSpeed.ChangeBaseSpeed(uid, speed.BaseWalkSpeed, component.SpeedBefore, speed.Acceleration, speed); } } - + } public override void Update(float frameTime) { diff --git a/Content.Shared/Ligyb/InfectEvent.cs b/Content.Shared/Ligyb/InfectEvent.cs index 4129375437a..c7732451ad9 100644 --- a/Content.Shared/Ligyb/InfectEvent.cs +++ b/Content.Shared/Ligyb/InfectEvent.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Shared.Actions; using Content.Shared.Store; using Robust.Shared.GameObjects; diff --git a/Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs b/Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs index 011c3b99ae4..e59bf3b6837 100644 --- a/Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs +++ b/Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Shared.Actions; using Content.Shared.DoAfter; using Content.Shared.Doors.Systems; @@ -74,9 +75,9 @@ public void OnInfect(InfectEvent ev) { 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 index cc414f99f75..aefa2619192 100644 --- a/Content.Shared/Ligyb/SharedSickSystem.cs +++ b/Content.Shared/Ligyb/SharedSickSystem.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Shared.CCVar; using Content.Shared.Mind.Components; using Content.Shared.Mobs.Systems; diff --git a/Content.Shared/Ligyb/SharedVaccinatorSystem.cs b/Content.Shared/Ligyb/SharedVaccinatorSystem.cs index 818c3988f6a..84789fb6968 100644 --- a/Content.Shared/Ligyb/SharedVaccinatorSystem.cs +++ b/Content.Shared/Ligyb/SharedVaccinatorSystem.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Reaction; using Content.Shared.Interaction; @@ -164,7 +165,7 @@ public void FinishMix(Entity entity) } } _solution.UpdateChemicals(soln.Value, true, reactionMixer); - + } } diff --git a/Content.Shared/Ligyb/SickComponent.cs b/Content.Shared/Ligyb/SickComponent.cs index dae9db90e20..3efb7b5ac1e 100644 --- a/Content.Shared/Ligyb/SickComponent.cs +++ b/Content.Shared/Ligyb/SickComponent.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Shared.StatusIcon; using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; diff --git a/Content.Shared/Ligyb/SpeedModifierOnComponent.cs b/Content.Shared/Ligyb/SpeedModifierOnComponent.cs index 4c85425daa1..12f15f9f676 100644 --- a/Content.Shared/Ligyb/SpeedModifierOnComponent.cs +++ b/Content.Shared/Ligyb/SpeedModifierOnComponent.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Shared.Clothing; using Robust.Shared.GameStates; @@ -17,13 +18,15 @@ public sealed partial class SpeedModifierOnComponent : Component /// /// A multiplier applied to the walk speed. /// - [DataField] [ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] + [DataField] + [ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] public float WalkModifier = 0.6f; /// /// A multiplier applied to the sprint speed. /// - [DataField] [ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] + [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 index f7789d782b7..32186fc4992 100644 --- a/Content.Shared/Ligyb/SpeedModifierOnSystem.cs +++ b/Content.Shared/Ligyb/SpeedModifierOnSystem.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Shared.Clothing; using Content.Shared.Hands; using Content.Shared.Movement.Systems; diff --git a/Content.Shared/Ligyb/VaccinatorComponent.cs b/Content.Shared/Ligyb/VaccinatorComponent.cs index e77a872c4e5..0751864ce4c 100644 --- a/Content.Shared/Ligyb/VaccinatorComponent.cs +++ b/Content.Shared/Ligyb/VaccinatorComponent.cs @@ -1,3 +1,4 @@ +// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Chemistry.Reaction; using Robust.Shared.Audio; From 08887a26720fbd8757316d9c189530c6c839bfad Mon Sep 17 00:00:00 2001 From: Lgibb18 <65973111+Lgibb18@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:51:53 +0500 Subject: [PATCH 03/13] disease 2 --- Content.Client/Ligyb/DiseaseRoleSystem.cs | 7 - Content.Client/Ligyb/SickSystem.cs | 2 - Content.Server/Ligyb/CureDiseaseInfection.cs | 5 +- .../Ligyb/DiseaseImmuneClothingSystem.cs | 6 +- Content.Server/Ligyb/DiseaseRoleSystem.cs | 182 +++++++++--------- Content.Server/Ligyb/SickSystem.cs | 118 ++++++------ .../Ligyb/DiseaseImmuneClothingComponent.cs | 2 +- Content.Shared/Ligyb/DiseaseRoleComponent.cs | 8 - .../Ligyb/DiseaseVaccineTimerComponent.cs | 2 +- .../Ligyb/DiseaseVaccineTimerSystem.cs | 8 +- Content.Shared/Ligyb/InfectEvent.cs | 70 +------ .../Ligyb/SharedDiseaseRoleSystem.cs | 81 ++------ .../Locale/ru-RU/ligyb/disease/disease.ftl | 6 +- Resources/Locale/ru-RU/ligyb/disease/shop.ftl | 18 +- .../Prototypes/Ligyb/Disease/Actions.yml | 56 +++++- .../Prototypes/Ligyb/Disease/DiseaseRole.yml | 6 +- .../Ligyb/Disease/Store/Actions.yml | 151 +++++++++++++++ .../Ligyb/Disease/Store/Listings.yml | 83 ++------ 18 files changed, 412 insertions(+), 399 deletions(-) create mode 100644 Resources/Prototypes/Ligyb/Disease/Store/Actions.yml diff --git a/Content.Client/Ligyb/DiseaseRoleSystem.cs b/Content.Client/Ligyb/DiseaseRoleSystem.cs index 64360aa020b..6300c63db37 100644 --- a/Content.Client/Ligyb/DiseaseRoleSystem.cs +++ b/Content.Client/Ligyb/DiseaseRoleSystem.cs @@ -1,10 +1,3 @@ -using Content.Shared.Actions; -using Content.Shared.DoAfter; -using Content.Shared.Doors.Systems; -using Robust.Shared.Audio.Systems; -using Robust.Shared.Map; -using Robust.Shared.Random; -using Robust.Shared.Serialization.Manager; using Content.Shared.Humanoid; using Content.Shared.Ligyb; namespace Content.Client.Ligyb; diff --git a/Content.Client/Ligyb/SickSystem.cs b/Content.Client/Ligyb/SickSystem.cs index 4976a8c2995..7ada536154d 100644 --- a/Content.Client/Ligyb/SickSystem.cs +++ b/Content.Client/Ligyb/SickSystem.cs @@ -1,10 +1,8 @@ -using Content.Shared.CCVar; 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.Shared.Configuration; using Robust.Client.Player; using Robust.Shared.Prototypes; using Content.Shared.Ligyb; diff --git a/Content.Server/Ligyb/CureDiseaseInfection.cs b/Content.Server/Ligyb/CureDiseaseInfection.cs index 6dfc81845b1..cb570c69b66 100644 --- a/Content.Server/Ligyb/CureDiseaseInfection.cs +++ b/Content.Server/Ligyb/CureDiseaseInfection.cs @@ -1,9 +1,6 @@ -using Content.Server.Zombies; using Content.Shared.Chemistry.Reagent; -using Robust.Shared.Configuration; using Robust.Shared.Prototypes; using Content.Shared.Ligyb; -using Content.Server.Spawners.Components; public sealed partial class CureDiseaseInfection : ReagentEffect { [DataField] @@ -27,7 +24,7 @@ public override void Effect(ReagentEffectArgs args) { var comp = entityManager.EnsureComponent(args.SolutionEntity); comp.Immune = Innoculate; - comp.delay = TimeSpan.FromMinutes(2) + TimeSpan.FromSeconds(disease.Shield * 30); + comp.Delay = TimeSpan.FromMinutes(2) + TimeSpan.FromSeconds(disease.Shield * 30); } } } diff --git a/Content.Server/Ligyb/DiseaseImmuneClothingSystem.cs b/Content.Server/Ligyb/DiseaseImmuneClothingSystem.cs index 707b13576a5..23627f85fe6 100644 --- a/Content.Server/Ligyb/DiseaseImmuneClothingSystem.cs +++ b/Content.Server/Ligyb/DiseaseImmuneClothingSystem.cs @@ -25,7 +25,7 @@ private void OnGotEquipped(EntityUid uid, DiseaseImmuneClothingComponent compone if (!isCorrectSlot) return; - EnsureComp(args.Equipee).Prob += component.prob; + EnsureComp(args.Equipee).Prob += component.Prob; if (Comp(args.Equipee).Prob > 1) Comp(args.Equipee).Prob = 1; component.IsActive = true; @@ -36,7 +36,7 @@ private void OnGotUnequipped(EntityUid uid, DiseaseImmuneClothingComponent compo if (!component.IsActive) return; - EnsureComp(args.Equipee).Prob -= component.prob; + EnsureComp(args.Equipee).Prob -= component.Prob; if (Comp(args.Equipee).Prob < 0) Comp(args.Equipee).Prob = 0; component.IsActive = false; @@ -48,7 +48,7 @@ private void OnArmorVerbExamine(EntityUid uid, DiseaseImmuneClothingComponent co return; var examineMarkup = new FormattedMessage(); - examineMarkup.AddMarkup($"Защищает от заражения на {Convert.ToInt32(component.prob*100)}%"); + 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 index b0fc5e8145f..90d7019296c 100644 --- a/Content.Server/Ligyb/DiseaseRoleSystem.cs +++ b/Content.Server/Ligyb/DiseaseRoleSystem.cs @@ -1,34 +1,22 @@ -using Content.Server.Body.Systems; -using Content.Server.Chat.Systems; -using Content.Server.Doors.Systems; -using Content.Server.Weapons.Ranged.Systems; using Content.Shared.Actions; -using Content.Shared.DoAfter; -using Content.Shared.Doors.Systems; -using Robust.Server.GameObjects; -using Robust.Shared.Audio.Systems; -using Robust.Shared.Map; using Robust.Shared.Random; -using Robust.Shared.Serialization.Manager; using Content.Shared.Ligyb; -using Content.Server.Actions; using Content.Server.Store.Components; using Content.Server.Store.Systems; using Robust.Shared.Prototypes; -using Content.Server.Zombies; using Content.Shared.FixedPoint; -using Content.Shared.Zombies; +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 ActionsSystem _action = default!; [Dependency] private readonly StoreSystem _store = default!; + [Dependency] private readonly SharedPopupSystem _popup = default!; - [ValidatePrototypeId] - private const string DiseaseShopId = "ActionDiseaseShop"; + + [ValidatePrototypeId] private const string DiseaseShopId = "ActionDiseaseShop"; public override void Initialize() { @@ -37,19 +25,74 @@ public override void Initialize() SubscribeLocalEvent(OnInit); SubscribeLocalEvent(OnMapInit); SubscribeLocalEvent(OnShop); - SubscribeLocalEvent(OnCough); - SubscribeLocalEvent(OnSneeze); - SubscribeLocalEvent(OnVomit); - SubscribeLocalEvent(OnCrying); - SubscribeLocalEvent(OnZombie); - SubscribeLocalEvent(OnNarcolepsy); - SubscribeLocalEvent(OnMuted); - SubscribeLocalEvent(OnSlowness); - SubscribeLocalEvent(OnBleed); - SubscribeLocalEvent(OnBlindness); - SubscribeLocalEvent(OnInsult); + 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); + } } @@ -60,10 +103,9 @@ private void OnInfects(InfectEvent args) if(component.FreeInfects > 0) { component.FreeInfects--; - OnInfect(args); - return; + OnInfect(args, 1); } - if (TryRemoveMoney(args.Performer, component.InfectCost)) + else if (TryRemoveMoney(args.Performer, component.InfectCost)) { OnInfect(args); } @@ -85,7 +127,7 @@ private void OnInit(EntityUid uid, DiseaseRoleComponent component, ComponentInit private void OnMapInit(EntityUid uid, DiseaseRoleComponent component, MapInitEvent args) { - _action.AddAction(uid, ref component.Action, DiseaseShopId); + _actionsSystem.AddAction(uid, DiseaseShopId); } private void OnShop(EntityUid uid, DiseaseRoleComponent component, DiseaseShopActionEvent args) @@ -118,7 +160,7 @@ bool TryRemoveMoney(EntityUid uid, FixedPoint2 value) { if (store.Balance[diseaseComp.CurrencyPrototype] >= value) { - bool f = _store.TryAddCurrency(new Dictionary + _store.TryAddCurrency(new Dictionary { {diseaseComp.CurrencyPrototype, -value} }, uid); @@ -132,69 +174,25 @@ bool TryRemoveMoney(EntityUid uid, FixedPoint2 value) } return false; } - - private void OnCough(EntityUid uid, DiseaseRoleComponent component, DiseaseStartCoughEvent args) - { - component.Symptoms.Add("Cough", (2, 9999)); - } - - private void OnSneeze(EntityUid uid, DiseaseRoleComponent component, DiseaseStartSneezeEvent args) - { - //component.Sneeze = true; - component.Symptoms.Add("Sneeze", (3, 9999)); - } - - private void OnVomit(EntityUid uid, DiseaseRoleComponent component, DiseaseStartVomitEvent args) - { - component.Symptoms.Add("Vomit", (3, 9999)); - } - - private void OnCrying(EntityUid uid, DiseaseRoleComponent component, DiseaseStartCryingEvent args) - { - component.Symptoms.Add("Crying", (0, 9999)); - } - - private void OnNarcolepsy(EntityUid uid, DiseaseRoleComponent component, DiseaseNarcolepsyEvent args) - { - component.Symptoms.Add("Narcolepsy", (3, 9999)); - } - private void OnMuted(EntityUid uid, DiseaseRoleComponent component, DiseaseMutedEvent args) + private void OnAddSymptom(EntityUid uid, DiseaseRoleComponent component, DiseaseAddSymptomEvent args) { - component.Symptoms.Add("Muted", (4, 9999)); + component.Symptoms.Add(args.Symptom, (args.MinLevel, args.MaxLevel)); + _actionsSystem.RemoveAction(uid, args.Action); } - private void OnSlowness(EntityUid uid, DiseaseRoleComponent component, DiseaseSlownessEvent args) - { - component.Symptoms.Add("Slowness", (2, 9999)); - } - private void OnBleed(EntityUid uid, DiseaseRoleComponent component, DiseaseBleedEvent args) - { - component.Symptoms.Add("Bleed", (3, 9999)); - } - private void OnBlindness(EntityUid uid, DiseaseRoleComponent component, DiseaseBlindnessEvent args) - { - component.Symptoms.Add("Blindness", (4, 9999)); - } - private void OnInsult(EntityUid uid, DiseaseRoleComponent component, DiseaseInsultEvent args) - { - component.Symptoms.Add("Insult", (2, 9999)); - } - - - - 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); - } - } - } + //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/SickSystem.cs b/Content.Server/Ligyb/SickSystem.cs index 202ba9d683c..fc0e468c266 100644 --- a/Content.Server/Ligyb/SickSystem.cs +++ b/Content.Server/Ligyb/SickSystem.cs @@ -1,4 +1,3 @@ -using Robust.Shared.Configuration; using Robust.Shared.Prototypes; using Robust.Shared.Timing; using Content.Shared.Ligyb; @@ -8,7 +7,6 @@ using Content.Server.Chat.Systems; using Content.Shared.Interaction.Events; using Robust.Server.GameObjects; -using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Random; using Content.Shared.Humanoid; @@ -22,15 +20,14 @@ using Content.Shared.Damage; using Content.Server.Emoting.Systems; using Content.Server.Speech.EntitySystems; -using Content.Shared.Mobs.Systems; using Content.Shared.FixedPoint; using Content.Server.Medical; using Content.Server.Traits.Assorted; -using Content.Server.Speech.Muting; 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 { @@ -57,7 +54,7 @@ public override void Initialize() public void OnShut(EntityUid uid, SickComponent component, ComponentShutdown args) { - foreach(var emote in EnsureComp(uid).Emotes) + foreach (var emote in EnsureComp(uid).Emotes) { if (emote.Contains("Infected")) { @@ -66,10 +63,10 @@ public void OnShut(EntityUid uid, SickComponent component, ComponentShutdown arg } foreach (var key in component.Symptoms) { - switch(key) + switch (key) { case "Narcolepsy": - if(TryComp(uid, out var narc)) + if (TryComp(uid, out var narc)) { RemComp(uid); } @@ -85,11 +82,11 @@ public void OnShut(EntityUid uid, SickComponent component, ComponentShutdown arg { RemComp(uid); } - if(HasComp(uid)) + if (HasComp(uid)) { RemComp(uid); } - if(HasComp(uid)) + if (HasComp(uid)) { RemComp(uid); } @@ -108,7 +105,7 @@ public void OnShut(EntityUid uid, SickComponent component, ComponentShutdown arg break; } } - _bloodstream.ChangeBloodReagent(uid, component.BeforeInfectedBloodReagent); + _bloodstream.ChangeBloodReagent(uid, component.BeforeInfectedBloodReagent); } public override void Update(float frameTime) { @@ -134,7 +131,7 @@ public override void Update(float frameTime) } else { - if(_gameTiming.CurTime >= component.NextStadyAt) + if (_gameTiming.CurTime >= component.NextStadyAt) { component.Stady++; foreach (var emote in EnsureComp(uid).Emotes) @@ -172,9 +169,9 @@ void AddMoney(EntityUid uid, FixedPoint2 value) private void UpdateInfection(EntityUid uid, SickComponent component, EntityUid disease, DiseaseRoleComponent diseaseComponent) { - foreach((var key, (var min, var max)) in diseaseComponent.Symptoms) + foreach ((var key, (var min, var max)) in diseaseComponent.Symptoms) { - if(!component.Symptoms.Contains(key)) + if (!component.Symptoms.Contains(key)) { if (component.Stady >= min && component.Stady <= max) { @@ -198,9 +195,9 @@ private void UpdateInfection(EntityUid uid, SickComponent component, EntityUid d _autoEmote.AddEmote(uid, "InfectedCrying"); break; case "Narcolepsy": - if(!HasComp(uid)) + if (!HasComp(uid)) { - var c= AddComp(uid); + var c = AddComp(uid); EntityManager.EntitySysManager.GetEntitySystem().SetNarcolepsy(uid, new Vector2(10, 30), new Vector2(300, 600), c); } break; @@ -211,7 +208,7 @@ private void UpdateInfection(EntityUid uid, SickComponent component, EntityUid d EnsureComp(uid); break; case "Slowness": - var ss = EnsureComp(uid); + EnsureComp(uid); break; case "Bleed": EnsureComp(uid); @@ -230,64 +227,61 @@ private void OnEmote(EntityUid uid, SickComponent component, ref EmoteEvent args if (args.Handled) return; args.Handled = true; - if (args.Emote.ID == "Headache") + switch (args.Emote.ID) { - _popupSystem.PopupEntity("Вы чувствуете лёгкую головную боль.", uid, uid, PopupType.Small); - } - if (args.Emote.ID == "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)) + 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)) { - _damageableSystem.TryChangeDamage(uid, new(damagePrototype, 0.25f * disease.Lethal), true, origin: uid); + if (HasComp(entity) && !HasComp(entity) && !HasComp(entity)) + { + OnInfected(entity, component.owner, Comp(component.owner).CoughInfectChance); + } } } - - EntityCoordinates start = Transform(uid).Coordinates; - foreach (var entity in _lookup.GetEntitiesInRange(uid, 0.7f)) + break; + case "Sneeze": + if (_robustRandom.Prob(0.9f)) { - if (HasComp(entity) && !HasComp(entity) && !HasComp(entity)) + EntityCoordinates start = Transform(uid).Coordinates; + foreach (var entity in _lookup.GetEntitiesInRange(uid, 1.2f)) { - OnInfected(entity, component.owner, Comp(component.owner).CoughInfectChance); + if (HasComp(entity) && !HasComp(entity) && !HasComp(entity)) + { + OnInfected(entity, component.owner, Comp(component.owner).CoughInfectChance); + } } } - } - } - if (args.Emote.ID == "Sneeze") - { - if (_robustRandom.Prob(0.9f)) - { - EntityCoordinates start = Transform(uid).Coordinates; - foreach (var entity in _lookup.GetEntitiesInRange(uid, 1.2f)) + break; + case "Vomit": + if (_robustRandom.Prob(0.4f)) { - if (HasComp(entity) && !HasComp(entity) && !HasComp(entity)) - { - OnInfected(entity, component.owner, Comp(component.owner).CoughInfectChance); - } + _vomitSystem.Vomit(uid, -30, -20); } - } - } - if (args.Emote.ID == "Vomit") - { - if (_robustRandom.Prob(0.4f)) - { - _vomitSystem.Vomit(uid, -30, -20); - } - } - if(args.Emote.ID == "Insult") - { - if (TryComp(component.owner, out var disease)) - { - _stun.TryParalyze(uid, TimeSpan.FromSeconds(5), false); - var kind = SuicideKind.Shock; - if (_prototypeManager.TryIndex(kind.ToString(), out var damagePrototype)) + break; + case "Insult": + if (TryComp(component.owner, out var dis)) { - _damageableSystem.TryChangeDamage(uid, new(damagePrototype, 0.35f * disease.Lethal), true, origin: uid); + _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.Shared/Ligyb/DiseaseImmuneClothingComponent.cs b/Content.Shared/Ligyb/DiseaseImmuneClothingComponent.cs index 2988f8e0d63..42ba0b0b00e 100644 --- a/Content.Shared/Ligyb/DiseaseImmuneClothingComponent.cs +++ b/Content.Shared/Ligyb/DiseaseImmuneClothingComponent.cs @@ -3,6 +3,6 @@ namespace Content.Shared.Ligyb; [RegisterComponent] public sealed partial class DiseaseImmuneClothingComponent : Component { - [DataField] public float prob; + [DataField] public float Prob; [DataField] public bool IsActive; } diff --git a/Content.Shared/Ligyb/DiseaseRoleComponent.cs b/Content.Shared/Ligyb/DiseaseRoleComponent.cs index e8eff447750..c7bf6a0cb35 100644 --- a/Content.Shared/Ligyb/DiseaseRoleComponent.cs +++ b/Content.Shared/Ligyb/DiseaseRoleComponent.cs @@ -1,12 +1,7 @@ using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; -using System.Numerics; -using Content.Shared.FixedPoint; using Content.Shared.Store; -using Content.Shared.Whitelist; -using Robust.Shared.GameStates; -using Robust.Shared.Prototypes; using Content.Shared.Chemistry.Reagent; namespace Content.Shared.Ligyb; @@ -37,9 +32,6 @@ public sealed partial class DiseaseRoleComponent : Component [DataField] public int Lethal = 0; [DataField] public int Shield = 1; - /// - /// The blood reagent to give the infected. In case you want infected that bleed milk, or something. - /// [DataField("newBloodReagent", customTypeSerializer: typeof(PrototypeIdSerializer))] public string NewBloodReagent = "ZombieBlood"; } diff --git a/Content.Shared/Ligyb/DiseaseVaccineTimerComponent.cs b/Content.Shared/Ligyb/DiseaseVaccineTimerComponent.cs index 4644d125fb0..0f6372650fa 100644 --- a/Content.Shared/Ligyb/DiseaseVaccineTimerComponent.cs +++ b/Content.Shared/Ligyb/DiseaseVaccineTimerComponent.cs @@ -6,7 +6,7 @@ public sealed partial class DiseaseVaccineTimerComponent : Component [ViewVariables(VVAccess.ReadOnly)] public TimeSpan ReadyAt = TimeSpan.Zero; - [DataField] public TimeSpan delay = TimeSpan.FromMinutes(5); + [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 index 40e91e3c649..2d22f64e7de 100644 --- a/Content.Shared/Ligyb/DiseaseVaccineTimerSystem.cs +++ b/Content.Shared/Ligyb/DiseaseVaccineTimerSystem.cs @@ -1,11 +1,5 @@ -using Robust.Shared.Configuration; namespace Content.Shared.Ligyb; -using Robust.Shared.Prototypes; using Robust.Shared.Timing; -using Robust.Shared.Audio.Systems; -using Robust.Shared.Map; -using Robust.Shared.Random; -using Content.Shared.Mobs.Systems; using Content.Shared.Movement.Components; using Content.Shared.Movement.Systems; @@ -21,7 +15,7 @@ public override void Initialize() } public void OnInit(EntityUid uid, DiseaseVaccineTimerComponent component, ComponentInit args) { - component.ReadyAt = _gameTiming.CurTime + component.delay; + component.ReadyAt = _gameTiming.CurTime + component.Delay; if(TryComp(uid, out var speed)) { component.SpeedBefore = speed.BaseSprintSpeed; diff --git a/Content.Shared/Ligyb/InfectEvent.cs b/Content.Shared/Ligyb/InfectEvent.cs index 4129375437a..a5412449664 100644 --- a/Content.Shared/Ligyb/InfectEvent.cs +++ b/Content.Shared/Ligyb/InfectEvent.cs @@ -70,82 +70,28 @@ public DiseaseBuyEvent(string buyId = "Sus") } } -[Serializable, NetSerializable] -public sealed partial class DiseaseStartCoughEvent : EntityEventArgs -{ -} - - -[Serializable, NetSerializable] -public sealed partial class DiseaseStartSneezeEvent : EntityEventArgs -{ -} - -[Serializable, NetSerializable] -public sealed partial class DiseaseStartVomitEvent : EntityEventArgs -{ -} -[Serializable, NetSerializable] -public sealed partial class DiseaseZombieEvent : EntityEventArgs -{ -} - - -[Serializable, NetSerializable] -public sealed partial class DiseaseStartCryingEvent : EntityEventArgs +public sealed partial class DiseaseAddSymptomEvent : InstantActionEvent { + [DataField] public string Symptom; + [DataField] public int MinLevel = 0; + [DataField] public int MaxLevel = 9999; } - -[Serializable, NetSerializable] -public sealed partial class DiseaseAddBaseChanceEvent : EntityEventArgs +public sealed partial class DiseaseAddBaseChanceEvent : InstantActionEvent { } -[Serializable, NetSerializable] -public sealed partial class DiseaseAddCoughChanceEvent : EntityEventArgs +public sealed partial class DiseaseAddCoughChanceEvent : InstantActionEvent { } -[Serializable, NetSerializable] -public sealed partial class DiseaseAddLethalEvent : EntityEventArgs +public sealed partial class DiseaseAddLethalEvent : InstantActionEvent { } -[Serializable, NetSerializable] -public sealed partial class DiseaseAddShieldEvent : EntityEventArgs -{ -} - -[Serializable, NetSerializable] -public sealed partial class DiseaseNarcolepsyEvent : EntityEventArgs -{ -} - -[Serializable, NetSerializable] -public sealed partial class DiseaseMutedEvent : EntityEventArgs -{ -} - -[Serializable, NetSerializable] -public sealed partial class DiseaseSlownessEvent : EntityEventArgs -{ -} - -[Serializable, NetSerializable] -public sealed partial class DiseaseBleedEvent : EntityEventArgs -{ -} - -[Serializable, NetSerializable] -public sealed partial class DiseaseBlindnessEvent : EntityEventArgs -{ -} - -[Serializable, NetSerializable] -public sealed partial class DiseaseInsultEvent : EntityEventArgs +public sealed partial class DiseaseAddShieldEvent : InstantActionEvent { } diff --git a/Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs b/Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs index 011c3b99ae4..0b7e7ec3077 100644 --- a/Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs +++ b/Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs @@ -1,10 +1,4 @@ -using Content.Shared.Actions; -using Content.Shared.DoAfter; -using Content.Shared.Doors.Systems; -using Robust.Shared.Audio.Systems; -using Robust.Shared.Map; using Robust.Shared.Random; -using Robust.Shared.Serialization.Manager; using Content.Shared.Humanoid; namespace Content.Shared.Ligyb; @@ -12,72 +6,31 @@ namespace Content.Shared.Ligyb; public abstract class SharedDiseaseRoleSystem : EntitySystem { [Dependency] private readonly IRobustRandom _robustRandom = default!; - public override void Initialize() { base.Initialize(); - - - SubscribeLocalEvent(OnBaseChance); - SubscribeLocalEvent(OnCoughChance); - SubscribeLocalEvent(OnLethal); - SubscribeLocalEvent(OnShield); - } - - - private void OnLethal(EntityUid uid, DiseaseRoleComponent component, DiseaseAddLethalEvent args) - { - component.Lethal += 1; - } - - private void OnShield(EntityUid uid, DiseaseRoleComponent component, DiseaseAddShieldEvent args) - { - component.Shield += 1; } - - private void OnBaseChance(EntityUid uid, DiseaseRoleComponent component, DiseaseAddBaseChanceEvent args) - { - if (component.BaseInfectChance < 0.9f) - component.BaseInfectChance += 0.1f; - else - component.BaseInfectChance = 1; - } - - private void OnCoughChance(EntityUid uid, DiseaseRoleComponent component, DiseaseAddCoughChanceEvent args) - { - if (component.CoughInfectChance < 0.85f) - component.CoughInfectChance += 0.05f; - else - component.CoughInfectChance = 1; - } - public void OnInfect(InfectEvent ev) + public void OnInfect(InfectEvent ev, float probability = 0) { if (ev.Handled) return; - if (TryComp(ev.Performer, out var comp)) + 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)) { - ev.Handled = true; - - if (!TryComp(ev.Target, out var body)) - return; - if (HasComp(ev.Target)) return; - if (HasComp(ev.Target)) return; - var prob = comp.BaseInfectChance; - if (TryComp(ev.Target, out var immune)) - { - prob -= immune.Prob; - - } - if (prob < 0) prob = 0; - if (prob > 1) prob = 1; - if (_robustRandom.Prob(prob)) - { - var comps = AddComp(ev.Target); - comps.owner = ev.Performer; - - comp.Infected.Add(ev.Target); - - } + var comps = AddComp(ev.Target); + comps.owner = ev.Performer; + comp.Infected.Add(ev.Target); } } } diff --git a/Resources/Locale/ru-RU/ligyb/disease/disease.ftl b/Resources/Locale/ru-RU/ligyb/disease/disease.ftl index a7041c10534..ee476305438 100644 --- a/Resources/Locale/ru-RU/ligyb/disease/disease.ftl +++ b/Resources/Locale/ru-RU/ligyb/disease/disease.ftl @@ -2,7 +2,7 @@ mob-name-disease = разумный вирус mob-description-disease = plague inc 2.0 ghostrole-disease-name = разумный вирус ghostrole-disease-description = Обычный вирус, который вдруг решил стать разумным. С кем не бывает? -action-disease-infect-name = Заразить [10] -action-disease-infect-description = Попытка заразить существо (-10 очков эволюции). Первые три попытки заражения не требуют очков эволюции. Выберите способность и нажмите ЛКМ по сущности, чтобы заразить. +action-disease-infect-name = Заразить [10 ОЭ] +action-disease-infect-description = Попытка заразить существо [-10 очков эволюции]. Первые три попытки заражения не требуют очков эволюции. Выберите способность и нажмите ЛКМ по сущности, чтобы заразить. action-disease-shop-name = Мутация -action-disease-shop-description = Открывает меню мутации \ No newline at end of file +action-disease-shop-description = Открывает меню мутации diff --git a/Resources/Locale/ru-RU/ligyb/disease/shop.ftl b/Resources/Locale/ru-RU/ligyb/disease/shop.ftl index 5a1a3c39219..46aaef24326 100644 --- a/Resources/Locale/ru-RU/ligyb/disease/shop.ftl +++ b/Resources/Locale/ru-RU/ligyb/disease/shop.ftl @@ -12,14 +12,14 @@ listing-disease-zombie-name = Зомбирование listing-disease-zombie-description = 70% текущих заражённых становятся зомби. Они так-же перестают быть заражёнными. listing-disease-cry-name = Непроизвольные слёзы listing-disease-cry-description = У заражённых активно слезятся глаза, из-за чего кажется, что они плачут. -listing-disease-base-chance-name = Улучшение заражения. -listing-disease-base-chance-description = Действие 'заразить' имеет больший шанс на успех. -listing-disease-infect-chance-name = Повышение заразности. -listing-disease-infect-chance-description = Увеличивает заразность вируса. Влияет на шанс заражения. -listing-disease-shield-name = Повышение устойчивости. -listing-disease-shield-description = Повышает устойчивость болезни к лекарствам. Влияет на скорость лечения при употреблении лекарства. -listing-disease-lethal-name = Повышение летальности. -listing-disease-lethal-description = Увеличивает получаемый урон от симптомов. Влияет на получаемый при кашле урон. +listing-disease-base-chance-name = Улучшение заражения. [20 ОЭ] +listing-disease-base-chance-description = Действие 'заразить' имеет больший шанс на успех. [-20 очков эволюции] +listing-disease-infect-chance-name = Повышение заразности. [15 ОЭ] +listing-disease-infect-chance-description = Увеличивает заразность вируса. Влияет на шанс заражения. [-15 очков эволюции] +listing-disease-shield-name = Повышение устойчивости. [15 ОЭ] +listing-disease-shield-description = Повышает устойчивость болезни к лекарствам. Влияет на скорость лечения при употреблении лекарства. [-15 очков эволюции] +listing-disease-lethal-name = Повышение летальности. [15 ОЭ] +listing-disease-lethal-description = Увеличивает получаемый урон от симптомов. Влияет на получаемый при кашле урон. [-15 очков эволюции] listing-disease-narcolepsy-name = Сонливость listing-disease-narcolepsy-description = У заражённых появляется постоянное желание спать, с которым они иногда не могут справиться. listing-disease-muted-name = Немота @@ -31,4 +31,4 @@ listing-disease-bleed-description = Вирус вызывает денатура listing-disease-blindness-name = Слепота listing-disease-blindness-description = Длительная болезнь приводит к отмиранию зрительного нерва, что приводит к практически полной слепоте больного. listing-disease-insult-name = Судороги -listing-disease-insult-description = Длительная болезнь вызывает гиперстимуляцию двигательных нейронов, в результате чего больные могут испытывать перенапряжение мышц, приводящие к судорогам. \ No newline at end of file +listing-disease-insult-description = Длительная болезнь вызывает гиперстимуляцию двигательных нейронов, в результате чего больные могут испытывать перенапряжение мышц, приводящие к судорогам. diff --git a/Resources/Prototypes/Ligyb/Disease/Actions.yml b/Resources/Prototypes/Ligyb/Disease/Actions.yml index 3478e819777..1c8904ad963 100644 --- a/Resources/Prototypes/Ligyb/Disease/Actions.yml +++ b/Resources/Prototypes/Ligyb/Disease/Actions.yml @@ -12,8 +12,6 @@ - HumanoidAppearance canTargetSelf: false interactOnMiss: false - #sound: !type:SoundPathSpecifier - #path: /Audio/Magic/disintegrate.ogg icon: sprite: Ligyb/disease.rsi state: action @@ -29,4 +27,56 @@ icon: sprite: Ligyb/disease.rsi state: shop - event: !type:DiseaseShopActionEvent \ No newline at end of file + event: !type:DiseaseShopActionEvent + +- type: entity + id: ActionDiseaseBaseChance + name: listing-disease-base-chance-name + description: listing-disease-base-chance-description + noSpawn: true + components: + - type: InstantAction + itemIconStyle: NoItem + icon: + sprite: Ligyb/disease.rsi + state: baseChance + event: !type:DiseaseAddBaseChanceEvent + +- type: entity + id: ActionDiseaseInfectChance + name: listing-disease-infect-chance-name + description: listing-disease-infect-chance-description + noSpawn: true + components: + - type: InstantAction + itemIconStyle: NoItem + icon: + sprite: Ligyb/disease.rsi + state: coughChance + event: !type:DiseaseAddCoughChanceEvent + +- type: entity + id: ActionDiseaseShield + name: listing-disease-shield-name + description: listing-disease-shield-description + noSpawn: true + components: + - type: InstantAction + itemIconStyle: NoItem + icon: + sprite: Ligyb/disease.rsi + state: shield + event: !type:DiseaseAddShieldEvent + +- type: entity + id: ActionDiseaseLethal + name: listing-disease-lethal-name + description: listing-disease-lethal-description + noSpawn: true + components: + - type: InstantAction + itemIconStyle: NoItem + icon: + sprite: Ligyb/disease.rsi + state: lethal + event: !type:DiseaseAddLethalEvent diff --git a/Resources/Prototypes/Ligyb/Disease/DiseaseRole.yml b/Resources/Prototypes/Ligyb/Disease/DiseaseRole.yml index 3d95498a0d3..1b6013ab818 100644 --- a/Resources/Prototypes/Ligyb/Disease/DiseaseRole.yml +++ b/Resources/Prototypes/Ligyb/Disease/DiseaseRole.yml @@ -51,7 +51,7 @@ description: ghostrole-disease-description - type: GhostTakeoverAvailable - type: PointLight - color: MediumPurple + color: "#3A6041" radius: 2 softness: 1 - type: UserInterface @@ -72,6 +72,10 @@ - type: DiseaseRole actions: ActionInfect: -1 + ActionDiseaseBaseChance: -1 + ActionDiseaseInfectChance: -1 + ActionDiseaseShield: -1 + ActionDiseaseLethal: -1 - type: statusIcon id: SickIcon diff --git a/Resources/Prototypes/Ligyb/Disease/Store/Actions.yml b/Resources/Prototypes/Ligyb/Disease/Store/Actions.yml new file mode 100644 index 00000000000..2cd93ee4474 --- /dev/null +++ b/Resources/Prototypes/Ligyb/Disease/Store/Actions.yml @@ -0,0 +1,151 @@ +- type: entity + id: ActionDiseaseCough + name: listing-disease-cough-name + description: listing-disease-cough-description + noSpawn: true + components: + - type: InstantAction + itemIconStyle: NoItem + icon: + sprite: Ligyb/disease.rsi + state: cough + event: !type:DiseaseAddSymptomEvent + symptom: "Cough" + minLevel: 2 + +- type: entity + id: ActionDiseaseSneeze + name: listing-disease-sneeze-name + description: listing-disease-sneeze-description + noSpawn: true + components: + - type: InstantAction + id: ActionDiseaseSneeze + itemIconStyle: NoItem + icon: + sprite: Ligyb/disease.rsi + state: sneeze + event: !type:DiseaseAddSymptomEvent + symptom: "Sneeze" + minLevel: 3 + +- type: entity + id: ActionDiseaseVomit + name: listing-disease-vomit-name + description: listing-disease-vomit-description + noSpawn: true + components: + - type: InstantAction + itemIconStyle: NoItem + icon: + sprite: Ligyb/disease.rsi + state: vomit + event: !type:DiseaseAddSymptomEvent + symptom: "Vomit" + minLevel: 3 + +- type: entity + id: ActionDiseaseNarcolepsy + name: listing-disease-narcolepsy-name + description: listing-disease-narcolepsy-description + noSpawn: true + components: + - type: InstantAction + itemIconStyle: NoItem + icon: + sprite: Ligyb/disease.rsi + state: narcolepsy + event: !type:DiseaseAddSymptomEvent + symptom: "Narcolepsy" + minLevel: 3 + +- type: entity + id: ActionDiseaseCrying + name: listing-disease-cry-name + description: listing-disease-cry-description + noSpawn: true + components: + - type: InstantAction + itemIconStyle: NoItem + icon: + sprite: Ligyb/disease.rsi + state: sob + event: !type:DiseaseAddSymptomEvent + symptom: "Crying" + minLevel: 0 + +- type: entity + id: ActionDiseaseMuted + name: listing-disease-muted-name + description: listing-disease-muted-description + noSpawn: true + components: + - type: InstantAction + itemIconStyle: NoItem + icon: + sprite: Ligyb/disease.rsi + state: muted + event: !type:DiseaseAddSymptomEvent + symptom: "Muted" + minLevel: 4 + +- type: entity + id: ActionDiseaseSlowness + name: listing-disease-slowness-name + description: listing-disease-slowness-description + noSpawn: true + components: + - type: InstantAction + itemIconStyle: NoItem + icon: + sprite: Ligyb/disease.rsi + state: slowness + event: !type:DiseaseAddSymptomEvent + symptom: "Slowness" + minLevel: 2 + +- type: entity + id: ActionDiseaseBleed + name: listing-disease-bleed-name + description: listing-disease-bleed-description + noSpawn: true + components: + - type: InstantAction + itemIconStyle: NoItem + icon: + sprite: Ligyb/disease.rsi + state: bleed + event: !type:DiseaseAddSymptomEvent + symptom: "Bleed" + minLevel: 3 + +- type: entity + id: ActionDiseaseBlindness + name: listing-disease-blindness-name + description: listing-disease-blindness-description + noSpawn: true + components: + - type: InstantAction + itemIconStyle: NoItem + icon: + sprite: Ligyb/disease.rsi + state: blindness + event: !type:DiseaseAddSymptomEvent + symptom: "Blindness" + minLevel: 4 + +- type: entity + id: ActionDiseaseInsult + name: listing-disease-insult-name + description: listing-disease-insult-description + noSpawn: true + components: + - type: InstantAction + itemIconStyle: NoItem + icon: + sprite: Ligyb/disease.rsi + state: lethal + event: !type:DiseaseAddSymptomEvent + symptom: "Insult" + minLevel: 2 + diff --git a/Resources/Prototypes/Ligyb/Disease/Store/Listings.yml b/Resources/Prototypes/Ligyb/Disease/Store/Listings.yml index ff2b709bf9a..fc9a06e76b4 100644 --- a/Resources/Prototypes/Ligyb/Disease/Store/Listings.yml +++ b/Resources/Prototypes/Ligyb/Disease/Store/Listings.yml @@ -3,7 +3,8 @@ name: listing-disease-cough-name description: listing-disease-cough-description icon: { sprite: /Textures/Ligyb/disease.rsi, state: cough } - productEvent: !type:DiseaseStartCoughEvent + raiseProductEventOnUser: true + productAction: ActionDiseaseCough cost: DiseasePoints: 15 categories: @@ -17,7 +18,7 @@ name: listing-disease-sneeze-name description: listing-disease-sneeze-description icon: { sprite: /Textures/Ligyb/disease.rsi, state: sneeze } - productEvent: !type:DiseaseStartSneezeEvent + productAction: ActionDiseaseSneeze cost: DiseasePoints: 20 categories: @@ -31,7 +32,7 @@ name: listing-disease-vomit-name description: listing-disease-vomit-description icon: { sprite: /Textures/Ligyb/disease.rsi, state: vomit } - productEvent: !type:DiseaseStartVomitEvent + productAction: ActionDiseaseVomit cost: DiseasePoints: 25 categories: @@ -45,7 +46,7 @@ name: listing-disease-narcolepsy-name description: listing-disease-narcolepsy-description icon: { sprite: /Textures/Ligyb/disease.rsi, state: narcolepsy } - productEvent: !type:DiseaseNarcolepsyEvent + productAction: ActionDiseaseNarcolepsy cost: DiseasePoints: 20 categories: @@ -59,7 +60,7 @@ name: listing-disease-cry-name description: listing-disease-cry-description icon: { sprite: /Textures/Ligyb/disease.rsi, state: sob } - productEvent: !type:DiseaseStartCryingEvent + productAction: ActionDiseaseCrying cost: DiseasePoints: 10 categories: @@ -68,70 +69,12 @@ - !type:ListingLimitedStockCondition stock: 1 - - -- type: listing - id: BaseChance - name: listing-disease-base-chance-name - description: listing-disease-base-chance-description - icon: { sprite: /Textures/Ligyb/disease.rsi, state: baseChance } - productEvent: !type:DiseaseAddBaseChanceEvent - cost: - DiseasePoints: 20 - categories: - - DiseaseEvolutionCategory - conditions: - - !type:ListingLimitedStockCondition - stock: 4 - -- type: listing - id: CoughChance - name: listing-disease-infect-chance-name - description: listing-disease-infect-chance-description - icon: { sprite: /Textures/Ligyb/disease.rsi, state: coughChance } - productEvent: !type:DiseaseAddBaseChanceEvent - cost: - DiseasePoints: 15 - categories: - - DiseaseEvolutionCategory - conditions: - - !type:ListingLimitedStockCondition - stock: 8 - -- type: listing - id: Shield - name: listing-disease-shield-name - description: listing-disease-shield-description - icon: { sprite: /Textures/Ligyb/disease.rsi, state: shield } - productEvent: !type:DiseaseAddShieldEvent - cost: - DiseasePoints: 15 - categories: - - DiseaseEvolutionCategory - conditions: - - !type:ListingLimitedStockCondition - stock: 5 - -- type: listing - id: Lethal - name: listing-disease-lethal-name - description: listing-disease-lethal-description - icon: { sprite: /Textures/Ligyb/disease.rsi, state: lethal } - productEvent: !type:DiseaseAddLethalEvent - cost: - DiseasePoints: 15 - categories: - - DiseaseEvolutionCategory - conditions: - - !type:ListingLimitedStockCondition - stock: 5 - - type: listing id: Muted name: listing-disease-muted-name description: listing-disease-muted-description icon: { sprite: /Textures/Ligyb/disease.rsi, state: muted } - productEvent: !type:DiseaseMutedEvent + productAction: ActionDiseaseMuted cost: DiseasePoints: 25 categories: @@ -145,7 +88,7 @@ name: listing-disease-slowness-name description: listing-disease-slowness-description icon: { sprite: /Textures/Ligyb/disease.rsi, state: slowness } - productEvent: !type:DiseaseSlownessEvent + productAction: ActionDiseaseSlowness cost: DiseasePoints: 15 categories: @@ -159,7 +102,7 @@ name: listing-disease-bleed-name description: listing-disease-bleed-description icon: { sprite: /Textures/Ligyb/disease.rsi, state: bleed } - productEvent: !type:DiseaseBleedEvent + productAction: ActionDiseaseBleed cost: DiseasePoints: 30 categories: @@ -173,7 +116,7 @@ name: listing-disease-blindness-name description: listing-disease-blindness-description icon: { sprite: /Textures/Ligyb/disease.rsi, state: blindness } - productEvent: !type:DiseaseBlindnessEvent + productAction: ActionDiseaseBlindness cost: DiseasePoints: 40 categories: @@ -186,12 +129,12 @@ id: Insult name: listing-disease-insult-name description: listing-disease-insult-description - icon: { sprite: /Textures/Ligyb/disease.rsi, state: blindness } - productEvent: !type:DiseaseInsultEvent + icon: { sprite: /Textures/Ligyb/disease.rsi, state: lethal } + productAction: ActionDiseaseInsult cost: DiseasePoints: 20 categories: - DiseaseSymptomsCategory conditions: - !type:ListingLimitedStockCondition - stock: 1 \ No newline at end of file + stock: 1 From 5b3a04e37f16f8945cad1adf2cc8bc8918d7216d Mon Sep 17 00:00:00 2001 From: Lgibb18 <65973111+Lgibb18@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:57:23 +0500 Subject: [PATCH 04/13] why --- Content.Client/Ligyb/SickSystem.cs | 4 - Content.Server/Ligyb/CureDiseaseInfection.cs | 4 - Content.Server/Ligyb/DiseaseRoleSystem.cs | 14 +--- Content.Server/Ligyb/SickSystem.cs | 74 +++++++++---------- .../Ligyb/DiseaseVaccineTimerSystem.cs | 11 +-- .../Ligyb/SharedDiseaseRoleSystem.cs | 33 --------- 6 files changed, 40 insertions(+), 100 deletions(-) diff --git a/Content.Client/Ligyb/SickSystem.cs b/Content.Client/Ligyb/SickSystem.cs index e12989ec0b0..186235e5861 100644 --- a/Content.Client/Ligyb/SickSystem.cs +++ b/Content.Client/Ligyb/SickSystem.cs @@ -1,8 +1,4 @@ -<<<<<<< HEAD // © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt -using Content.Shared.CCVar; -======= ->>>>>>> master using Content.Shared.Mind.Components; using Content.Shared.Mobs.Systems; using Content.Shared.NPC; diff --git a/Content.Server/Ligyb/CureDiseaseInfection.cs b/Content.Server/Ligyb/CureDiseaseInfection.cs index 0acf96a6e1d..952447bb4f3 100644 --- a/Content.Server/Ligyb/CureDiseaseInfection.cs +++ b/Content.Server/Ligyb/CureDiseaseInfection.cs @@ -1,8 +1,4 @@ -<<<<<<< HEAD // © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt -using Content.Server.Zombies; -======= ->>>>>>> master using Content.Shared.Chemistry.Reagent; using Robust.Shared.Prototypes; using Content.Shared.Ligyb; diff --git a/Content.Server/Ligyb/DiseaseRoleSystem.cs b/Content.Server/Ligyb/DiseaseRoleSystem.cs index 5ae15431f2f..c952de2ab0c 100644 --- a/Content.Server/Ligyb/DiseaseRoleSystem.cs +++ b/Content.Server/Ligyb/DiseaseRoleSystem.cs @@ -1,11 +1,4 @@ -<<<<<<< HEAD // © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt -using Content.Server.Body.Systems; -using Content.Server.Chat.Systems; -using Content.Server.Doors.Systems; -using Content.Server.Weapons.Ranged.Systems; -======= ->>>>>>> master using Content.Shared.Actions; using Robust.Shared.Random; using Content.Shared.Ligyb; @@ -45,7 +38,7 @@ public override void Initialize() private void OnLethal(EntityUid uid, DiseaseRoleComponent component, DiseaseAddLethalEvent args) { - if(!TryRemoveMoney(uid, 15)) + if (!TryRemoveMoney(uid, 15)) { _popup.PopupEntity($"Вам не хватает очков эволюции", uid, uid); return; @@ -108,7 +101,7 @@ private void OnInfects(InfectEvent args) { if (TryComp(args.Performer, out var component)) { - if(component.FreeInfects > 0) + if (component.FreeInfects > 0) { component.FreeInfects--; OnInfect(args, 1); @@ -174,7 +167,8 @@ bool TryRemoveMoney(EntityUid uid, FixedPoint2 value) }, uid); _store.UpdateUserInterface(uid, uid, store); return true; - } else + } + else { return false; } diff --git a/Content.Server/Ligyb/SickSystem.cs b/Content.Server/Ligyb/SickSystem.cs index 0fc75ab6848..d4e5f47d66d 100644 --- a/Content.Server/Ligyb/SickSystem.cs +++ b/Content.Server/Ligyb/SickSystem.cs @@ -1,8 +1,4 @@ -<<<<<<< HEAD // © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt -using Robust.Shared.Configuration; -======= ->>>>>>> master using Robust.Shared.Prototypes; using Robust.Shared.Timing; using Content.Shared.Ligyb; @@ -236,7 +232,7 @@ private void OnEmote(EntityUid uid, SickComponent component, ref EmoteEvent args { <<<<<<< HEAD _popupSystem.PopupEntity("Вы чувствуете лёгкую головную боль.", uid, uid, PopupType.Small); - } + } if (args.Emote.ID == "Cough") { if (_robustRandom.Prob(0.9f)) @@ -295,56 +291,56 @@ private void OnEmote(EntityUid uid, SickComponent component, ref EmoteEvent args >>>>>>> master if (_prototypeManager.TryIndex(kind.ToString(), out var damagePrototype)) { - _damageableSystem.TryChangeDamage(uid, new(damagePrototype, 0.35f * dis.Lethal), true, origin: uid); + _damageableSystem.TryChangeDamage(uid, new (damagePrototype, 0.35f * dis.Lethal), true, origin: uid); } } <<<<<<< HEAD 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); - } - } +foreach (var entity in _lookup.GetEntitiesInRange(uid, 0.7f)) +{ + if (HasComp(entity) && !HasComp(entity) && !HasComp(entity)) + { + OnInfected(entity, component.owner, Comp(component.owner).CoughInfectChance); + } +} } } if (args.Emote.ID == "Sneeze") +{ + if (_robustRandom.Prob(0.9f)) + { + EntityCoordinates start = Transform(uid).Coordinates; + foreach (var entity in _lookup.GetEntitiesInRange(uid, 1.2f)) { - if (_robustRandom.Prob(0.9f)) + if (HasComp(entity) && !HasComp(entity) && !HasComp(entity)) { - 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); - } - } + OnInfected(entity, component.owner, Comp(component.owner).CoughInfectChance); } } - if (args.Emote.ID == "Vomit") + } +} +if (args.Emote.ID == "Vomit") +{ + if (_robustRandom.Prob(0.4f)) + { + _vomitSystem.Vomit(uid, -30, -20); + } +} +if (args.Emote.ID == "Insult") +{ + if (TryComp(component.owner, out var disease)) + { + _stun.TryParalyze(uid, TimeSpan.FromSeconds(5), false); + var kind = SuicideKind.Shock; + if (_prototypeManager.TryIndex(kind.ToString(), out var damagePrototype)) { - if (_robustRandom.Prob(0.4f)) - { - _vomitSystem.Vomit(uid, -30, -20); - } + _damageableSystem.TryChangeDamage(uid, new(damagePrototype, 0.35f * disease.Lethal), true, origin: uid); } - if (args.Emote.ID == "Insult") - { - if (TryComp(component.owner, out var disease)) - { - _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 * disease.Lethal), true, origin: uid); - } - } + } ======= break; >>>>>>> master - } +} } } diff --git a/Content.Shared/Ligyb/DiseaseVaccineTimerSystem.cs b/Content.Shared/Ligyb/DiseaseVaccineTimerSystem.cs index 899d22ef49f..0c63526cdfe 100644 --- a/Content.Shared/Ligyb/DiseaseVaccineTimerSystem.cs +++ b/Content.Shared/Ligyb/DiseaseVaccineTimerSystem.cs @@ -1,8 +1,4 @@ -<<<<<<< HEAD // © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt -using Robust.Shared.Configuration; -======= ->>>>>>> master namespace Content.Shared.Ligyb; using Robust.Shared.Timing; using Content.Shared.Movement.Components; @@ -20,13 +16,8 @@ public override void Initialize() } public void OnInit(EntityUid uid, DiseaseVaccineTimerComponent component, ComponentInit args) { -<<<<<<< HEAD - component.ReadyAt = _gameTiming.CurTime + component.delay; - if (TryComp(uid, out var speed)) -======= component.ReadyAt = _gameTiming.CurTime + component.Delay; - if(TryComp(uid, out var speed)) ->>>>>>> master + if (TryComp(uid, out var speed)) { component.SpeedBefore = speed.BaseSprintSpeed; _movementSpeed.ChangeBaseSpeed(uid, speed.BaseWalkSpeed, speed.BaseSprintSpeed / 2, speed.Acceleration, speed); diff --git a/Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs b/Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs index 2dfc9c26d78..3680854566e 100644 --- a/Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs +++ b/Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs @@ -1,12 +1,4 @@ -<<<<<<< HEAD // © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt -using Content.Shared.Actions; -using Content.Shared.DoAfter; -using Content.Shared.Doors.Systems; -using Robust.Shared.Audio.Systems; -using Robust.Shared.Map; -======= ->>>>>>> master using Robust.Shared.Random; using Content.Shared.Humanoid; @@ -37,34 +29,9 @@ public void OnInfect(InfectEvent ev, float probability = 0) prob = Math.Max(Math.Min(prob, 0), 1); if (_robustRandom.Prob(prob)) { -<<<<<<< HEAD - ev.Handled = true; - - if (!TryComp(ev.Target, out var body)) - return; - if (HasComp(ev.Target)) return; - if (HasComp(ev.Target)) return; - var prob = comp.BaseInfectChance; - if (TryComp(ev.Target, out var immune)) - { - prob -= immune.Prob; - - } - if (prob < 0) prob = 0; - if (prob > 1) prob = 1; - if (_robustRandom.Prob(prob)) - { - var comps = AddComp(ev.Target); - comps.owner = ev.Performer; - - comp.Infected.Add(ev.Target); - - } -======= var comps = AddComp(ev.Target); comps.owner = ev.Performer; comp.Infected.Add(ev.Target); ->>>>>>> master } } } From 8145a61299f9f38847dcddfc710caae4e60ab436 Mon Sep 17 00:00:00 2001 From: Lgibb18 <65973111+Lgibb18@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:10:00 +0500 Subject: [PATCH 05/13] fix --- Content.Server/Ligyb/SickSystem.cs | 65 ++---------------------------- 1 file changed, 4 insertions(+), 61 deletions(-) diff --git a/Content.Server/Ligyb/SickSystem.cs b/Content.Server/Ligyb/SickSystem.cs index d4e5f47d66d..3ffbbcbd911 100644 --- a/Content.Server/Ligyb/SickSystem.cs +++ b/Content.Server/Ligyb/SickSystem.cs @@ -230,24 +230,14 @@ private void OnEmote(EntityUid uid, SickComponent component, ref EmoteEvent args args.Handled = true; switch (args.Emote.ID) { -<<<<<<< HEAD - _popupSystem.PopupEntity("Вы чувствуете лёгкую головную боль.", uid, uid, PopupType.Small); - } - if (args.Emote.ID == "Cough") - { - if (_robustRandom.Prob(0.9f)) - { - if (TryComp(component.owner, out var disease)) - { - var kind = SuicideKind.Piercing; -======= case "Headache": _popupSystem.PopupEntity("Вы чувствуете лёгкую головную боль.", uid, uid, PopupType.Small); break; case "Cough": if (_robustRandom.Prob(0.9f)) { - if (TryComp(component.owner, out var disease)) { + if (TryComp(component.owner, out var disease)) + { var kind = SuicideKind.Piercing; if (_prototypeManager.TryIndex(kind.ToString(), out var damagePrototype)) { @@ -288,59 +278,12 @@ private void OnEmote(EntityUid uid, SickComponent component, ref EmoteEvent args { _stun.TryParalyze(uid, TimeSpan.FromSeconds(5), false); var kind = SuicideKind.Shock; ->>>>>>> master if (_prototypeManager.TryIndex(kind.ToString(), out var damagePrototype)) { - _damageableSystem.TryChangeDamage(uid, new (damagePrototype, 0.35f * dis.Lethal), true, origin: uid); + _damageableSystem.TryChangeDamage(uid, new(damagePrototype, 0.35f * dis.Lethal), true, origin: uid); } } -<<<<<<< HEAD - - 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); - } -} - } - } - if (args.Emote.ID == "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); - } - } - } -} -if (args.Emote.ID == "Vomit") -{ - if (_robustRandom.Prob(0.4f)) - { - _vomitSystem.Vomit(uid, -30, -20); - } -} -if (args.Emote.ID == "Insult") -{ - if (TryComp(component.owner, out var disease)) - { - _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 * disease.Lethal), true, origin: uid); - } - } -======= break; ->>>>>>> master -} + } } } From 40b30cfce30487c499b5fe07396735b5b3b4d4f2 Mon Sep 17 00:00:00 2001 From: Lgibb18 <65973111+Lgibb18@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:24:31 +0500 Subject: [PATCH 06/13] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D1=80=D1=81?= =?UTF-8?q?=D0=B8=20=D0=B8=20=D0=BB=D0=BE=D0=BA=D0=B0=D0=BB=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Resources/Locale/ru-RU/ligyb/vaccine.ftl | 3 + .../Prototypes/Chemistry/mixing_types.yml | 6 +- .../Ligyb/Disease/Store/Actions.yml | 1 - .../Ligyb/Vaccine/Reagents/blood.yml | 10 +- .../Ligyb/Vaccine/Reagents/vaccine.yml | 8 +- .../Textures/Ligyb/disease.rsi/meta.json | 132 +++++++++--------- 6 files changed, 82 insertions(+), 78 deletions(-) diff --git a/Resources/Locale/ru-RU/ligyb/vaccine.ftl b/Resources/Locale/ru-RU/ligyb/vaccine.ftl index a64fe178e86..36a9a17e288 100644 --- a/Resources/Locale/ru-RU/ligyb/vaccine.ftl +++ b/Resources/Locale/ru-RU/ligyb/vaccine.ftl @@ -1,4 +1,7 @@ reagent-name-disease-blood = мутная кровь +reagent-description-disease-bad-physical-desc = мерзкое +reagent-description-disease-strange-physical-desc = странное +mixing-verb-vaccinator = вакцинатор reagent-description-disease-blood = очень странная жидкость. Напоминает кровь reagent-name-disease-blood-reagent = заражённая жидкость reagent-name-notready-vaccine = вирусин diff --git a/Resources/Prototypes/Chemistry/mixing_types.yml b/Resources/Prototypes/Chemistry/mixing_types.yml index b8ac46c5ec7..118172aeeb0 100644 --- a/Resources/Prototypes/Chemistry/mixing_types.yml +++ b/Resources/Prototypes/Chemistry/mixing_types.yml @@ -40,10 +40,10 @@ - type: mixingCategory id: Vaccinator - verbText: Вакцинатор + verbText: mixing-verb-vaccinator icon: - sprite: Structures/Machines/Medical/centrifuge.rsi - state: base + sprite: Structures/Machines/vaccinator.rsi + state: icon - type: mixingCategory id: Electrolysis diff --git a/Resources/Prototypes/Ligyb/Disease/Store/Actions.yml b/Resources/Prototypes/Ligyb/Disease/Store/Actions.yml index 2cd93ee4474..3743f6787d6 100644 --- a/Resources/Prototypes/Ligyb/Disease/Store/Actions.yml +++ b/Resources/Prototypes/Ligyb/Disease/Store/Actions.yml @@ -20,7 +20,6 @@ noSpawn: true components: - type: InstantAction - id: ActionDiseaseSneeze itemIconStyle: NoItem icon: sprite: Ligyb/disease.rsi diff --git a/Resources/Prototypes/Ligyb/Vaccine/Reagents/blood.yml b/Resources/Prototypes/Ligyb/Vaccine/Reagents/blood.yml index 78f53ddc465..94b4afc29a6 100644 --- a/Resources/Prototypes/Ligyb/Vaccine/Reagents/blood.yml +++ b/Resources/Prototypes/Ligyb/Vaccine/Reagents/blood.yml @@ -3,7 +3,7 @@ name: reagent-name-disease-blood group: Infect desc: reagent-description-disease-blood - physicalDesc: мерзкое + physicalDesc: reagent-description-disease-bad-physical-desc flavor: bitter color: "#722222" slippery: false @@ -27,7 +27,7 @@ name: reagent-name-disease-blood group: Infect desc: reagent-description-disease-blood - physicalDesc: мерзкое + physicalDesc: reagent-description-disease-bad-physical-desc flavor: bitter color: "#733333" slippery: false @@ -51,7 +51,7 @@ name: reagent-name-disease-blood group: Infect desc: reagent-description-disease-blood - physicalDesc: мерзкое + physicalDesc: reagent-description-disease-bad-physical-desc flavor: bitter color: "#815131" slippery: false @@ -75,7 +75,7 @@ name: reagent-name-disease-blood-reagent group: Biological desc: reagent-description-disease-blood - physicalDesc: мерзкое + physicalDesc: reagent-description-disease-bad-physical-desc flavor: bitter color: "#737373" slippery: false @@ -92,4 +92,4 @@ types: Poison: 8 - !type:ChemVomit - probability: 1 \ No newline at end of file + probability: 1 diff --git a/Resources/Prototypes/Ligyb/Vaccine/Reagents/vaccine.yml b/Resources/Prototypes/Ligyb/Vaccine/Reagents/vaccine.yml index 827bcf1b0b0..b1b7c4a14fd 100644 --- a/Resources/Prototypes/Ligyb/Vaccine/Reagents/vaccine.yml +++ b/Resources/Prototypes/Ligyb/Vaccine/Reagents/vaccine.yml @@ -3,7 +3,7 @@ name: reagent-name-notready-vaccine group: Medicine desc: reagent-description-notready-vaccine - physicalDesc: странное + physicalDesc: reagent-description-disease-strange-physical-desc flavor: medicine color: "#83a7b1" @@ -12,7 +12,7 @@ name: reagent-name-vaccine group: Medicine desc: reagent-description-vaccine - physicalDesc: странное + physicalDesc: reagent-description-disease-strange-physical-desc flavor: medicine color: "#86caf7" metabolisms: @@ -28,7 +28,7 @@ name: reagent-name-vaccine-plus group: Medicine desc: reagent-description-vaccine-plus - physicalDesc: сладкое + physicalDesc: reagent-description-disease-strange-physical-desc flavor: medicine color: "#8192ea" metabolisms: @@ -38,4 +38,4 @@ innoculate: true conditions: - !type:ReagentThreshold - min: 7 \ No newline at end of file + min: 7 diff --git a/Resources/Textures/Ligyb/disease.rsi/meta.json b/Resources/Textures/Ligyb/disease.rsi/meta.json index 1796e9346d4..942062b603c 100644 --- a/Resources/Textures/Ligyb/disease.rsi/meta.json +++ b/Resources/Textures/Ligyb/disease.rsi/meta.json @@ -1,66 +1,68 @@ { - "version": 1, - "size": { - "x": 32, - "y": 32 - }, - "states": [ - { - "name": "icon" - }, - { - "name": "idle" - }, - { - "name": "action" - }, - { - "name": "sick" - }, - { - "name": "shop" - }, - { - "name": "cough" - }, - { - "name": "sneeze" - }, - { - "name": "vomit" - }, - { - "name": "sob" - }, - { - "name": "baseChance" - }, - { - "name": "coughChance" - }, - { - "name": "zombie" - }, - { - "name": "lethal" - }, - { - "name": "shield" - }, - { - "name": "narcolepsy" - }, - { - "name": "muted" - }, - { - "name": "slowness" - }, - { - "name": "bleed" - }, - { - "name": "blindness" - } - ] -} + "version": 1, + "license": "CC0-1.0", + "copyright": "Made by Ligyb", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "icon" + }, + { + "name": "idle" + }, + { + "name": "action" + }, + { + "name": "sick" + }, + { + "name": "shop" + }, + { + "name": "cough" + }, + { + "name": "sneeze" + }, + { + "name": "vomit" + }, + { + "name": "sob" + }, + { + "name": "baseChance" + }, + { + "name": "coughChance" + }, + { + "name": "zombie" + }, + { + "name": "lethal" + }, + { + "name": "shield" + }, + { + "name": "narcolepsy" + }, + { + "name": "muted" + }, + { + "name": "slowness" + }, + { + "name": "bleed" + }, + { + "name": "blindness" + } + ] +} \ No newline at end of file From ac33a3a1124175a87b82a72ed49f228e8c6c8aa6 Mon Sep 17 00:00:00 2001 From: Lgibb18 <65973111+Lgibb18@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:21:36 +0500 Subject: [PATCH 07/13] update --- RobustToolbox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RobustToolbox b/RobustToolbox index 49c831b48d1..c89c529ba4f 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit 49c831b48d1449e90a65acdb0c276d2deea4ce2c +Subproject commit c89c529ba4fa7516e2265f3c47549da35ab6c3d8 From c50b4921bbf99cfe7e778c1aac8c4345e1c05f1c Mon Sep 17 00:00:00 2001 From: Lgibb18 <65973111+Lgibb18@users.noreply.github.com> Date: Mon, 12 Aug 2024 16:15:39 +0500 Subject: [PATCH 08/13] Revert "update" This reverts commit ac33a3a1124175a87b82a72ed49f228e8c6c8aa6. --- RobustToolbox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RobustToolbox b/RobustToolbox index c89c529ba4f..49c831b48d1 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit c89c529ba4fa7516e2265f3c47549da35ab6c3d8 +Subproject commit 49c831b48d1449e90a65acdb0c276d2deea4ce2c From 4712d1792d443fad56eab68d70b62acd725b882f Mon Sep 17 00:00:00 2001 From: Lgibb18 <65973111+Lgibb18@users.noreply.github.com> Date: Mon, 12 Aug 2024 16:36:24 +0500 Subject: [PATCH 09/13] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D0=BE=D1=81=D0=BF=D0=BE=D1=81=D0=BE=D0=B1?= =?UTF-8?q?=D0=BD=D0=BE=D1=81=D1=82=D0=B8,=20=D0=BE=D0=BF=D1=8F=D1=82?= =?UTF-8?q?=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Client/Ligyb/SickSystem.cs | 3 +-- Content.Server/Ligyb/CureDiseaseInfection.cs | 11 ++++++----- Content.Server/Ligyb/DiseaseRoleSystem.cs | 1 + Content.Server/Ligyb/SickSystem.cs | 2 +- Content.Server/Ligyb/VaccinatorSystem.cs | 8 +++++--- Content.Shared/Ligyb/InfectEvent.cs | 16 ---------------- Content.Shared/Ligyb/SharedVaccinatorSystem.cs | 2 +- RobustToolbox | 2 +- 8 files changed, 16 insertions(+), 29 deletions(-) diff --git a/Content.Client/Ligyb/SickSystem.cs b/Content.Client/Ligyb/SickSystem.cs index 186235e5861..2baa2df2575 100644 --- a/Content.Client/Ligyb/SickSystem.cs +++ b/Content.Client/Ligyb/SickSystem.cs @@ -34,8 +34,7 @@ private void OnGetStatusIcon(EntityUid uid, SickComponent component, ref GetStat { if (HasComp(_playerManager.LocalEntity.Value)) { - if (!args.InContainer && - !_mobState.IsDead(uid) && + if (!_mobState.IsDead(uid) && !HasComp(uid) && TryComp(uid, out var mindContainer) && mindContainer.ShowExamineInfo) diff --git a/Content.Server/Ligyb/CureDiseaseInfection.cs b/Content.Server/Ligyb/CureDiseaseInfection.cs index 952447bb4f3..06cd95d18b5 100644 --- a/Content.Server/Ligyb/CureDiseaseInfection.cs +++ b/Content.Server/Ligyb/CureDiseaseInfection.cs @@ -2,7 +2,8 @@ using Content.Shared.Chemistry.Reagent; using Robust.Shared.Prototypes; using Content.Shared.Ligyb; -public sealed partial class CureDiseaseInfection : ReagentEffect +using Content.Shared.EntityEffects; +public sealed partial class CureDiseaseInfection : EntityEffect { [DataField] public bool Innoculate; @@ -15,15 +16,15 @@ public sealed partial class CureDiseaseInfection : ReagentEffect return "окей"; } - public override void Effect(ReagentEffectArgs args) + public override void Effect(EntityEffectBaseArgs args) { var entityManager = args.EntityManager; - if (!entityManager.HasComponent(args.SolutionEntity)) return; - if (entityManager.TryGetComponent(args.SolutionEntity, out var sick)) + if (!entityManager.HasComponent(args.TargetEntity)) return; + if (entityManager.TryGetComponent(args.TargetEntity, out var sick)) { if (entityManager.TryGetComponent(sick.owner, out var disease)) { - var comp = entityManager.EnsureComponent(args.SolutionEntity); + var comp = entityManager.EnsureComponent(args.TargetEntity); comp.Immune = Innoculate; comp.Delay = TimeSpan.FromMinutes(2) + TimeSpan.FromSeconds(disease.Shield * 30); } diff --git a/Content.Server/Ligyb/DiseaseRoleSystem.cs b/Content.Server/Ligyb/DiseaseRoleSystem.cs index c952de2ab0c..50056b0b33c 100644 --- a/Content.Server/Ligyb/DiseaseRoleSystem.cs +++ b/Content.Server/Ligyb/DiseaseRoleSystem.cs @@ -7,6 +7,7 @@ using Robust.Shared.Prototypes; using Content.Shared.FixedPoint; using Content.Shared.Popups; +using Content.Shared.Store.Components; namespace Content.Server.Ligyb; public sealed class DiseaseRoleSystem : SharedDiseaseRoleSystem diff --git a/Content.Server/Ligyb/SickSystem.cs b/Content.Server/Ligyb/SickSystem.cs index 3ffbbcbd911..8293280de2d 100644 --- a/Content.Server/Ligyb/SickSystem.cs +++ b/Content.Server/Ligyb/SickSystem.cs @@ -28,7 +28,7 @@ using Content.Shared.Eye.Blinding.Components; using Content.Shared.Item; using Content.Shared.Speech.Muting; -using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components; +using Content.Shared.Store.Components; namespace Content.Server.Ligyb; public sealed class SickSystem : SharedSickSystem { diff --git a/Content.Server/Ligyb/VaccinatorSystem.cs b/Content.Server/Ligyb/VaccinatorSystem.cs index c8053393d7e..ab9a74a6ef3 100644 --- a/Content.Server/Ligyb/VaccinatorSystem.cs +++ b/Content.Server/Ligyb/VaccinatorSystem.cs @@ -15,7 +15,7 @@ using System.Collections.Frozen; using Content.Shared.Paper; using Robust.Shared.Utility; -using static Content.Shared.Paper.SharedPaperComponent; +using static Content.Shared.Paper.PaperComponent; using Robust.Shared.Prototypes; using System.Linq; using Robust.Shared.Serialization; @@ -127,8 +127,10 @@ private void OnPaper(PaperInputTextMessageLigyb args) } } text.AppendLine("После чего положить полученную жидкость в вакцинатор, добавив одну каплю крови здорового человека."); - - _paperSystem.SetContent(printed, text.ToString()); + if(TryComp(printed, out var paperComp)) + { + _paperSystem.SetContent((printed, paperComp), text.ToString()); + } } } } diff --git a/Content.Shared/Ligyb/InfectEvent.cs b/Content.Shared/Ligyb/InfectEvent.cs index 74be319623f..62b9fef4fb0 100644 --- a/Content.Shared/Ligyb/InfectEvent.cs +++ b/Content.Shared/Ligyb/InfectEvent.cs @@ -1,23 +1,7 @@ // © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt 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 diff --git a/Content.Shared/Ligyb/SharedVaccinatorSystem.cs b/Content.Shared/Ligyb/SharedVaccinatorSystem.cs index 84789fb6968..4c662f1d227 100644 --- a/Content.Shared/Ligyb/SharedVaccinatorSystem.cs +++ b/Content.Shared/Ligyb/SharedVaccinatorSystem.cs @@ -10,7 +10,7 @@ using System.Collections.Frozen; using Content.Shared.Paper; using Robust.Shared.Utility; -using static Content.Shared.Paper.SharedPaperComponent; +using static Content.Shared.Paper.PaperComponent; using Robust.Shared.Prototypes; using System.Linq; using Robust.Shared.Serialization; diff --git a/RobustToolbox b/RobustToolbox index 49c831b48d1..21787079377 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit 49c831b48d1449e90a65acdb0c276d2deea4ce2c +Subproject commit 217870793771c008327fe0a7d3be965b2f4880c3 From 1aba7fc1cbba375e208d579dbc1c18563878a2e2 Mon Sep 17 00:00:00 2001 From: Lgibb18 <65973111+Lgibb18@users.noreply.github.com> Date: Mon, 12 Aug 2024 16:43:00 +0500 Subject: [PATCH 10/13] =?UTF-8?q?=D0=BD=D0=B8=D0=BA=D0=B0=D0=BA=D0=BE?= =?UTF-8?q?=D0=B3=D0=BE=20=D0=BB=D0=B8=D0=B3=D1=83=D0=B1=D0=B0,=20=D1=82?= =?UTF-8?q?=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20=D1=81=D0=B0=D0=BD=D1=80=D0=B0?= =?UTF-8?q?=D0=B9=D0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Client/{Ligyb => _Sunrise/Disease}/DiseaseRoleSystem.cs | 0 Content.Client/{Ligyb => _Sunrise/Disease}/SickSystem.cs | 0 Content.Client/{Ligyb => _Sunrise/Disease}/VaccinatorSystem.cs | 0 .../{Ligyb => _Sunrise/Disease}/CureDiseaseInfection.cs | 0 .../{Ligyb => _Sunrise/Disease}/DiseaseImmuneClothingSystem.cs | 0 Content.Server/{Ligyb => _Sunrise/Disease}/DiseaseRoleSystem.cs | 0 .../{Ligyb => _Sunrise/Disease}/MinimumBleedComponent.cs | 0 Content.Server/{Ligyb => _Sunrise/Disease}/MinimumBleedSystem.cs | 0 Content.Server/{Ligyb => _Sunrise/Disease}/SickSystem.cs | 0 Content.Server/{Ligyb => _Sunrise/Disease}/SleepyComponent.cs | 0 Content.Server/{Ligyb => _Sunrise/Disease}/SleepySystem.cs | 0 Content.Server/{Ligyb => _Sunrise/Disease}/VaccinatorSystem.cs | 0 .../{Ligyb => _Sunrise/Disease}/DiseaseImmuneClothingComponent.cs | 0 .../{Ligyb => _Sunrise/Disease}/DiseaseImmuneComponent.cs | 0 .../{Ligyb => _Sunrise/Disease}/DiseaseRoleComponent.cs | 0 .../{Ligyb => _Sunrise/Disease}/DiseaseTempImmuneComponent.cs | 0 .../{Ligyb => _Sunrise/Disease}/DiseaseVaccineTimerComponent.cs | 0 .../{Ligyb => _Sunrise/Disease}/DiseaseVaccineTimerSystem.cs | 0 Content.Shared/{Ligyb => _Sunrise/Disease}/InfectEvent.cs | 0 .../{Ligyb => _Sunrise/Disease}/SharedDiseaseRoleSystem.cs | 0 Content.Shared/{Ligyb => _Sunrise/Disease}/SharedSickSystem.cs | 0 .../{Ligyb => _Sunrise/Disease}/SharedVaccinatorSystem.cs | 0 Content.Shared/{Ligyb => _Sunrise/Disease}/SickComponent.cs | 0 .../{Ligyb => _Sunrise/Disease}/SpeedModifierOnComponent.cs | 0 .../{Ligyb => _Sunrise/Disease}/SpeedModifierOnSystem.cs | 0 Content.Shared/{Ligyb => _Sunrise/Disease}/VaccinatorComponent.cs | 0 26 files changed, 0 insertions(+), 0 deletions(-) rename Content.Client/{Ligyb => _Sunrise/Disease}/DiseaseRoleSystem.cs (100%) rename Content.Client/{Ligyb => _Sunrise/Disease}/SickSystem.cs (100%) rename Content.Client/{Ligyb => _Sunrise/Disease}/VaccinatorSystem.cs (100%) rename Content.Server/{Ligyb => _Sunrise/Disease}/CureDiseaseInfection.cs (100%) rename Content.Server/{Ligyb => _Sunrise/Disease}/DiseaseImmuneClothingSystem.cs (100%) rename Content.Server/{Ligyb => _Sunrise/Disease}/DiseaseRoleSystem.cs (100%) rename Content.Server/{Ligyb => _Sunrise/Disease}/MinimumBleedComponent.cs (100%) rename Content.Server/{Ligyb => _Sunrise/Disease}/MinimumBleedSystem.cs (100%) rename Content.Server/{Ligyb => _Sunrise/Disease}/SickSystem.cs (100%) rename Content.Server/{Ligyb => _Sunrise/Disease}/SleepyComponent.cs (100%) rename Content.Server/{Ligyb => _Sunrise/Disease}/SleepySystem.cs (100%) rename Content.Server/{Ligyb => _Sunrise/Disease}/VaccinatorSystem.cs (100%) rename Content.Shared/{Ligyb => _Sunrise/Disease}/DiseaseImmuneClothingComponent.cs (100%) rename Content.Shared/{Ligyb => _Sunrise/Disease}/DiseaseImmuneComponent.cs (100%) rename Content.Shared/{Ligyb => _Sunrise/Disease}/DiseaseRoleComponent.cs (100%) rename Content.Shared/{Ligyb => _Sunrise/Disease}/DiseaseTempImmuneComponent.cs (100%) rename Content.Shared/{Ligyb => _Sunrise/Disease}/DiseaseVaccineTimerComponent.cs (100%) rename Content.Shared/{Ligyb => _Sunrise/Disease}/DiseaseVaccineTimerSystem.cs (100%) rename Content.Shared/{Ligyb => _Sunrise/Disease}/InfectEvent.cs (100%) rename Content.Shared/{Ligyb => _Sunrise/Disease}/SharedDiseaseRoleSystem.cs (100%) rename Content.Shared/{Ligyb => _Sunrise/Disease}/SharedSickSystem.cs (100%) rename Content.Shared/{Ligyb => _Sunrise/Disease}/SharedVaccinatorSystem.cs (100%) rename Content.Shared/{Ligyb => _Sunrise/Disease}/SickComponent.cs (100%) rename Content.Shared/{Ligyb => _Sunrise/Disease}/SpeedModifierOnComponent.cs (100%) rename Content.Shared/{Ligyb => _Sunrise/Disease}/SpeedModifierOnSystem.cs (100%) rename Content.Shared/{Ligyb => _Sunrise/Disease}/VaccinatorComponent.cs (100%) diff --git a/Content.Client/Ligyb/DiseaseRoleSystem.cs b/Content.Client/_Sunrise/Disease/DiseaseRoleSystem.cs similarity index 100% rename from Content.Client/Ligyb/DiseaseRoleSystem.cs rename to Content.Client/_Sunrise/Disease/DiseaseRoleSystem.cs diff --git a/Content.Client/Ligyb/SickSystem.cs b/Content.Client/_Sunrise/Disease/SickSystem.cs similarity index 100% rename from Content.Client/Ligyb/SickSystem.cs rename to Content.Client/_Sunrise/Disease/SickSystem.cs diff --git a/Content.Client/Ligyb/VaccinatorSystem.cs b/Content.Client/_Sunrise/Disease/VaccinatorSystem.cs similarity index 100% rename from Content.Client/Ligyb/VaccinatorSystem.cs rename to Content.Client/_Sunrise/Disease/VaccinatorSystem.cs diff --git a/Content.Server/Ligyb/CureDiseaseInfection.cs b/Content.Server/_Sunrise/Disease/CureDiseaseInfection.cs similarity index 100% rename from Content.Server/Ligyb/CureDiseaseInfection.cs rename to Content.Server/_Sunrise/Disease/CureDiseaseInfection.cs diff --git a/Content.Server/Ligyb/DiseaseImmuneClothingSystem.cs b/Content.Server/_Sunrise/Disease/DiseaseImmuneClothingSystem.cs similarity index 100% rename from Content.Server/Ligyb/DiseaseImmuneClothingSystem.cs rename to Content.Server/_Sunrise/Disease/DiseaseImmuneClothingSystem.cs diff --git a/Content.Server/Ligyb/DiseaseRoleSystem.cs b/Content.Server/_Sunrise/Disease/DiseaseRoleSystem.cs similarity index 100% rename from Content.Server/Ligyb/DiseaseRoleSystem.cs rename to Content.Server/_Sunrise/Disease/DiseaseRoleSystem.cs diff --git a/Content.Server/Ligyb/MinimumBleedComponent.cs b/Content.Server/_Sunrise/Disease/MinimumBleedComponent.cs similarity index 100% rename from Content.Server/Ligyb/MinimumBleedComponent.cs rename to Content.Server/_Sunrise/Disease/MinimumBleedComponent.cs diff --git a/Content.Server/Ligyb/MinimumBleedSystem.cs b/Content.Server/_Sunrise/Disease/MinimumBleedSystem.cs similarity index 100% rename from Content.Server/Ligyb/MinimumBleedSystem.cs rename to Content.Server/_Sunrise/Disease/MinimumBleedSystem.cs diff --git a/Content.Server/Ligyb/SickSystem.cs b/Content.Server/_Sunrise/Disease/SickSystem.cs similarity index 100% rename from Content.Server/Ligyb/SickSystem.cs rename to Content.Server/_Sunrise/Disease/SickSystem.cs diff --git a/Content.Server/Ligyb/SleepyComponent.cs b/Content.Server/_Sunrise/Disease/SleepyComponent.cs similarity index 100% rename from Content.Server/Ligyb/SleepyComponent.cs rename to Content.Server/_Sunrise/Disease/SleepyComponent.cs diff --git a/Content.Server/Ligyb/SleepySystem.cs b/Content.Server/_Sunrise/Disease/SleepySystem.cs similarity index 100% rename from Content.Server/Ligyb/SleepySystem.cs rename to Content.Server/_Sunrise/Disease/SleepySystem.cs diff --git a/Content.Server/Ligyb/VaccinatorSystem.cs b/Content.Server/_Sunrise/Disease/VaccinatorSystem.cs similarity index 100% rename from Content.Server/Ligyb/VaccinatorSystem.cs rename to Content.Server/_Sunrise/Disease/VaccinatorSystem.cs diff --git a/Content.Shared/Ligyb/DiseaseImmuneClothingComponent.cs b/Content.Shared/_Sunrise/Disease/DiseaseImmuneClothingComponent.cs similarity index 100% rename from Content.Shared/Ligyb/DiseaseImmuneClothingComponent.cs rename to Content.Shared/_Sunrise/Disease/DiseaseImmuneClothingComponent.cs diff --git a/Content.Shared/Ligyb/DiseaseImmuneComponent.cs b/Content.Shared/_Sunrise/Disease/DiseaseImmuneComponent.cs similarity index 100% rename from Content.Shared/Ligyb/DiseaseImmuneComponent.cs rename to Content.Shared/_Sunrise/Disease/DiseaseImmuneComponent.cs diff --git a/Content.Shared/Ligyb/DiseaseRoleComponent.cs b/Content.Shared/_Sunrise/Disease/DiseaseRoleComponent.cs similarity index 100% rename from Content.Shared/Ligyb/DiseaseRoleComponent.cs rename to Content.Shared/_Sunrise/Disease/DiseaseRoleComponent.cs diff --git a/Content.Shared/Ligyb/DiseaseTempImmuneComponent.cs b/Content.Shared/_Sunrise/Disease/DiseaseTempImmuneComponent.cs similarity index 100% rename from Content.Shared/Ligyb/DiseaseTempImmuneComponent.cs rename to Content.Shared/_Sunrise/Disease/DiseaseTempImmuneComponent.cs diff --git a/Content.Shared/Ligyb/DiseaseVaccineTimerComponent.cs b/Content.Shared/_Sunrise/Disease/DiseaseVaccineTimerComponent.cs similarity index 100% rename from Content.Shared/Ligyb/DiseaseVaccineTimerComponent.cs rename to Content.Shared/_Sunrise/Disease/DiseaseVaccineTimerComponent.cs diff --git a/Content.Shared/Ligyb/DiseaseVaccineTimerSystem.cs b/Content.Shared/_Sunrise/Disease/DiseaseVaccineTimerSystem.cs similarity index 100% rename from Content.Shared/Ligyb/DiseaseVaccineTimerSystem.cs rename to Content.Shared/_Sunrise/Disease/DiseaseVaccineTimerSystem.cs diff --git a/Content.Shared/Ligyb/InfectEvent.cs b/Content.Shared/_Sunrise/Disease/InfectEvent.cs similarity index 100% rename from Content.Shared/Ligyb/InfectEvent.cs rename to Content.Shared/_Sunrise/Disease/InfectEvent.cs diff --git a/Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs b/Content.Shared/_Sunrise/Disease/SharedDiseaseRoleSystem.cs similarity index 100% rename from Content.Shared/Ligyb/SharedDiseaseRoleSystem.cs rename to Content.Shared/_Sunrise/Disease/SharedDiseaseRoleSystem.cs diff --git a/Content.Shared/Ligyb/SharedSickSystem.cs b/Content.Shared/_Sunrise/Disease/SharedSickSystem.cs similarity index 100% rename from Content.Shared/Ligyb/SharedSickSystem.cs rename to Content.Shared/_Sunrise/Disease/SharedSickSystem.cs diff --git a/Content.Shared/Ligyb/SharedVaccinatorSystem.cs b/Content.Shared/_Sunrise/Disease/SharedVaccinatorSystem.cs similarity index 100% rename from Content.Shared/Ligyb/SharedVaccinatorSystem.cs rename to Content.Shared/_Sunrise/Disease/SharedVaccinatorSystem.cs diff --git a/Content.Shared/Ligyb/SickComponent.cs b/Content.Shared/_Sunrise/Disease/SickComponent.cs similarity index 100% rename from Content.Shared/Ligyb/SickComponent.cs rename to Content.Shared/_Sunrise/Disease/SickComponent.cs diff --git a/Content.Shared/Ligyb/SpeedModifierOnComponent.cs b/Content.Shared/_Sunrise/Disease/SpeedModifierOnComponent.cs similarity index 100% rename from Content.Shared/Ligyb/SpeedModifierOnComponent.cs rename to Content.Shared/_Sunrise/Disease/SpeedModifierOnComponent.cs diff --git a/Content.Shared/Ligyb/SpeedModifierOnSystem.cs b/Content.Shared/_Sunrise/Disease/SpeedModifierOnSystem.cs similarity index 100% rename from Content.Shared/Ligyb/SpeedModifierOnSystem.cs rename to Content.Shared/_Sunrise/Disease/SpeedModifierOnSystem.cs diff --git a/Content.Shared/Ligyb/VaccinatorComponent.cs b/Content.Shared/_Sunrise/Disease/VaccinatorComponent.cs similarity index 100% rename from Content.Shared/Ligyb/VaccinatorComponent.cs rename to Content.Shared/_Sunrise/Disease/VaccinatorComponent.cs From 45089d0785a8ec6346aef0db5d9be2804c5bd295 Mon Sep 17 00:00:00 2001 From: Lgibb18 <65973111+Lgibb18@users.noreply.github.com> Date: Mon, 12 Aug 2024 16:52:02 +0500 Subject: [PATCH 11/13] =?UTF-8?q?=D1=81=D0=B0=D0=BD=D1=80=D0=B0=D0=B9?= =?UTF-8?q?=D0=B7=D0=BE=D1=82=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D1=82=D0=BE=D1=82=D0=B8=D0=BF=D0=BE=D0=B2,=20?= =?UTF-8?q?=D1=81=D0=BF=D0=B0=D0=B2=D0=BD=20=D0=B1=D0=BE=D0=BB=D0=B5=D0=B7?= =?UTF-8?q?=D0=BD=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{Ligyb => _Sunrise}/Disease/Actions.yml | 0 .../{Ligyb => _Sunrise}/Disease/DiseaseRole.yml | 0 .../{Ligyb => _Sunrise}/Disease/Emotes/AutoEmotes.yml | 0 .../{Ligyb => _Sunrise}/Disease/Emotes/Emotes.yml | 0 .../{Ligyb => _Sunrise}/Disease/Store/Actions.yml | 0 .../{Ligyb => _Sunrise}/Disease/Store/Categories.yml | 0 .../{Ligyb => _Sunrise}/Disease/Store/Listings.yml | 0 Resources/Prototypes/_Sunrise/Disease/events.yml | 11 +++++++++++ .../Vaccine/Reactions/BloodToVaccine.yml | 0 .../Vaccine/Reactions/Centrifuge.yml | 0 .../Vaccine/Reactions/VaccinatorInspect.yml | 0 .../Vaccine/Reactions/VaccineCreate.yml | 0 .../{Ligyb => _Sunrise}/Vaccine/Reagents/blood.yml | 0 .../{Ligyb => _Sunrise}/Vaccine/Reagents/vaccine.yml | 0 14 files changed, 11 insertions(+) rename Resources/Prototypes/{Ligyb => _Sunrise}/Disease/Actions.yml (100%) rename Resources/Prototypes/{Ligyb => _Sunrise}/Disease/DiseaseRole.yml (100%) rename Resources/Prototypes/{Ligyb => _Sunrise}/Disease/Emotes/AutoEmotes.yml (100%) rename Resources/Prototypes/{Ligyb => _Sunrise}/Disease/Emotes/Emotes.yml (100%) rename Resources/Prototypes/{Ligyb => _Sunrise}/Disease/Store/Actions.yml (100%) rename Resources/Prototypes/{Ligyb => _Sunrise}/Disease/Store/Categories.yml (100%) rename Resources/Prototypes/{Ligyb => _Sunrise}/Disease/Store/Listings.yml (100%) create mode 100644 Resources/Prototypes/_Sunrise/Disease/events.yml rename Resources/Prototypes/{Ligyb => _Sunrise}/Vaccine/Reactions/BloodToVaccine.yml (100%) rename Resources/Prototypes/{Ligyb => _Sunrise}/Vaccine/Reactions/Centrifuge.yml (100%) rename Resources/Prototypes/{Ligyb => _Sunrise}/Vaccine/Reactions/VaccinatorInspect.yml (100%) rename Resources/Prototypes/{Ligyb => _Sunrise}/Vaccine/Reactions/VaccineCreate.yml (100%) rename Resources/Prototypes/{Ligyb => _Sunrise}/Vaccine/Reagents/blood.yml (100%) rename Resources/Prototypes/{Ligyb => _Sunrise}/Vaccine/Reagents/vaccine.yml (100%) diff --git a/Resources/Prototypes/Ligyb/Disease/Actions.yml b/Resources/Prototypes/_Sunrise/Disease/Actions.yml similarity index 100% rename from Resources/Prototypes/Ligyb/Disease/Actions.yml rename to Resources/Prototypes/_Sunrise/Disease/Actions.yml diff --git a/Resources/Prototypes/Ligyb/Disease/DiseaseRole.yml b/Resources/Prototypes/_Sunrise/Disease/DiseaseRole.yml similarity index 100% rename from Resources/Prototypes/Ligyb/Disease/DiseaseRole.yml rename to Resources/Prototypes/_Sunrise/Disease/DiseaseRole.yml diff --git a/Resources/Prototypes/Ligyb/Disease/Emotes/AutoEmotes.yml b/Resources/Prototypes/_Sunrise/Disease/Emotes/AutoEmotes.yml similarity index 100% rename from Resources/Prototypes/Ligyb/Disease/Emotes/AutoEmotes.yml rename to Resources/Prototypes/_Sunrise/Disease/Emotes/AutoEmotes.yml diff --git a/Resources/Prototypes/Ligyb/Disease/Emotes/Emotes.yml b/Resources/Prototypes/_Sunrise/Disease/Emotes/Emotes.yml similarity index 100% rename from Resources/Prototypes/Ligyb/Disease/Emotes/Emotes.yml rename to Resources/Prototypes/_Sunrise/Disease/Emotes/Emotes.yml diff --git a/Resources/Prototypes/Ligyb/Disease/Store/Actions.yml b/Resources/Prototypes/_Sunrise/Disease/Store/Actions.yml similarity index 100% rename from Resources/Prototypes/Ligyb/Disease/Store/Actions.yml rename to Resources/Prototypes/_Sunrise/Disease/Store/Actions.yml diff --git a/Resources/Prototypes/Ligyb/Disease/Store/Categories.yml b/Resources/Prototypes/_Sunrise/Disease/Store/Categories.yml similarity index 100% rename from Resources/Prototypes/Ligyb/Disease/Store/Categories.yml rename to Resources/Prototypes/_Sunrise/Disease/Store/Categories.yml diff --git a/Resources/Prototypes/Ligyb/Disease/Store/Listings.yml b/Resources/Prototypes/_Sunrise/Disease/Store/Listings.yml similarity index 100% rename from Resources/Prototypes/Ligyb/Disease/Store/Listings.yml rename to Resources/Prototypes/_Sunrise/Disease/Store/Listings.yml diff --git a/Resources/Prototypes/_Sunrise/Disease/events.yml b/Resources/Prototypes/_Sunrise/Disease/events.yml new file mode 100644 index 00000000000..328e07a63aa --- /dev/null +++ b/Resources/Prototypes/_Sunrise/Disease/events.yml @@ -0,0 +1,11 @@ +- type: entity + parent: BaseGameRule + id: DiseaseSpawn + categories: [ HideSpawnMenu ] + components: + - type: StationEvent + minimumPlayers: 40 + weight: 10 + duration: 1 + - type: LateJoinSpawnRule + prototype: MobDisease diff --git a/Resources/Prototypes/Ligyb/Vaccine/Reactions/BloodToVaccine.yml b/Resources/Prototypes/_Sunrise/Vaccine/Reactions/BloodToVaccine.yml similarity index 100% rename from Resources/Prototypes/Ligyb/Vaccine/Reactions/BloodToVaccine.yml rename to Resources/Prototypes/_Sunrise/Vaccine/Reactions/BloodToVaccine.yml diff --git a/Resources/Prototypes/Ligyb/Vaccine/Reactions/Centrifuge.yml b/Resources/Prototypes/_Sunrise/Vaccine/Reactions/Centrifuge.yml similarity index 100% rename from Resources/Prototypes/Ligyb/Vaccine/Reactions/Centrifuge.yml rename to Resources/Prototypes/_Sunrise/Vaccine/Reactions/Centrifuge.yml diff --git a/Resources/Prototypes/Ligyb/Vaccine/Reactions/VaccinatorInspect.yml b/Resources/Prototypes/_Sunrise/Vaccine/Reactions/VaccinatorInspect.yml similarity index 100% rename from Resources/Prototypes/Ligyb/Vaccine/Reactions/VaccinatorInspect.yml rename to Resources/Prototypes/_Sunrise/Vaccine/Reactions/VaccinatorInspect.yml diff --git a/Resources/Prototypes/Ligyb/Vaccine/Reactions/VaccineCreate.yml b/Resources/Prototypes/_Sunrise/Vaccine/Reactions/VaccineCreate.yml similarity index 100% rename from Resources/Prototypes/Ligyb/Vaccine/Reactions/VaccineCreate.yml rename to Resources/Prototypes/_Sunrise/Vaccine/Reactions/VaccineCreate.yml diff --git a/Resources/Prototypes/Ligyb/Vaccine/Reagents/blood.yml b/Resources/Prototypes/_Sunrise/Vaccine/Reagents/blood.yml similarity index 100% rename from Resources/Prototypes/Ligyb/Vaccine/Reagents/blood.yml rename to Resources/Prototypes/_Sunrise/Vaccine/Reagents/blood.yml diff --git a/Resources/Prototypes/Ligyb/Vaccine/Reagents/vaccine.yml b/Resources/Prototypes/_Sunrise/Vaccine/Reagents/vaccine.yml similarity index 100% rename from Resources/Prototypes/Ligyb/Vaccine/Reagents/vaccine.yml rename to Resources/Prototypes/_Sunrise/Vaccine/Reagents/vaccine.yml From f3642ad221ac7f36f7ab16283e99b4b73d90557e Mon Sep 17 00:00:00 2001 From: Lgibb18 <65973111+Lgibb18@users.noreply.github.com> Date: Mon, 12 Aug 2024 18:20:22 +0500 Subject: [PATCH 12/13] =?UTF-8?q?=D0=B5=D1=89=D1=91=20=D0=B2=D1=81=D1=8F?= =?UTF-8?q?=D0=BA=D0=B0=D1=8F=20=D1=85=D1=80=D0=B5=D0=BD=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_Sunrise/Disease/DiseaseRoleSystem.cs | 6 ++-- Content.Client/_Sunrise/Disease/SickSystem.cs | 7 ++-- .../_Sunrise/Disease/CureDiseaseInfection.cs | 2 +- .../Disease/DiseaseImmuneClothingSystem.cs | 6 ++-- .../_Sunrise/Disease/DiseaseRoleSystem.cs | 21 ++++++++--- .../_Sunrise/Disease/DiseaseRuleComponent.cs | 7 ++++ .../_Sunrise/Disease/MinimumBleedComponent.cs | 2 +- .../_Sunrise/Disease/MinimumBleedSystem.cs | 6 ++-- Content.Server/_Sunrise/Disease/SickSystem.cs | 35 ++++++++++++------- .../Disease/DiseaseImmuneClothingComponent.cs | 2 +- .../Disease/DiseaseImmuneComponent.cs | 2 +- .../_Sunrise/Disease/DiseaseRoleComponent.cs | 2 +- .../Disease/DiseaseTempImmuneComponent.cs | 2 +- .../Disease/DiseaseVaccineTimerComponent.cs | 2 +- .../Disease/DiseaseVaccineTimerSystem.cs | 2 +- .../_Sunrise/Disease/InfectEvent.cs | 2 +- .../Disease/SharedDiseaseRoleSystem.cs | 2 +- .../_Sunrise/Disease/SharedSickSystem.cs | 6 ++-- .../_Sunrise/Disease/SickComponent.cs | 2 +- .../{ligyb => _sunrise}/disease/disease.ftl | 6 ++-- .../{ligyb => _sunrise}/disease/shop.ftl | 0 .../{ligyb => _sunrise/disease}/vaccine.ftl | 0 .../_Sunrise/Disease/DiseaseRole.yml | 13 +++++-- .../_Sunrise/Disease/Store/Listings.yml | 2 +- .../Prototypes/_Sunrise/Disease/events.yml | 5 ++- .../_Sunrise/Disease/roundstart.yml | 6 ++++ 26 files changed, 98 insertions(+), 50 deletions(-) create mode 100644 Content.Server/_Sunrise/Disease/DiseaseRuleComponent.cs rename Resources/Locale/ru-RU/{ligyb => _sunrise}/disease/disease.ftl (67%) rename Resources/Locale/ru-RU/{ligyb => _sunrise}/disease/shop.ftl (100%) rename Resources/Locale/ru-RU/{ligyb => _sunrise/disease}/vaccine.ftl (100%) create mode 100644 Resources/Prototypes/_Sunrise/Disease/roundstart.yml diff --git a/Content.Client/_Sunrise/Disease/DiseaseRoleSystem.cs b/Content.Client/_Sunrise/Disease/DiseaseRoleSystem.cs index 6300c63db37..dede9bc65a1 100644 --- a/Content.Client/_Sunrise/Disease/DiseaseRoleSystem.cs +++ b/Content.Client/_Sunrise/Disease/DiseaseRoleSystem.cs @@ -1,6 +1,6 @@ using Content.Shared.Humanoid; -using Content.Shared.Ligyb; -namespace Content.Client.Ligyb; +using Content.Shared._Sunrise.Disease; +namespace Content.Client._Sunrise.Disease; public sealed class DiseaseRoleSystem : EntitySystem { @@ -24,7 +24,7 @@ private void OnInfect(ClientInfectEvent ev) var sick = EnsureComp(target); sick.owner = performer; sick.Inited = true; - if(TryComp(performer, out var comp)) + if (TryComp(performer, out var comp)) { comp.Infected.Add(target); } diff --git a/Content.Client/_Sunrise/Disease/SickSystem.cs b/Content.Client/_Sunrise/Disease/SickSystem.cs index 2baa2df2575..6cc44aadfa9 100644 --- a/Content.Client/_Sunrise/Disease/SickSystem.cs +++ b/Content.Client/_Sunrise/Disease/SickSystem.cs @@ -6,8 +6,9 @@ using Content.Shared.StatusIcon.Components; using Robust.Client.Player; using Robust.Shared.Prototypes; -using Content.Shared.Ligyb; -namespace Content.Client.Ligyb; +using Content.Shared._Sunrise.Disease; +using Content.Shared.Ghost; +namespace Content.Client._Sunrise.Disease; public sealed class SickSystem : EntitySystem { [Dependency] private readonly IPrototypeManager _prototype = default!; @@ -32,7 +33,7 @@ private void OnGetStatusIcon(EntityUid uid, SickComponent component, ref GetStat { if (_playerManager.LocalEntity != null) { - if (HasComp(_playerManager.LocalEntity.Value)) + if (HasComp(_playerManager.LocalEntity.Value) || HasComp(_playerManager.LocalEntity.Value)) { if (!_mobState.IsDead(uid) && !HasComp(uid) && diff --git a/Content.Server/_Sunrise/Disease/CureDiseaseInfection.cs b/Content.Server/_Sunrise/Disease/CureDiseaseInfection.cs index 06cd95d18b5..082747bc85c 100644 --- a/Content.Server/_Sunrise/Disease/CureDiseaseInfection.cs +++ b/Content.Server/_Sunrise/Disease/CureDiseaseInfection.cs @@ -1,7 +1,7 @@ // © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Shared.Chemistry.Reagent; using Robust.Shared.Prototypes; -using Content.Shared.Ligyb; +using Content.Shared._Sunrise.Disease; using Content.Shared.EntityEffects; public sealed partial class CureDiseaseInfection : EntityEffect { diff --git a/Content.Server/_Sunrise/Disease/DiseaseImmuneClothingSystem.cs b/Content.Server/_Sunrise/Disease/DiseaseImmuneClothingSystem.cs index df3213054fc..d3a826593b4 100644 --- a/Content.Server/_Sunrise/Disease/DiseaseImmuneClothingSystem.cs +++ b/Content.Server/_Sunrise/Disease/DiseaseImmuneClothingSystem.cs @@ -1,11 +1,11 @@ // © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Shared.Clothing.Components; using Content.Shared.Inventory.Events; -using Content.Shared.Ligyb; +using Content.Shared._Sunrise.Disease; using Content.Shared.Examine; using Content.Shared.Verbs; using Robust.Shared.Utility; -namespace Content.Server.Ligyb; +namespace Content.Server._Sunrise.Disease; public sealed class DiseaseImmuneClothingSystem : EntitySystem { @@ -49,7 +49,7 @@ private void OnArmorVerbExamine(EntityUid uid, DiseaseImmuneClothingComponent co return; var examineMarkup = new FormattedMessage(); - examineMarkup.TryAddMarkup($"Защищает от заражения на {Convert.ToInt32(component.Prob*100)}%", out var _); + 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/_Sunrise/Disease/DiseaseRoleSystem.cs b/Content.Server/_Sunrise/Disease/DiseaseRoleSystem.cs index 50056b0b33c..7bef3047345 100644 --- a/Content.Server/_Sunrise/Disease/DiseaseRoleSystem.cs +++ b/Content.Server/_Sunrise/Disease/DiseaseRoleSystem.cs @@ -1,14 +1,17 @@ // © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Shared.Actions; using Robust.Shared.Random; -using Content.Shared.Ligyb; +using Content.Shared._Sunrise.Disease; using Content.Server.Store.Components; using Content.Server.Store.Systems; using Robust.Shared.Prototypes; using Content.Shared.FixedPoint; using Content.Shared.Popups; using Content.Shared.Store.Components; -namespace Content.Server.Ligyb; +using Content.Server.Objectives; +using Content.Server.Objectives.Components; +using Content.Server.Objectives.Systems; +namespace Content.Server._Sunrise.Disease; public sealed class DiseaseRoleSystem : SharedDiseaseRoleSystem { @@ -34,6 +37,13 @@ public override void Initialize() SubscribeLocalEvent(OnCoughChance); SubscribeLocalEvent(OnLethal); SubscribeLocalEvent(OnShield); + SubscribeLocalEvent(OnObjectivesTextGetInfo); + } + + private void OnObjectivesTextGetInfo(EntityUid uid, DiseaseRuleComponent comp, ref ObjectivesTextGetInfoEvent args) + { + args.Minds = comp.DiseasesMinds; + args.AgentName = "разумная болезнь"; } @@ -129,7 +139,7 @@ private void OnInit(EntityUid uid, DiseaseRoleComponent component, ComponentInit private void OnMapInit(EntityUid uid, DiseaseRoleComponent component, MapInitEvent args) { - _actionsSystem.AddAction(uid, DiseaseShopId); + _actionsSystem.AddAction(uid, DiseaseShopId, uid); } private void OnShop(EntityUid uid, DiseaseRoleComponent component, DiseaseShopActionEvent args) @@ -180,7 +190,10 @@ bool TryRemoveMoney(EntityUid uid, FixedPoint2 value) private void OnAddSymptom(EntityUid uid, DiseaseRoleComponent component, DiseaseAddSymptomEvent args) { - component.Symptoms.Add(args.Symptom, (args.MinLevel, args.MaxLevel)); + if (!component.Symptoms.ContainsKey(args.Symptom)) + { + component.Symptoms.Add(args.Symptom, (args.MinLevel, args.MaxLevel)); + } _actionsSystem.RemoveAction(uid, args.Action); } diff --git a/Content.Server/_Sunrise/Disease/DiseaseRuleComponent.cs b/Content.Server/_Sunrise/Disease/DiseaseRuleComponent.cs new file mode 100644 index 00000000000..8031ee0f3e6 --- /dev/null +++ b/Content.Server/_Sunrise/Disease/DiseaseRuleComponent.cs @@ -0,0 +1,7 @@ +namespace Content.Server._Sunrise.Disease; + +[RegisterComponent, Access(typeof(DiseaseRoleSystem))] +public sealed partial class DiseaseRuleComponent : Component +{ + public List<(EntityUid, string)> DiseasesMinds = new(); +} diff --git a/Content.Server/_Sunrise/Disease/MinimumBleedComponent.cs b/Content.Server/_Sunrise/Disease/MinimumBleedComponent.cs index f674e76739b..2c7e4859677 100644 --- a/Content.Server/_Sunrise/Disease/MinimumBleedComponent.cs +++ b/Content.Server/_Sunrise/Disease/MinimumBleedComponent.cs @@ -3,7 +3,7 @@ using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; -namespace Content.Server.Ligyb; +namespace Content.Server._Sunrise.Disease; [RegisterComponent] public sealed partial class MinimumBleedComponent : Component diff --git a/Content.Server/_Sunrise/Disease/MinimumBleedSystem.cs b/Content.Server/_Sunrise/Disease/MinimumBleedSystem.cs index c23b9b7dda2..51db5b6b79e 100644 --- a/Content.Server/_Sunrise/Disease/MinimumBleedSystem.cs +++ b/Content.Server/_Sunrise/Disease/MinimumBleedSystem.cs @@ -1,6 +1,6 @@ // © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Robust.Shared.Configuration; -namespace Content.Server.Ligyb; +namespace Content.Server._Sunrise.Disease; using Robust.Shared.Prototypes; using Robust.Shared.Timing; using Content.Server.Body.Components; @@ -30,9 +30,9 @@ public override void Update(float frameTime) var query = EntityQueryEnumerator(); while (query.MoveNext(out var uid, out var component)) { - if(TryComp(uid, out var blood)) + if (TryComp(uid, out var blood)) { - if(blood.BleedAmount < component.MinValue) + if (blood.BleedAmount < component.MinValue) { _bloodstream.TryModifyBleedAmount(uid, component.MinValue, blood); } diff --git a/Content.Server/_Sunrise/Disease/SickSystem.cs b/Content.Server/_Sunrise/Disease/SickSystem.cs index 8293280de2d..756037f4d5e 100644 --- a/Content.Server/_Sunrise/Disease/SickSystem.cs +++ b/Content.Server/_Sunrise/Disease/SickSystem.cs @@ -1,7 +1,7 @@ // © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Robust.Shared.Prototypes; using Robust.Shared.Timing; -using Content.Shared.Ligyb; +using Content.Shared._Sunrise.Disease; using System.Numerics; using Content.Server.Body.Components; using Content.Server.Body.Systems; @@ -29,7 +29,7 @@ using Content.Shared.Item; using Content.Shared.Speech.Muting; using Content.Shared.Store.Components; -namespace Content.Server.Ligyb; +namespace Content.Server._Sunrise.Disease; public sealed class SickSystem : SharedSickSystem { [Dependency] private readonly AutoEmoteSystem _autoEmote = default!; @@ -43,6 +43,7 @@ public sealed class SickSystem : SharedSickSystem [Dependency] private readonly DamageableSystem _damageableSystem = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly SharedStunSystem _stun = default!; + [Dependency] private readonly SharedPopupSystem _popup = default!; private EntityLookupSystem _lookup => _entityManager.System(); public override void Initialize() { @@ -227,7 +228,7 @@ private void OnEmote(EntityUid uid, SickComponent component, ref EmoteEvent args { if (args.Handled) return; - args.Handled = true; + if (!component.Symptoms.Contains(args.Emote.ID)) return; switch (args.Emote.ID) { case "Headache": @@ -243,13 +244,16 @@ private void OnEmote(EntityUid uid, SickComponent component, ref EmoteEvent args { _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)) + + foreach (var entity in _lookup.GetEntitiesInRange(uid, 0.7f)) { - OnInfected(entity, component.owner, Comp(component.owner).CoughInfectChance); + if (_robustRandom.Prob(disease.CoughInfectChance)) + { + if (HasComp(entity) && !HasComp(entity) && !HasComp(entity)) + { + OnInfected(entity, component.owner, Comp(component.owner).CoughInfectChance); + } + } } } } @@ -257,12 +261,17 @@ private void OnEmote(EntityUid uid, SickComponent component, ref EmoteEvent args case "Sneeze": if (_robustRandom.Prob(0.9f)) { - EntityCoordinates start = Transform(uid).Coordinates; - foreach (var entity in _lookup.GetEntitiesInRange(uid, 1.2f)) + if (TryComp(component.owner, out var disease)) { - if (HasComp(entity) && !HasComp(entity) && !HasComp(entity)) + foreach (var entity in _lookup.GetEntitiesInRange(uid, 1.2f)) { - OnInfected(entity, component.owner, Comp(component.owner).CoughInfectChance); + if (_robustRandom.Prob(disease.CoughInfectChance)) + { + if (HasComp(entity) && !HasComp(entity) && !HasComp(entity)) + { + OnInfected(entity, component.owner, Comp(component.owner).CoughInfectChance); + } + } } } } diff --git a/Content.Shared/_Sunrise/Disease/DiseaseImmuneClothingComponent.cs b/Content.Shared/_Sunrise/Disease/DiseaseImmuneClothingComponent.cs index 3f942d294d4..c2018ac9cf9 100644 --- a/Content.Shared/_Sunrise/Disease/DiseaseImmuneClothingComponent.cs +++ b/Content.Shared/_Sunrise/Disease/DiseaseImmuneClothingComponent.cs @@ -1,5 +1,5 @@ // © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt -namespace Content.Shared.Ligyb; +namespace Content.Shared._Sunrise.Disease; [RegisterComponent] public sealed partial class DiseaseImmuneClothingComponent : Component diff --git a/Content.Shared/_Sunrise/Disease/DiseaseImmuneComponent.cs b/Content.Shared/_Sunrise/Disease/DiseaseImmuneComponent.cs index 44b4d56f52b..a15cc3053e6 100644 --- a/Content.Shared/_Sunrise/Disease/DiseaseImmuneComponent.cs +++ b/Content.Shared/_Sunrise/Disease/DiseaseImmuneComponent.cs @@ -1,5 +1,5 @@ // © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt -namespace Content.Shared.Ligyb; +namespace Content.Shared._Sunrise.Disease; [RegisterComponent] public sealed partial class DiseaseImmuneComponent : Component diff --git a/Content.Shared/_Sunrise/Disease/DiseaseRoleComponent.cs b/Content.Shared/_Sunrise/Disease/DiseaseRoleComponent.cs index 555a40075f6..4752abcffc1 100644 --- a/Content.Shared/_Sunrise/Disease/DiseaseRoleComponent.cs +++ b/Content.Shared/_Sunrise/Disease/DiseaseRoleComponent.cs @@ -4,7 +4,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Content.Shared.Store; using Content.Shared.Chemistry.Reagent; -namespace Content.Shared.Ligyb; +namespace Content.Shared._Sunrise.Disease; [RegisterComponent] public sealed partial class DiseaseRoleComponent : Component diff --git a/Content.Shared/_Sunrise/Disease/DiseaseTempImmuneComponent.cs b/Content.Shared/_Sunrise/Disease/DiseaseTempImmuneComponent.cs index c745f9ac86c..0e5ae794bbf 100644 --- a/Content.Shared/_Sunrise/Disease/DiseaseTempImmuneComponent.cs +++ b/Content.Shared/_Sunrise/Disease/DiseaseTempImmuneComponent.cs @@ -1,5 +1,5 @@ // © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt -namespace Content.Shared.Ligyb; +namespace Content.Shared._Sunrise.Disease; [RegisterComponent] public sealed partial class DiseaseTempImmuneComponent : Component diff --git a/Content.Shared/_Sunrise/Disease/DiseaseVaccineTimerComponent.cs b/Content.Shared/_Sunrise/Disease/DiseaseVaccineTimerComponent.cs index 3948a008677..26ede18b02c 100644 --- a/Content.Shared/_Sunrise/Disease/DiseaseVaccineTimerComponent.cs +++ b/Content.Shared/_Sunrise/Disease/DiseaseVaccineTimerComponent.cs @@ -1,5 +1,5 @@ // © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt -namespace Content.Shared.Ligyb; +namespace Content.Shared._Sunrise.Disease; [RegisterComponent] public sealed partial class DiseaseVaccineTimerComponent : Component diff --git a/Content.Shared/_Sunrise/Disease/DiseaseVaccineTimerSystem.cs b/Content.Shared/_Sunrise/Disease/DiseaseVaccineTimerSystem.cs index 0c63526cdfe..0eceeb571d8 100644 --- a/Content.Shared/_Sunrise/Disease/DiseaseVaccineTimerSystem.cs +++ b/Content.Shared/_Sunrise/Disease/DiseaseVaccineTimerSystem.cs @@ -1,5 +1,5 @@ // © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt -namespace Content.Shared.Ligyb; +namespace Content.Shared._Sunrise.Disease; using Robust.Shared.Timing; using Content.Shared.Movement.Components; using Content.Shared.Movement.Systems; diff --git a/Content.Shared/_Sunrise/Disease/InfectEvent.cs b/Content.Shared/_Sunrise/Disease/InfectEvent.cs index 62b9fef4fb0..33558368b37 100644 --- a/Content.Shared/_Sunrise/Disease/InfectEvent.cs +++ b/Content.Shared/_Sunrise/Disease/InfectEvent.cs @@ -2,7 +2,7 @@ using Content.Shared.Actions; using Robust.Shared.Serialization; using Content.Shared.Inventory; -namespace Content.Shared.Ligyb; +namespace Content.Shared._Sunrise.Disease; public sealed partial class InfectEvent : EntityTargetActionEvent { diff --git a/Content.Shared/_Sunrise/Disease/SharedDiseaseRoleSystem.cs b/Content.Shared/_Sunrise/Disease/SharedDiseaseRoleSystem.cs index 3680854566e..17402fd18a8 100644 --- a/Content.Shared/_Sunrise/Disease/SharedDiseaseRoleSystem.cs +++ b/Content.Shared/_Sunrise/Disease/SharedDiseaseRoleSystem.cs @@ -2,7 +2,7 @@ using Robust.Shared.Random; using Content.Shared.Humanoid; -namespace Content.Shared.Ligyb; +namespace Content.Shared._Sunrise.Disease; public abstract class SharedDiseaseRoleSystem : EntitySystem { diff --git a/Content.Shared/_Sunrise/Disease/SharedSickSystem.cs b/Content.Shared/_Sunrise/Disease/SharedSickSystem.cs index aefa2619192..8d8d6a70f3d 100644 --- a/Content.Shared/_Sunrise/Disease/SharedSickSystem.cs +++ b/Content.Shared/_Sunrise/Disease/SharedSickSystem.cs @@ -8,14 +8,14 @@ using Content.Shared.StatusIcon.Components; using Robust.Shared.Configuration; using Robust.Shared.Prototypes; -using Content.Shared.Ligyb; -namespace Content.Shared.Ligyb; +using Content.Shared._Sunrise.Disease; +namespace Content.Shared._Sunrise.Disease; 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 Content.Shared._Sunrise.Disease; using Robust.Shared.Random; public abstract class SharedSickSystem : EntitySystem { diff --git a/Content.Shared/_Sunrise/Disease/SickComponent.cs b/Content.Shared/_Sunrise/Disease/SickComponent.cs index 3efb7b5ac1e..5b9e78d8003 100644 --- a/Content.Shared/_Sunrise/Disease/SickComponent.cs +++ b/Content.Shared/_Sunrise/Disease/SickComponent.cs @@ -3,7 +3,7 @@ using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; -namespace Content.Shared.Ligyb; +namespace Content.Shared._Sunrise.Disease; [RegisterComponent] public sealed partial class SickComponent : Component diff --git a/Resources/Locale/ru-RU/ligyb/disease/disease.ftl b/Resources/Locale/ru-RU/_sunrise/disease/disease.ftl similarity index 67% rename from Resources/Locale/ru-RU/ligyb/disease/disease.ftl rename to Resources/Locale/ru-RU/_sunrise/disease/disease.ftl index ee476305438..63b0442089f 100644 --- a/Resources/Locale/ru-RU/ligyb/disease/disease.ftl +++ b/Resources/Locale/ru-RU/_sunrise/disease/disease.ftl @@ -1,7 +1,7 @@ -mob-name-disease = разумный вирус +mob-name-disease = Разумная болезнь mob-description-disease = plague inc 2.0 -ghostrole-disease-name = разумный вирус -ghostrole-disease-description = Обычный вирус, который вдруг решил стать разумным. С кем не бывает? +ghostrole-disease-name = разумная болезнь +ghostrole-disease-description = Обычная болезнь, которая вдруг решила стать разумной. С кем не бывает? action-disease-infect-name = Заразить [10 ОЭ] action-disease-infect-description = Попытка заразить существо [-10 очков эволюции]. Первые три попытки заражения не требуют очков эволюции. Выберите способность и нажмите ЛКМ по сущности, чтобы заразить. action-disease-shop-name = Мутация diff --git a/Resources/Locale/ru-RU/ligyb/disease/shop.ftl b/Resources/Locale/ru-RU/_sunrise/disease/shop.ftl similarity index 100% rename from Resources/Locale/ru-RU/ligyb/disease/shop.ftl rename to Resources/Locale/ru-RU/_sunrise/disease/shop.ftl diff --git a/Resources/Locale/ru-RU/ligyb/vaccine.ftl b/Resources/Locale/ru-RU/_sunrise/disease/vaccine.ftl similarity index 100% rename from Resources/Locale/ru-RU/ligyb/vaccine.ftl rename to Resources/Locale/ru-RU/_sunrise/disease/vaccine.ftl diff --git a/Resources/Prototypes/_Sunrise/Disease/DiseaseRole.yml b/Resources/Prototypes/_Sunrise/Disease/DiseaseRole.yml index 1b6013ab818..491965bdbf1 100644 --- a/Resources/Prototypes/_Sunrise/Disease/DiseaseRole.yml +++ b/Resources/Prototypes/_Sunrise/Disease/DiseaseRole.yml @@ -1,6 +1,6 @@ - type: entity id: MobDisease - name: Разумный вирус + name: разумная болезнь description: plague inc 2.0 components: - type: MindContainer @@ -49,9 +49,18 @@ makeSentient: true name: ghostrole-disease-name description: ghostrole-disease-description + requirements: + - !type:DepartmentTimeRequirement + department: Medical + time: 7200 #2 hrs + - !type:OverallPlaytimeRequirement + time: 18000 #5 hrs + raffle: + settings: default + - type: GhostTakeoverAvailable - type: PointLight - color: "#3A6041" + color: "#52964F" radius: 2 softness: 1 - type: UserInterface diff --git a/Resources/Prototypes/_Sunrise/Disease/Store/Listings.yml b/Resources/Prototypes/_Sunrise/Disease/Store/Listings.yml index fc9a06e76b4..ea58b11658f 100644 --- a/Resources/Prototypes/_Sunrise/Disease/Store/Listings.yml +++ b/Resources/Prototypes/_Sunrise/Disease/Store/Listings.yml @@ -6,7 +6,7 @@ raiseProductEventOnUser: true productAction: ActionDiseaseCough cost: - DiseasePoints: 15 + DiseasePoints: 0 categories: - DiseaseInfectCategory conditions: diff --git a/Resources/Prototypes/_Sunrise/Disease/events.yml b/Resources/Prototypes/_Sunrise/Disease/events.yml index 328e07a63aa..b5998d11696 100644 --- a/Resources/Prototypes/_Sunrise/Disease/events.yml +++ b/Resources/Prototypes/_Sunrise/Disease/events.yml @@ -5,7 +5,10 @@ components: - type: StationEvent minimumPlayers: 40 - weight: 10 + weight: 5 duration: 1 + earliestStart: 30 + reoccurrenceDelay: 20 - type: LateJoinSpawnRule prototype: MobDisease + diff --git a/Resources/Prototypes/_Sunrise/Disease/roundstart.yml b/Resources/Prototypes/_Sunrise/Disease/roundstart.yml new file mode 100644 index 00000000000..d707fc5504e --- /dev/null +++ b/Resources/Prototypes/_Sunrise/Disease/roundstart.yml @@ -0,0 +1,6 @@ +- type: entity + id: DiseaseRule + parent: BaseGameRule + categories: [ HideSpawnMenu ] + components: + - type: DiseaseRule From de54add0e1a7219126a31d18197949d2a0978c3d Mon Sep 17 00:00:00 2001 From: Lgibb18 <65973111+Lgibb18@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:25:57 +0500 Subject: [PATCH 13/13] =?UTF-8?q?=D1=84=D1=83=D1=83=20=D1=81=D1=82=D0=B0?= =?UTF-8?q?=D1=82=D0=B8=D1=81=D1=82=D0=B8=D0=BA=D0=B0=20=D0=B2=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BD=D1=86=D0=B5=20=D1=80=D0=B0=D1=83=D0=BD=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_Sunrise/Disease/DiseaseRoleSystem.cs | 33 +++++++++++++++++-- Content.Server/_Sunrise/Disease/SickSystem.cs | 1 + .../_Sunrise/Disease/DiseaseRoleComponent.cs | 2 ++ .../Locale/ru-RU/_sunrise/disease/disease.ftl | 5 +++ .../Prototypes/_Sunrise/Disease/events.yml | 3 +- Resources/Prototypes/game_presets.yml | 2 +- 6 files changed, 41 insertions(+), 5 deletions(-) diff --git a/Content.Server/_Sunrise/Disease/DiseaseRoleSystem.cs b/Content.Server/_Sunrise/Disease/DiseaseRoleSystem.cs index 7bef3047345..a03e1871fe3 100644 --- a/Content.Server/_Sunrise/Disease/DiseaseRoleSystem.cs +++ b/Content.Server/_Sunrise/Disease/DiseaseRoleSystem.cs @@ -2,15 +2,15 @@ using Content.Shared.Actions; using Robust.Shared.Random; using Content.Shared._Sunrise.Disease; -using Content.Server.Store.Components; using Content.Server.Store.Systems; using Robust.Shared.Prototypes; using Content.Shared.FixedPoint; using Content.Shared.Popups; using Content.Shared.Store.Components; using Content.Server.Objectives; -using Content.Server.Objectives.Components; -using Content.Server.Objectives.Systems; +using Content.Server.GameTicking; +using Content.Shared.Random.Helpers; + namespace Content.Server._Sunrise.Disease; public sealed class DiseaseRoleSystem : SharedDiseaseRoleSystem @@ -38,8 +38,35 @@ public override void Initialize() SubscribeLocalEvent(OnLethal); SubscribeLocalEvent(OnShield); SubscribeLocalEvent(OnObjectivesTextGetInfo); + SubscribeLocalEvent(OnRoundEndText); } + + private void OnRoundEndText(RoundEndTextAppendEvent ev) + { + var sick = EntityQueryEnumerator(); + var immune = EntityQueryEnumerator(); + var disease = EntityQueryEnumerator(); + int infected = 0; + int immuned = 0; + int infects = 0; + while (sick.MoveNext(out _)) + { + infects++; + } + while (immune.MoveNext(out _)) + { + immuned++; + } + while (disease.MoveNext(out var comp)) + { + infected = comp.SickOfAllTime; + } + ev.AddLine(Loc.GetString("disease-round-end-result")); + ev.AddLine(Loc.GetString("disease-round-end-result-infected", ("count", infected))); + ev.AddLine(Loc.GetString("disease-round-end-result-infects", ("count", infects))); + ev.AddLine(Loc.GetString("disease-round-end-result-immuned", ("count", immuned))); + } private void OnObjectivesTextGetInfo(EntityUid uid, DiseaseRuleComponent comp, ref ObjectivesTextGetInfoEvent args) { args.Minds = comp.DiseasesMinds; diff --git a/Content.Server/_Sunrise/Disease/SickSystem.cs b/Content.Server/_Sunrise/Disease/SickSystem.cs index 756037f4d5e..016e6d3f484 100644 --- a/Content.Server/_Sunrise/Disease/SickSystem.cs +++ b/Content.Server/_Sunrise/Disease/SickSystem.cs @@ -127,6 +127,7 @@ public override void Update(float frameTime) _bloodstream.ChangeBloodReagent(uid, diseaseComp.NewBloodReagent); RaiseNetworkEvent(new ClientInfectEvent(GetNetEntity(uid), GetNetEntity(component.owner))); + diseaseComp.SickOfAllTime++; AddMoney(uid, 5); component.Inited = true; diff --git a/Content.Shared/_Sunrise/Disease/DiseaseRoleComponent.cs b/Content.Shared/_Sunrise/Disease/DiseaseRoleComponent.cs index 4752abcffc1..81a567e310e 100644 --- a/Content.Shared/_Sunrise/Disease/DiseaseRoleComponent.cs +++ b/Content.Shared/_Sunrise/Disease/DiseaseRoleComponent.cs @@ -33,6 +33,8 @@ public sealed partial class DiseaseRoleComponent : Component [DataField] public int Lethal = 0; [DataField] public int Shield = 1; + [DataField] public int SickOfAllTime = 0; + [DataField("newBloodReagent", customTypeSerializer: typeof(PrototypeIdSerializer))] public string NewBloodReagent = "ZombieBlood"; } diff --git a/Resources/Locale/ru-RU/_sunrise/disease/disease.ftl b/Resources/Locale/ru-RU/_sunrise/disease/disease.ftl index 63b0442089f..50fc06422d9 100644 --- a/Resources/Locale/ru-RU/_sunrise/disease/disease.ftl +++ b/Resources/Locale/ru-RU/_sunrise/disease/disease.ftl @@ -6,3 +6,8 @@ action-disease-infect-name = Заразить [10 ОЭ] action-disease-infect-description = Попытка заразить существо [-10 очков эволюции]. Первые три попытки заражения не требуют очков эволюции. Выберите способность и нажмите ЛКМ по сущности, чтобы заразить. action-disease-shop-name = Мутация action-disease-shop-description = Открывает меню мутации + +disease-round-end-result = [color=green]На станции была разумная болезнь. Ей было:[/color] +disease-round-end-result-infected = Заражено: [color=gold]{ $count }[/color] +disease-round-end-result-infects = Заражённых в конце раунда: [color=gold]{ $count }[/color] +disease-round-end-result-immuned = Иммунитет был у [color=gold]{ $count }[/color] чел. diff --git a/Resources/Prototypes/_Sunrise/Disease/events.yml b/Resources/Prototypes/_Sunrise/Disease/events.yml index b5998d11696..b33170a839d 100644 --- a/Resources/Prototypes/_Sunrise/Disease/events.yml +++ b/Resources/Prototypes/_Sunrise/Disease/events.yml @@ -5,7 +5,8 @@ components: - type: StationEvent minimumPlayers: 40 - weight: 5 + weight: 10 + maxOccurrences: 1 duration: 1 earliestStart: 30 reoccurrenceDelay: 20 diff --git a/Resources/Prototypes/game_presets.yml b/Resources/Prototypes/game_presets.yml index 73a22ebfcf6..5112b4e7f90 100644 --- a/Resources/Prototypes/game_presets.yml +++ b/Resources/Prototypes/game_presets.yml @@ -179,4 +179,4 @@ - SubGamemodesRule - BasicStationEventScheduler - GameRuleMeteorScheduler - - BasicRoundstartVariation \ No newline at end of file + - BasicRoundstartVariation