diff --git a/Content.Server/Imperial/Medieval/Cult/CultCursedComponent.cs b/Content.Server/Imperial/Medieval/Cult/CultCursedComponent.cs index a8ecf9133a..086e930c60 100644 --- a/Content.Server/Imperial/Medieval/Cult/CultCursedComponent.cs +++ b/Content.Server/Imperial/Medieval/Cult/CultCursedComponent.cs @@ -11,6 +11,18 @@ public sealed partial class CultCursedComponent : Component [DataField] public ProtoId CurseAlert = "CultCurse"; + /// + /// должны ли при сдаче крови появляться кристаллы + /// + [DataField] + public bool GiveCrystals = true; + + /// + /// может ли привязанный потерять связь + /// + [DataField] + public bool CanLost = true; + [DataField] public float CurseLevel = 100f; diff --git a/Content.Server/Imperial/Medieval/Cult/CultSystem.cs b/Content.Server/Imperial/Medieval/Cult/CultSystem.cs index 0699bf1137..7498802b8a 100644 --- a/Content.Server/Imperial/Medieval/Cult/CultSystem.cs +++ b/Content.Server/Imperial/Medieval/Cult/CultSystem.cs @@ -117,11 +117,11 @@ private void OnBloodMeleeHit(EntityUid uid, CultBloodMeleeComponent component, M { if (!TryComp(args.User, out var cursed)) continue; if (entity != args.User) continue; + if (cursed.CurseLevel > 75 && !HasComp(cursed.Owner)) // спам сообщениями для культистов при телепортах ни к чему + _popupSystem.PopupEntity(Loc.GetString("medieval-cult-cursed-too-early"), cursed.Owner, cursed.Owner, PopupType.Small); if (cursed.CurseLevel > 75) - { - _chat.TrySendInGameICMessage(cursed.Owner, "Кровь культу была отдана совсем недавно, больше ее пока не нужно, надо подождать", InGameICChatType.Whisper, false); return; - } + var xform = Transform(entity); var coords = xform.Coordinates; foreach (var target in _lookup.GetEntitiesInRange(coords, 2.5f)) @@ -135,6 +135,10 @@ private void OnBloodMeleeHit(EntityUid uid, CultBloodMeleeComponent component, M { cursed.RegenDamage.DamageDict[key] *= cursed.RegenMultiplier; } + + if (!cursed.GiveCrystals) + continue; + foreach (var altar in EntityManager.EntityQuery()) { var axform = Transform(altar.Owner); @@ -218,6 +222,10 @@ public override void Update(float frameTime) foreach (var cursed in EntityManager.EntityQuery()) { cursed.CurseLevel -= cursed.Rate; + + if (!cursed.CanLost) + cursed.CurseLevel = Math.Max(1f, cursed.CurseLevel); + if (cursed.CurseLevel < 0f) { cursed.CurseLevel = 0f; @@ -227,20 +235,29 @@ public override void Update(float frameTime) { _alertsSystem.ShowAlert(cursed.Owner, cursed.CurseAlert, (short)Math.Clamp(Math.Round(cursed.CurseLevel / cursed.MaxCurseLevel * 5.1f), 0, 5)); } - if (cursed.CurseLevel > 5f && cursed.CurseLevel < 24f) - { + + bool isValidDamage = TryComp(cursed.Owner, out var damage) && damage.TotalDamage < 100 && damage.TotalDamage > 5; + + if (cursed.CurseLevel > 60f && isValidDamage) + _damageableSystem.TryChangeDamage(cursed.Owner, -cursed.RegenDamage, true, false); + + if (cursed.CurseLevel > 0f && cursed.CurseLevel < 24f) _damageableSystem.TryChangeDamage(cursed.Owner, cursed.LostDamage, true, false); - _popupSystem.PopupEntity("Все ваше тело болит из-за того, что вы не поддерживаете зов культа. Терпеть?", cursed.Owner, cursed.Owner, PopupType.SmallCaution); + + if (cursed.CurseLevel > 60f && isValidDamage) + _popupSystem.PopupEntity(Loc.GetString("medieval-cult-cursed-heal"), cursed.Owner, cursed.Owner, PopupType.Small); + + if (HasComp(cursed.Owner) && cursed.CurseLevel > 0f && cursed.CurseLevel < 24f) + { + _popupSystem.PopupEntity(Loc.GetString("medieval-cult-cursed-low-cult-member"), cursed.Owner, cursed.Owner, PopupType.SmallCaution); } - if (cursed.CurseLevel > 0f && cursed.CurseLevel <= 5f) + else if (cursed.CurseLevel > 5f && cursed.CurseLevel < 24f) { - _damageableSystem.TryChangeDamage(cursed.Owner, cursed.LostDamage, true, false); - _popupSystem.PopupEntity("Еще немного, и связь с культом разорвется. Терпеть осталось недолго.", cursed.Owner, cursed.Owner, PopupType.SmallCaution); + _popupSystem.PopupEntity(Loc.GetString("medieval-cult-cursed-low"), cursed.Owner, cursed.Owner, PopupType.SmallCaution); } - if (cursed.CurseLevel > 60f && TryComp(cursed.Owner, out var damage) && damage.TotalDamage < 100 && damage.TotalDamage > 5) + else if (cursed.CurseLevel > 0f && cursed.CurseLevel <= 5f) { - _damageableSystem.TryChangeDamage(cursed.Owner, -cursed.RegenDamage, true, false); - _popupSystem.PopupEntity("Связь с культом восстанавливает твои раны", cursed.Owner, cursed.Owner, PopupType.Small); + _popupSystem.PopupEntity(Loc.GetString("medieval-cult-cursed-very-low"), cursed.Owner, cursed.Owner, PopupType.SmallCaution); } } diff --git a/Resources/Locale/ru-RU/Imperial/Medieval/cult.ftl b/Resources/Locale/ru-RU/Imperial/Medieval/cult.ftl new file mode 100644 index 0000000000..c0c84002aa --- /dev/null +++ b/Resources/Locale/ru-RU/Imperial/Medieval/cult.ftl @@ -0,0 +1,7 @@ +medieval-cult-cursed-too-early = Кровь культу была отдана совсем недавно, больше ее пока не нужно, надо подождать + +medieval-cult-cursed-heal = Связь с культом восстанавливает твои раны. +medieval-cult-cursed-low = Все ваше тело болит из-за того, что вы не поддерживаете зов культа. Терпеть? +medieval-cult-cursed-very-low = Еще немного, и связь с культом разорвется. Терпеть осталось недолго. + +medieval-cult-cursed-low-cult-member = Все ваше тело болит из-за того, что вы не поддерживаете зов культа. Сдайте кровь у алтаря! diff --git a/Resources/Prototypes/Imperial/Medieval/jobs.yml b/Resources/Prototypes/Imperial/Medieval/jobs.yml index 263179da92..88c4c867c6 100644 --- a/Resources/Prototypes/Imperial/Medieval/jobs.yml +++ b/Resources/Prototypes/Imperial/Medieval/jobs.yml @@ -5115,23 +5115,9 @@ personJob: "[color=red]Культист[/color]" pasport: no jobPrefix: "[Культ]" - - type: PassiveDamage # Этот компонент имитирует лечение от связи с культом (CultCursedComponent) + стандартное пассивное лечение - allowedStates: - - Alive - damageCap: 100 - damage: - types: - Asphyxiation: -0.11 - Bloodloss: -0.13 - Blunt: -0.15 - Heat: -0.12 - Piercing: -0.18 - Poison: -0.08 - Slash: -0.23 - Shock: -0.08 - Radiation: -0.08 - Cold: -0.08 - Cellular: -0.08 + - type: CultCursed + giveCrystals: false + canLost: false # MEDIEVAL CultLeader @@ -5208,23 +5194,9 @@ - type: CloackMessage action: CloackMessageActionIns faction: "cult" - - type: PassiveDamage # Этот компонент имитирует лечение от связи с культом (CultCursedComponent) + стандартное пассивное лечение - allowedStates: - - Alive - damageCap: 100 - damage: - types: - Asphyxiation: -0.11 - Bloodloss: -0.13 - Blunt: -0.15 - Heat: -0.12 - Piercing: -0.18 - Poison: -0.08 - Slash: -0.23 - Shock: -0.08 - Radiation: -0.08 - Cold: -0.08 - Cellular: -0.08 + - type: CultCursed + giveCrystals: false + canLost: false # MEDIEVAL Villager REGULAR