Skip to content

Commit

Permalink
Теперь дамаг он анти-ноблия уменьшается, когда стабильность кристалла…
Browse files Browse the repository at this point in the history
… достигает 50%
  • Loading branch information
M1and1B committed Dec 16, 2024
1 parent 1f972a3 commit ec2eb06
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
30 changes: 24 additions & 6 deletions Content.Server/Supermatter/System/SupermatterSystem.Processing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,18 @@ private void HandleDamage(EntityUid uid, SupermatterComponent sm)
if (_config.GetCVar(CCVars.SupermatterDoCascadeDelam)
&& sm.ResonantFrequency >= 1)
{
sm.Damage += Math.Max(sm.Power / 1000 * sm.DamageIncreaseMultiplier, 10f);
return;
var integrity = GetIntegrity(sm);

if(integrity < 50)
{
sm.Damage += Math.Max(sm.Power / 1000 * sm.DamageIncreaseMultiplier, 10f);
return;
}
else
{
sm.Damage += Math.Max(sm.Power / 1000 * sm.DamageIncreaseMultiplier, 10f);
return;
}
}

// Absorbed gas from surrounding area
Expand Down Expand Up @@ -343,12 +353,20 @@ public float GetIntegrity(SupermatterComponent sm)

public DelamType ChooseDelamType(EntityUid uid, SupermatterComponent sm)
{
if (_config.GetCVar(CCVars.SupermatterDoCascadeDelam)
&& sm.ResonantFrequency >= 1)
if (_config.GetCVar(CCVars.SupermatterDoCascadeDelam) && sm.ResonantFrequency >= 1)
{
if (!sm.KudzuSpawned)
{
var xform = Transform(uid);
Spawn(sm.KudzuPrototype, xform.Coordinates);

sm.KudzuSpawned = true;
}

return DelamType.Cascade;
return DelamType.Cascade;
}

return DelamType.Explosion;
return DelamType.Explosion;
}

/// <summary>
Expand Down
6 changes: 6 additions & 0 deletions Content.Shared/Supermatter/Components/SupermatterComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ public sealed partial class SupermatterComponent : Component
[DataField]
public string SliverPrototype = "SupermatterSliver";

[DataField]
public string KudzuPrototype = "SupermatterKudzu";

[DataField]
public bool KudzuSpawned = false;

/// <summary>
/// Affects delamination timer.
/// If removed - delamination timer is divided by 2.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@
types:
Asphyxiation: -0.25
- type: RadiationSource
intensity: 1.5
intensity: 1.5
- type: SupermatterImmune

0 comments on commit ec2eb06

Please sign in to comment.