delete skill trees

This commit is contained in:
Ed
2025-05-09 01:22:02 +03:00
parent d9c2bd8e09
commit 9d7fae73c4
23 changed files with 39 additions and 601 deletions

View File

@@ -15,7 +15,6 @@ public abstract partial class CP14SharedSkillSystem
[Dependency] private readonly IPrototypeManager _proto = default!;
private IEnumerable<CP14SkillPrototype>? _allSkills;
private IEnumerable<CP14SkillTreePrototype>? _allTrees;
private void InitializeAdmin()
{
SubscribeLocalEvent<CP14SkillStorageComponent, GetVerbsEvent<Verb>>(OnGetAdminVerbs);
@@ -36,7 +35,6 @@ public abstract partial class CP14SharedSkillSystem
private void UpdateCachedSkill()
{
_allSkills = _proto.EnumeratePrototypes<CP14SkillPrototype>();
_allTrees = _proto.EnumeratePrototypes<CP14SkillTreePrototype>();
}
@@ -45,32 +43,11 @@ public abstract partial class CP14SharedSkillSystem
if (!_admin.HasAdminFlag(args.User, AdminFlags.Admin))
return;
if (_allSkills is null || _allTrees is null)
if (_allSkills is null)
return;
var target = args.Target;
//Add skill points
foreach (var tree in _allTrees)
{
FixedPoint2 current = 0;
ent.Comp.Progress.TryGetValue(tree, out current);
var name = Loc.GetString(tree.Name);
args.Verbs.Add(new Verb
{
Text = name,
Message = $"{name} EXP {current} -> {current + 1}",
Category = VerbCategory.CP14AdminSkillAdd,
Icon = tree.Icon,
Act = () =>
{
TryAddExperience(target, tree.ID, 1);
},
Priority = 2,
});
}
//Add Skill
foreach (var skill in _allSkills)
{
@@ -91,30 +68,6 @@ public abstract partial class CP14SharedSkillSystem
});
}
//Remove skill points
foreach (var tree in _allTrees)
{
FixedPoint2 current = 0;
ent.Comp.Progress.TryGetValue(tree, out current);
if (current < 1)
continue;
var name = Loc.GetString(tree.Name);
args.Verbs.Add(new Verb
{
Text = name,
Message = $"{name} EXP {current} -> {current - 1}",
Category = VerbCategory.CP14AdminSkillRemove,
Icon = tree.Icon,
Act = () =>
{
TryRemoveExperience(target, tree.ID, 1);
},
Priority = 2,
});
}
//Remove Skill
foreach (var skill in ent.Comp.LearnedSkills)
{