Skip to content

Commit

Permalink
vampires-buff
Browse files Browse the repository at this point in the history
  • Loading branch information
Rxup committed Nov 7, 2024
1 parent a4f7419 commit 2f8fdc1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Content.Server/Backmen/Vampiric/BkmVampireLevelingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,16 +293,24 @@ public void UnlockTier(Entity<BkmVampireComponent> ent, int tier)

public void AddCurrency(Entity<BkmVampireComponent> ent, FixedPoint2 va, string? source = null)
{
va = Math.Max(0D, va.Double());
va = FixedPoint2.Max(0, va);
if (va == 0)
{
_popupSystem.PopupEntity($"Вы не получили эссенцию"+(source != null ? $" за {source}" : ""), ent, ent, PopupType.MediumCaution);
return;
}

var plus = va > 0;

if (plus)
{
va *= 3; // base mode buff
}

_store.TryAddCurrency(new Dictionary<string, FixedPoint2>
{ { ent.Comp.CurrencyPrototype, va } },
ent);
var plus = va > 0;


_popupSystem.PopupEntity($"Вы получили {(plus ? "+" : "-")} {Math.Abs(va.Double())} эссенцию"+(source != null ? $" за {source}" : ""), ent, ent, plus ? PopupType.Medium : PopupType.MediumCaution);
}
Expand Down

0 comments on commit 2f8fdc1

Please sign in to comment.