This commit is contained in:
Ed
2025-03-30 20:31:37 +03:00
committed by GitHub
parent 8a479c4e5e
commit 987f00a493
14 changed files with 113 additions and 17 deletions

View File

@@ -3,6 +3,7 @@ using Content.Shared._CP14.Skill.Components;
using Content.Shared._CP14.Skill.Prototypes;
using Content.Shared.Administration;
using Content.Shared.Administration.Managers;
using Content.Shared.FixedPoint;
using Content.Shared.Verbs;
using Robust.Shared.Prototypes;
@@ -14,6 +15,7 @@ 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);
@@ -33,7 +35,8 @@ public abstract partial class CP14SharedSkillSystem
private void UpdateCachedSkill()
{
_allSkills = _proto.EnumeratePrototypes<CP14SkillPrototype>().ToList().OrderBy(skill => skill.Tree.Id).ThenBy(skill => skill.Name);
_allSkills = _proto.EnumeratePrototypes<CP14SkillPrototype>();
_allTrees = _proto.EnumeratePrototypes<CP14SkillTreePrototype>();
}
@@ -42,11 +45,32 @@ public abstract partial class CP14SharedSkillSystem
if (!_admin.HasAdminFlag(args.User, AdminFlags.Admin))
return;
if (_allSkills is null)
if (_allSkills is null || _allTrees 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)
{
@@ -67,6 +91,30 @@ 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)
{

View File

@@ -41,4 +41,7 @@ public sealed partial class CP14SkillTreePrototype : IPrototype
[DataField]
public SoundSpecifier LearnSound = new SoundCollectionSpecifier("CP14LearnSkill");
[DataField]
public SpriteSpecifier? Icon = null;
}

View File

@@ -99,6 +99,4 @@
- !type:GroupSelector # remove this when players can create their own magic items
children:
- id: CP14SpellScrollResurrection
- id: CP14ClothingRingIceShards
- id: CP14ClothingRingFlashLight
- id: CP14ClothingCloakAmuletMana

View File

@@ -19,8 +19,8 @@
categories: [ HideSpawnMenu ]
components:
- type: Sprite
sprite: _CP14/Actions/Spells/fire.rsi
state: flame_creation
sprite: _CP14/Actions/skill_tree.rsi
state: pyro
- type: loadout
id: CP14SkillTreePyrokinetic
@@ -36,8 +36,8 @@
categories: [ HideSpawnMenu ]
components:
- type: Sprite
sprite: _CP14/Actions/Spells/water.rsi
state: water_creation
sprite: _CP14/Actions/skill_tree.rsi
state: water
- type: loadout
id: CP14SkillTreeHydrosophistry
@@ -52,8 +52,8 @@
categories: [ HideSpawnMenu ]
components:
- type: Sprite
sprite: _CP14/Actions/Spells/light.rsi
state: sphere_of_light
sprite: _CP14/Actions/skill_tree.rsi
state: light
- type: loadout
id: CP14SkillTreeIllusion
@@ -68,8 +68,8 @@
categories: [ HideSpawnMenu ]
components:
- type: Sprite
sprite: _CP14/Actions/Spells/meta.rsi
state: mana
sprite: _CP14/Actions/skill_tree.rsi
state: meta
- type: loadout
id: CP14SkillTreeMetamagic
@@ -84,8 +84,8 @@
categories: [ HideSpawnMenu ]
components:
- type: Sprite
sprite: _CP14/Actions/Spells/healing.rsi
state: plant_growth
sprite: _CP14/Actions/skill_tree.rsi
state: heal
- type: loadout
id: CP14SkillTreeHealing
@@ -100,8 +100,8 @@
categories: [ HideSpawnMenu ]
components:
- type: Sprite
sprite: _CP14/Actions/Spells/physical.rsi
state: kick
sprite: _CP14/Actions/skill_tree.rsi
state: atlethic
- type: loadout
id: CP14SkillTreeAtlethic

View File

@@ -3,33 +3,51 @@
name: cp14-skill-tree-pyrokinetic-name
desc: cp14-skill-tree-pyrokinetic-desc
color: "#b52400"
icon:
sprite: _CP14/Actions/skill_tree.rsi
state: pyro
- type: cp14SkillTree
id: Hydrosophistry
name: cp14-skill-tree-hydrosophistry-name
desc: cp14-skill-tree-hydrosophistry-desc
color: "#1554a1"
icon:
sprite: _CP14/Actions/skill_tree.rsi
state: water
- type: cp14SkillTree
id: Illusion
name: cp14-skill-tree-illusion-name
desc: cp14-skill-tree-illusion-desc
color: "#f55faf"
icon:
sprite: _CP14/Actions/skill_tree.rsi
state: light
- type: cp14SkillTree
id: Metamagic
name: cp14-skill-tree-metamagic-name
desc: cp14-skill-tree-metamagic-desc
color: "#56e5f5"
icon:
sprite: _CP14/Actions/skill_tree.rsi
state: meta
- type: cp14SkillTree
id: Healing
name: cp14-skill-tree-healing-name
desc: cp14-skill-tree-healing-desc
color: "#51cf72"
icon:
sprite: _CP14/Actions/skill_tree.rsi
state: heal
- type: cp14SkillTree
id: Atlethic
name: cp14-skill-tree-atlethic-name
desc: cp14-skill-tree-atlethic-desc
color: "#b32e37"
color: "#b32e37"
icon:
sprite: _CP14/Actions/skill_tree.rsi
state: atlethic

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

View File

@@ -0,0 +1,29 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "All right reserved",
"copyright": "Created by TheShuEd",
"states": [
{
"name": "atlethic"
},
{
"name": "heal"
},
{
"name": "light"
},
{
"name": "meta"
},
{
"name": "pyro"
},
{
"name": "water"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B