Skip to content
Open
12 changes: 12 additions & 0 deletions Content.Server/Imperial/Medieval/Cult/CultCursedComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ public sealed partial class CultCursedComponent : Component
[DataField]
public ProtoId<AlertPrototype> CurseAlert = "CultCurse";

/// <summary>
/// должны ли при сдаче крови появляться кристаллы
/// </summary>
[DataField]
public bool GiveCrystals = true;

/// <summary>
/// может ли привязанный потерять связь
/// </summary>
[DataField]
public bool CanLost = true;

[DataField]
public float CurseLevel = 100f;

Expand Down
41 changes: 29 additions & 12 deletions Content.Server/Imperial/Medieval/Cult/CultSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ private void OnBloodMeleeHit(EntityUid uid, CultBloodMeleeComponent component, M
{
if (!TryComp<CultCursedComponent>(args.User, out var cursed)) continue;
if (entity != args.User) continue;
if (cursed.CurseLevel > 75 && !HasComp<CultMemberComponent>(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))
Expand All @@ -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<CultAltarComponent>())
{
var axform = Transform(altar.Owner);
Expand Down Expand Up @@ -218,6 +222,10 @@ public override void Update(float frameTime)
foreach (var cursed in EntityManager.EntityQuery<CultCursedComponent>())
{
cursed.CurseLevel -= cursed.Rate;

if (!cursed.CanLost)
cursed.CurseLevel = Math.Max(1f, cursed.CurseLevel);

if (cursed.CurseLevel < 0f)
{
cursed.CurseLevel = 0f;
Expand All @@ -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<DamageableComponent>(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<CultMemberComponent>(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<DamageableComponent>(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);
}
}

Expand Down
7 changes: 7 additions & 0 deletions Resources/Locale/ru-RU/Imperial/Medieval/cult.ftl
Original file line number Diff line number Diff line change
@@ -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 = Все ваше тело болит из-за того, что вы не поддерживаете зов культа. Сдайте кровь у алтаря!
40 changes: 6 additions & 34 deletions Resources/Prototypes/Imperial/Medieval/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down