From 987f00a49353bcc9bec57bd43a312a40781b0a9e Mon Sep 17 00:00:00 2001 From: Ed <96445749+TheShuEd@users.noreply.github.com> Date: Sun, 30 Mar 2025 20:31:37 +0300 Subject: [PATCH] s (#1096) --- .../_CP14/Skill/CP14SkillSystem.Admin.cs | 52 +++++++++++++++++- .../Prototypes/CP14SkillTreePrototype.cs | 3 + .../Spawners/Random/Loot/demiplane.yml | 2 - .../Prototypes/_CP14/Loadouts/skill_tree.yml | 24 ++++---- .../Prototypes/_CP14/Skill/skill_tree.yml | 20 ++++++- .../Actions/Spells/physical.rsi/kick.png | Bin 301 -> 310 bytes .../Actions/Spells/physical.rsi/sprint.png | Bin 178 -> 179 bytes .../_CP14/Actions/skill_tree.rsi/atlethic.png | Bin 0 -> 345 bytes .../_CP14/Actions/skill_tree.rsi/heal.png | Bin 0 -> 299 bytes .../_CP14/Actions/skill_tree.rsi/light.png | Bin 0 -> 248 bytes .../_CP14/Actions/skill_tree.rsi/meta.json | 29 ++++++++++ .../_CP14/Actions/skill_tree.rsi/meta.png | Bin 0 -> 503 bytes .../_CP14/Actions/skill_tree.rsi/pyro.png | Bin 0 -> 350 bytes .../_CP14/Actions/skill_tree.rsi/water.png | Bin 0 -> 332 bytes 14 files changed, 113 insertions(+), 17 deletions(-) create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/atlethic.png create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/heal.png create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/light.png create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/meta.json create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/meta.png create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/pyro.png create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/water.png 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 397714181167deae29aa08f775a90447002ff767..cadbc3025e953243a43a3f88e29124220d2807ab 100644 GIT binary patch delta 270 zcmV+p0rCE=0=5E>F@Nw$L_t(oh3%EW4TCTYMeVASgbU2TCY=DpJP0OWlgvObbQSmH z%8k;-F(6fH-YF7_zy0kPfI^}0@8FrihpL(QJZ@`m4zjqK7FUxDXiX&Kn!4N)b@Ds{ zBrD0O{E`ax33es+ZQRyg3V%x?nSe)}V`ocZG1NmiRLvyY!G8(K>ZI`PaaYAo&cG`$ zy%!a_A;mRLG3puMpdNAdh;vKSu_K{)&XZHw!~!fVE0k@?6$el{!2JwoKw=RG$lQdB zt4X>b-LP&t(<&DWei1oK=g80<8j&F@NVtL_t(oh3!=_4udcZbgJ&Wg&)A!oq@k(?q3+#Gr|ve3omdd ztF9Fh#{>zfxyb@?ce&UGprWGU-{Gz#pKxBN9^KHJNdkHd=#djzjYvFGA2+adv05vb zI{8CG7z3pedpEkF=fX!Ok_L8Y*H~>a7K6G8C!7~~1v|7WKYbk+ez~`bJJ|zY;_c^| zOoNMSlFBkbqz!Bxk@Ga9c+SYFVj=-)LK?{x2T)D{-RIF5TEqb|H(@}JJO!SHb<>$v z@tHf9FfAhOh+SrYo6xT3;s&fgreX%@Hr~$&62CS&4xCK7#n|raFoAD_C0000< KMNUMnLSTZQ=5o*g diff --git a/Resources/Textures/_CP14/Actions/Spells/physical.rsi/sprint.png b/Resources/Textures/_CP14/Actions/Spells/physical.rsi/sprint.png index a2b8da2c421bae213dd26af2fb8c62799da19166..b6fa964256bbe4fa5b6beb283c461ace00c6affd 100644 GIT binary patch delta 138 zcmV;50CoSe0kZ*+F@J4IL_t(og=1hC1*2dTjDnF47^z`MwzB4QWd78<*E4D609=+W zQ_}d4EFN|522p0?RYa;~*55Fo~DU>5-Sr=bp6l%ruK1Zw?!V*5XA8b%NaUHx3vIWZ+P0RU)*HfI0; 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 0000000000000000000000000000000000000000..63a506076388d813e0e5d19a933eec4642aeba04 GIT binary patch literal 345 zcmV-f0jBPx$6G=otR9J=WSIZHDAP`-gR3aCt!A??v8S2Sk1$JT$$t7up95OqDd{+_l;5#zB zkIOEM0B69|c6w?%ExAyoy(AY3{T2aA8{0t71^{4YY^)vN2+s@qpvI&ukTW3^Zj%z2 z85_5RpmKu&Ok!$eBp1p)8j}+XaSI88{&Sw6*CS>g0`mH{8&H$1IxR=_r13ku)qfza0h z&|a|E9-p?i0_MgoO}VBAl1*p|P{VA!J4lFysQyr;;Jc!2L?0unNv;OjsDxQ|1umF4 r-4u{Px#<|{Ln2z= zPQNYYpdjGtUw7w6QCyLx@64GR)Bd`wzG}CW&4K@n^_Pb3ut@Z&!6E} zlH9iB^YiDiKa72+8Mf_clnzlcYCU!K)s4C}8HKx}^cuM@IOTCYR0*oL6x-#;@LPx$u}MThR9J=Wm$7bxFc5}+qNq#6$b<9=m^!jV%IX*JBfv;aH7>n%ENfg!@lF749axHDt^gpc zku42ykC^{b703o_T-qkc={c;C9g1kb7y!9*8*cyrRnr~c`M{Xc^~Eka>(>jw8kasj zZ*m@#Ksd}8h$&q^cg9w-p=vsWH8M&Q3A2qi;7i2e0buTOt@!TOCdjq?6+YL zYsA!M;ndLr!-)B}*BUk8ooNQ*+qCq9Hev$y^}?Fy$v{5TRnrYH@eqt)_-wTaatjCQ zf2^;g35#76_z)k1Gm$Z6``GfS0Gj0SEX}A%LR=cuBmi*k?65{AL8_+1%bSmU0;nMYR7G0AE8gr*@FF334q>0Z$W3O`UqOo{-1-oTGYFzU4bF!GEOex5lMQ t+#UX)?lG+=G4FmgqlP6fr?-ydtq)YBFva^>;0^!)002ovPDHLkV1n}s>aG9) literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..823b9636d110aedac92a5385580d0235ba3ef0f3 GIT binary patch literal 350 zcmV-k0iphhP)Px$7)eAyR9J=GSHTg4AP|erwPg+d?19JCpw{5S9`0uic48yk2N*a}g9192C&O&Q zW_JPL36KM%93W+bE;(0&PV+eeQWLL)D9#c9Fr&{c;10C<~mRdsb9vLyMEI0UNd07NRX8g-{llfZ7HhENhB4AD7O+p|>ZyPx$21!IgR9J=Wm$40lFc3u#lpZLvM>a^CDOkY+Un#1VhzApr zhkijRl?j>U71g`;$C470h(F(EQc{{Z`8@RcnB)7k7#YF2vQg@BNfIJ|J+>C;nQq%h z@V@KaK~9;FTxNN7JNIL(P|>xuUI_pIS2es^FvYMvh;JJf<-jlTIRq~jYy*z<@~>h5 zP2jaIj`JagoPw?lu;s=Sv)8~d^KBv&Yhw|l(d`>3p*UOc-`niLZrI{)$I#sTXoeGO e9!_KHc=H7W8M%5slP0ME0000