Skip to content

Commit

Permalink
фиксы см
Browse files Browse the repository at this point in the history
  • Loading branch information
babaevlsdd committed Jan 7, 2025
1 parent 6ae40f0 commit 258e25c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
31 changes: 20 additions & 11 deletions Content.Server/Supermatter/EntitySystems/SupermatterSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Server.Atmos.EntitySystems;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Supermatter.Components;
using Content.Shared.Atmos;
using Content.Server.Lightning;
Expand Down Expand Up @@ -103,6 +103,7 @@ public void Cycle(EntityUid uid, SupermatterComponent sm)
SupermatterAlert(uid, Loc.GetString($"supermatter-announcement-{loc}", ("integrity", (int)(sm.DelaminationPoint - sm.Damage))));
}
}
sm.DamageArchive = sm.Damage;

if (sm.AreWeDelaming)
DelamCountdown(uid, sm);
Expand Down Expand Up @@ -217,18 +218,17 @@ private void ProcessDamage(EntityUid uid, SupermatterComponent sm)
damageHealHeat = Math.Clamp((sm.AbsorbedGasMix.TotalMoles - sm.TempLimit) / 6000, -.1f, 0);

var totalDamage = damageHeat + damagePower + damageMoles + damageHealHeat;

var oldDamage = sm.Damage;
sm.Damage += Math.Max(totalDamage, 0);

if (sm.Damage > sm.DelaminationPoint)
sm.AreWeDelaming = true;

if (sm.Damage > sm.DamageDangerPoint)
if (sm.Damage >= sm.DelaminationPoint && !sm.AreWeDelaming)
{
if (_random.Prob(.0001f))
GenerateAnomaly(uid);
return;
sm.AreWeDelaming = true;
SupermatterAlert(uid, Loc.GetString("supermatter-announcement-delam"));
}

if (sm.Damage > sm.DamageDangerPoint && _random.Prob(.0001f))
GenerateAnomaly(uid);
}
/// <summary>
/// Process waste, release hot plasma and oxygen.
Expand Down Expand Up @@ -439,8 +439,14 @@ private void OnClick(EntityUid uid, SupermatterComponent sm, InteractUsingEvent
{
if (HasComp<SharpComponent>(args.Used))
{
if (sm.Damage >= 100)
{
_popup.PopupEntity(Loc.GetString("supermatter-tamper-fail"), args.User, args.User);
return;
}

_adminLogger.Add(LogType.Action, LogImpact.High, $"{EntityManager.ToPrettyString(args.User):player} is trying to extract a sliver from the supermatter crystal.");
_popup.PopupClient(Loc.GetString("supermatter-tamper-begin"), args.User, args.User);
_popup.PopupEntity(Loc.GetString("supermatter-tamper-begin"), args.User, args.User);

var doAfterArgs = new DoAfterArgs(EntityManager, args.User, 30, new SupermatterDoAfterEvent(), uid, target: uid, used: args.Used)
{
Expand All @@ -457,11 +463,14 @@ private void OnClick(EntityUid uid, SupermatterComponent sm, InteractUsingEvent

private void OnGetSliver(EntityUid uid, SupermatterComponent sm, SupermatterDoAfterEvent args)
{
if (args.Cancelled)
return;

sm.Damage += 10; // your criminal actions will not go unnoticed
SupermatterAlert(uid, Loc.GetString("supermatter-announcement-tamper", ("integrity", (int)(100 - sm.Damage))));

Spawn(sm.SliverPrototype, _transform.GetMapCoordinates(args.User));
_popup.PopupClient(Loc.GetString("supermatter-tamper-end"), args.User);
_popup.PopupEntity(Loc.GetString("supermatter-tamper-end"), args.User, args.User);
}

private void OnGetHit(EntityUid uid, SupermatterComponent sm, DamageChangedEvent args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ supermatter-announcement-delam-tesla = Скорое высвобождение
supermatter-announcement-delam-cascade = Превышены пределы гармонической частоты. Поле дестабилизации для предотвращения потерь не удалось активировать.
supermatter-tamper-begin = Вы начинаете аккуратно срезать осколок с кристалла суперматерии...
supermatter-tamper-end = Вы чувствуете себя богом, держа в руках кусок суперматерии. Или это просто радиация?
supermatter-tamper-fail = Кристалл слишком поврежден, чтобы извлечь из него еще осколки.
supermatter-announcement-tamper = Внимание! Обнаружено несанкционированное вмешательство в кристалл суперматерии! Целостность: { $integrity }%

0 comments on commit 258e25c

Please sign in to comment.