diff --git a/Content.Shared/_CP14/Skill/CP14SkillSystem.Admin.cs b/Content.Shared/_CP14/Skill/CP14SkillSystem.Admin.cs index d2ee73ce4b..3b0813371d 100644 --- a/Content.Shared/_CP14/Skill/CP14SkillSystem.Admin.cs +++ b/Content.Shared/_CP14/Skill/CP14SkillSystem.Admin.cs @@ -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? _allSkills; + private IEnumerable? _allTrees; private void InitializeAdmin() { SubscribeLocalEvent>(OnGetAdminVerbs); @@ -33,7 +35,8 @@ public abstract partial class CP14SharedSkillSystem private void UpdateCachedSkill() { - _allSkills = _proto.EnumeratePrototypes().ToList().OrderBy(skill => skill.Tree.Id).ThenBy(skill => skill.Name); + _allSkills = _proto.EnumeratePrototypes(); + _allTrees = _proto.EnumeratePrototypes(); } @@ -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) { diff --git a/Content.Shared/_CP14/Skill/Prototypes/CP14SkillTreePrototype.cs b/Content.Shared/_CP14/Skill/Prototypes/CP14SkillTreePrototype.cs index 022e14b234..47f2d71928 100644 --- a/Content.Shared/_CP14/Skill/Prototypes/CP14SkillTreePrototype.cs +++ b/Content.Shared/_CP14/Skill/Prototypes/CP14SkillTreePrototype.cs @@ -41,4 +41,7 @@ public sealed partial class CP14SkillTreePrototype : IPrototype [DataField] public SoundSpecifier LearnSound = new SoundCollectionSpecifier("CP14LearnSkill"); + + [DataField] + public SpriteSpecifier? Icon = null; } diff --git a/Resources/Prototypes/_CP14/Entities/Markers/Spawners/Random/Loot/demiplane.yml b/Resources/Prototypes/_CP14/Entities/Markers/Spawners/Random/Loot/demiplane.yml index ee35f4f394..b92de34291 100644 --- a/Resources/Prototypes/_CP14/Entities/Markers/Spawners/Random/Loot/demiplane.yml +++ b/Resources/Prototypes/_CP14/Entities/Markers/Spawners/Random/Loot/demiplane.yml @@ -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 diff --git a/Resources/Prototypes/_CP14/Loadouts/skill_tree.yml b/Resources/Prototypes/_CP14/Loadouts/skill_tree.yml index f93514f6aa..28623ac829 100644 --- a/Resources/Prototypes/_CP14/Loadouts/skill_tree.yml +++ b/Resources/Prototypes/_CP14/Loadouts/skill_tree.yml @@ -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 diff --git a/Resources/Prototypes/_CP14/Skill/skill_tree.yml b/Resources/Prototypes/_CP14/Skill/skill_tree.yml index a1cd414915..893f68e876 100644 --- a/Resources/Prototypes/_CP14/Skill/skill_tree.yml +++ b/Resources/Prototypes/_CP14/Skill/skill_tree.yml @@ -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" \ No newline at end of file + color: "#b32e37" + icon: + sprite: _CP14/Actions/skill_tree.rsi + state: atlethic \ No newline at end of file diff --git a/Resources/Textures/_CP14/Actions/Spells/physical.rsi/kick.png b/Resources/Textures/_CP14/Actions/Spells/physical.rsi/kick.png index 3977141811..cadbc3025e 100644 Binary files a/Resources/Textures/_CP14/Actions/Spells/physical.rsi/kick.png and b/Resources/Textures/_CP14/Actions/Spells/physical.rsi/kick.png differ diff --git a/Resources/Textures/_CP14/Actions/Spells/physical.rsi/sprint.png b/Resources/Textures/_CP14/Actions/Spells/physical.rsi/sprint.png index a2b8da2c42..b6fa964256 100644 Binary files a/Resources/Textures/_CP14/Actions/Spells/physical.rsi/sprint.png and b/Resources/Textures/_CP14/Actions/Spells/physical.rsi/sprint.png differ diff --git a/Resources/Textures/_CP14/Actions/skill_tree.rsi/atlethic.png b/Resources/Textures/_CP14/Actions/skill_tree.rsi/atlethic.png new file mode 100644 index 0000000000..63a5060763 Binary files /dev/null and b/Resources/Textures/_CP14/Actions/skill_tree.rsi/atlethic.png differ diff --git a/Resources/Textures/_CP14/Actions/skill_tree.rsi/heal.png b/Resources/Textures/_CP14/Actions/skill_tree.rsi/heal.png new file mode 100644 index 0000000000..c59080bf51 Binary files /dev/null and b/Resources/Textures/_CP14/Actions/skill_tree.rsi/heal.png differ diff --git a/Resources/Textures/_CP14/Actions/skill_tree.rsi/light.png b/Resources/Textures/_CP14/Actions/skill_tree.rsi/light.png new file mode 100644 index 0000000000..9c8625db69 Binary files /dev/null and b/Resources/Textures/_CP14/Actions/skill_tree.rsi/light.png differ diff --git a/Resources/Textures/_CP14/Actions/skill_tree.rsi/meta.json b/Resources/Textures/_CP14/Actions/skill_tree.rsi/meta.json new file mode 100644 index 0000000000..9279964239 --- /dev/null +++ b/Resources/Textures/_CP14/Actions/skill_tree.rsi/meta.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/Resources/Textures/_CP14/Actions/skill_tree.rsi/meta.png b/Resources/Textures/_CP14/Actions/skill_tree.rsi/meta.png new file mode 100644 index 0000000000..6cc20d9668 Binary files /dev/null and b/Resources/Textures/_CP14/Actions/skill_tree.rsi/meta.png differ diff --git a/Resources/Textures/_CP14/Actions/skill_tree.rsi/pyro.png b/Resources/Textures/_CP14/Actions/skill_tree.rsi/pyro.png new file mode 100644 index 0000000000..823b9636d1 Binary files /dev/null and b/Resources/Textures/_CP14/Actions/skill_tree.rsi/pyro.png differ diff --git a/Resources/Textures/_CP14/Actions/skill_tree.rsi/water.png b/Resources/Textures/_CP14/Actions/skill_tree.rsi/water.png new file mode 100644 index 0000000000..af5f50fad1 Binary files /dev/null and b/Resources/Textures/_CP14/Actions/skill_tree.rsi/water.png differ