delete skill trees
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user