God part 4 (#1422)

* projectile spell improve

* mind improve
This commit is contained in:
Red
2025-06-14 14:21:25 +03:00
committed by GitHub
parent fc0beb5ccf
commit 7760e8f628
15 changed files with 244 additions and 28 deletions

View File

@@ -3,6 +3,7 @@ using System.Text;
using Content.Shared._CP14.Skill.Components;
using Content.Shared._CP14.Skill.Prototypes;
using Content.Shared.FixedPoint;
using Content.Shared.Popups;
using Robust.Shared.Prototypes;
namespace Content.Shared._CP14.Skill;
@@ -268,6 +269,20 @@ public abstract partial class CP14SharedSkillSystem : EntitySystem
}
return true;
}
/// <summary>
/// Increases the number of memory points for a character, limited to a certain amount.
/// </summary>
public void AddMemoryPoints(EntityUid target, FixedPoint2 points, FixedPoint2 limit, CP14SkillStorageComponent? component = null)
{
if (!Resolve(target, ref component, false))
return;
component.ExperienceMaxCap = FixedPoint2.Min(component.ExperienceMaxCap + points, limit);
Dirty(target, component);
_popup.PopupEntity(Loc.GetString("cp14-skill-popup-added-points", ("count", points)), target, target);
}
}
[ByRefEvent]