diff --git a/Content.Client/UserInterface/Systems/MenuBar/GameTopMenuBarUIController.cs b/Content.Client/UserInterface/Systems/MenuBar/GameTopMenuBarUIController.cs index 4ac49ceebc..1bc8332ad6 100644 --- a/Content.Client/UserInterface/Systems/MenuBar/GameTopMenuBarUIController.cs +++ b/Content.Client/UserInterface/Systems/MenuBar/GameTopMenuBarUIController.cs @@ -1,3 +1,4 @@ +using Content.Client._CP14.UserInterface.Systems.Skill; using Content.Client.UserInterface.Systems.Actions; using Content.Client.UserInterface.Systems.Admin; using Content.Client.UserInterface.Systems.Bwoink; diff --git a/Content.Client/_CP14/Skill/Ui/CP14SkillTreeGraphControl.xaml.cs b/Content.Client/_CP14/Skill/Ui/CP14SkillTreeGraphControl.xaml.cs index a5a55c27f9..735ca4c858 100644 --- a/Content.Client/_CP14/Skill/Ui/CP14SkillTreeGraphControl.xaml.cs +++ b/Content.Client/_CP14/Skill/Ui/CP14SkillTreeGraphControl.xaml.cs @@ -3,6 +3,7 @@ using System.Numerics; using Content.Shared._CP14.Skill; using Content.Shared._CP14.Skill.Components; using Content.Shared._CP14.Skill.Prototypes; +using Content.Shared._CP14.Skill.Restrictions; using Robust.Client.AutoGenerated; using Robust.Client.Graphics; using Robust.Client.UserInterface; @@ -130,19 +131,25 @@ public sealed partial class CP14SkillTreeGraphControl : BoxContainer var fromPos = skill.SkillUiPosition * GridSize * UIScale + _globalOffset; - foreach (var prerequisite in skill.Prerequisites) + foreach (var req in skill.Restrictions) { - if (!_proto.TryIndex(prerequisite, out var prerequisiteSkill)) - continue; + switch (req) + { + case NeedPrerequisite prerequisite: + if (!_proto.TryIndex(prerequisite.Prerequisite, out var prerequisiteSkill)) + continue; - if (prerequisiteSkill.Tree != Tree) - continue; + if (prerequisiteSkill.Tree != Tree) + continue; - var learned = playerSkills.Contains(skill.ID); + var learned = playerSkills.Contains(skill.ID); - var toPos = prerequisiteSkill.SkillUiPosition * GridSize * UIScale + _globalOffset; - var color = learned ? Color.White : Color.FromSrgb(new Color(0.7f, 0.7f, 0.7f)); - handle.DrawLine(fromPos, toPos, color); + var toPos = prerequisiteSkill.SkillUiPosition * GridSize * UIScale + _globalOffset; + var color = learned ? Color.White : Color.FromSrgb(new Color(0.7f, 0.7f, 0.7f)); + handle.DrawLine(fromPos, toPos, color); + + break; + } } } @@ -153,9 +160,7 @@ public sealed partial class CP14SkillTreeGraphControl : BoxContainer continue; //TODO: Not optimized, recalculates every frame. Needs to be calculated on state update and cached. - var learned = playerSkills.Contains(skill.ID); - var available = _skillSystem.CanLearnSkill(_player.Value, skill.ID); - var canBeLearned = learned || skill.Prerequisites.All(prerequisite => playerSkills.Contains(prerequisite)); + var canBeLearned = _skillSystem.CanLearnSkill(_player.Value, skill, _player.Value.Comp); var pos = skill.SkillUiPosition * GridSize * UIScale + _globalOffset; // Base skill icon @@ -190,6 +195,9 @@ public sealed partial class CP14SkillTreeGraphControl : BoxContainer handle.DrawTextureRect(hoveredTexture, hoveredQuad, Color.White); } + var learned = playerSkills.Contains(skill.ID); + var allowedToLearn = _skillSystem.AllowedToLearn(_player.Value, skill, _player.Value.Comp); + // Learned Skill if (learned) { @@ -198,7 +206,7 @@ public sealed partial class CP14SkillTreeGraphControl : BoxContainer var learnedQuad = new UIBox2(pos - learnedSize / 2, pos + learnedSize / 2); handle.DrawTextureRect(learnedTexture, learnedQuad, Color.White); } - else if (available) + else if (canBeLearned) { var availableTexture = Tree.AvailableIcon.Frame0(); var availableSize = new Vector2(availableTexture.Width, availableTexture.Height) * 2; @@ -206,11 +214,12 @@ public sealed partial class CP14SkillTreeGraphControl : BoxContainer handle.DrawTextureRect(availableTexture, availableQuad, Color.White); } - var iconColor = Color.White; - if (!learned) - iconColor = Color.FromSrgb(new Color(0.7f, 0.7f, 0.7f)); - if (!canBeLearned && !learned) - iconColor = Color.FromSrgb(new Color(0f, 0f, 0f)); + var iconColor = allowedToLearn switch + { + true when !learned => Color.FromSrgb(new Color(0.7f, 0.7f, 0.7f)), + false when !learned => Color.FromSrgb(new Color(0f, 0f, 0f)), + _ => Color.White + }; handle.DrawTextureRect(baseTexture, baseQuad, iconColor); } diff --git a/Content.Client/_CP14/UserInterface/Systems/Skill/CP14SkillUIController.cs b/Content.Client/_CP14/UserInterface/Systems/Skill/CP14SkillUIController.cs index 23f63b182a..983202fba7 100644 --- a/Content.Client/_CP14/UserInterface/Systems/Skill/CP14SkillUIController.cs +++ b/Content.Client/_CP14/UserInterface/Systems/Skill/CP14SkillUIController.cs @@ -1,5 +1,6 @@ using System.Linq; using System.Numerics; +using System.Text; using Content.Client._CP14.Skill; using Content.Client._CP14.Skill.Ui; using Content.Client._CP14.UserInterface.Systems.Skill.Window; @@ -18,7 +19,7 @@ using Robust.Shared.Input.Binding; using Robust.Shared.Prototypes; using Robust.Shared.Utility; -namespace Content.Client.UserInterface.Systems.Character; +namespace Content.Client._CP14.UserInterface.Systems.Skill; [UsedImplicitly] public sealed class CP14SkillUIController : UIController, IOnStateEntered, IOnStateExited, @@ -26,12 +27,13 @@ public sealed class CP14SkillUIController : UIController, IOnStateEntered UIManager.GetActiveUIWidgetOrNull()?.CP14SkillButton; + private MenuButton? SkillButton => UIManager.GetActiveUIWidgetOrNull()?.CP14SkillButton; public void OnStateEntered(GameplayState state) { @@ -142,8 +144,23 @@ public sealed class CP14SkillUIController : UIController, IOnStateEntered skill, CP14SkillStorageComponent? component = null) + { + if (!_proto.TryIndex(skill, out var indexedSkill)) + return false; + + return CanLearnSkill(target, indexedSkill, component); + } + + /// + /// Checks if the player can learn the specified skill. + /// + public bool CanLearnSkill(EntityUid target, + CP14SkillPrototype skill, + CP14SkillStorageComponent? component = null) { if (!Resolve(target, ref component, false)) return false; - if (!_proto.TryIndex(skill, out var indexedSkill)) + if (!AllowedToLearn(target, skill, component)) + return false; + + //Experience check + if (!component.Progress.TryGetValue(skill.Tree, out var currentExp)) + return false; + if (currentExp < skill.LearnCost) + return false; + + return true; + } + + /// + /// Is it allowed to learn this skill? The player may not have enough points to learn it, but has already met all the requirements to learn it. + /// + public bool AllowedToLearn(EntityUid target, + CP14SkillPrototype skill, + CP14SkillStorageComponent? component = null) + { + if (!Resolve(target, ref component, false)) return false; //Already learned @@ -150,22 +182,16 @@ public abstract partial class CP14SharedSkillSystem : EntitySystem return false; //Check max cap - if (component.SkillsSumExperience + indexedSkill.LearnCost >= component.ExperienceMaxCap) + if (component.SkillsSumExperience + skill.LearnCost >= component.ExperienceMaxCap) return false; - //Prerequisite check - foreach (var prerequisite in indexedSkill.Prerequisites) + //Restrictions check + foreach (var req in skill.Restrictions) { - if (!HaveSkill(target, prerequisite, component)) + if (!req.Check(EntityManager, target)) return false; } - //Experience check - if (!component.Progress.TryGetValue(indexedSkill.Tree, out var currentExp)) - return false; - if (currentExp < indexedSkill.LearnCost) - return false; - return true; } diff --git a/Content.Shared/_CP14/Skill/CP14SkillSystem.Admin.cs b/Content.Shared/_CP14/Skill/CP14SkillSystem.Admin.cs index 38524dd3ab..d2ee73ce4b 100644 --- a/Content.Shared/_CP14/Skill/CP14SkillSystem.Admin.cs +++ b/Content.Shared/_CP14/Skill/CP14SkillSystem.Admin.cs @@ -1,3 +1,4 @@ +using System.Linq; using Content.Shared._CP14.Skill.Components; using Content.Shared._CP14.Skill.Prototypes; using Content.Shared.Administration; @@ -11,21 +12,43 @@ public abstract partial class CP14SharedSkillSystem { [Dependency] private readonly ISharedAdminManager _admin = default!; [Dependency] private readonly IPrototypeManager _proto = default!; + + private IEnumerable? _allSkills; private void InitializeAdmin() { SubscribeLocalEvent>(OnGetAdminVerbs); + + SubscribeLocalEvent(OnPrototypeReloaded); + + UpdateCachedSkill(); } + private void OnPrototypeReloaded(PrototypesReloadedEventArgs ev) + { + if (!ev.WasModified()) + return; + + UpdateCachedSkill(); + } + + private void UpdateCachedSkill() + { + _allSkills = _proto.EnumeratePrototypes().ToList().OrderBy(skill => skill.Tree.Id).ThenBy(skill => skill.Name); + } + + private void OnGetAdminVerbs(Entity ent, ref GetVerbsEvent args) { if (!_admin.HasAdminFlag(args.User, AdminFlags.Admin)) return; + if (_allSkills is null) + return; var target = args.Target; //Add Skill - foreach (var skill in _proto.EnumeratePrototypes()) + foreach (var skill in _allSkills) { if (ent.Comp.LearnedSkills.Contains(skill)) continue; diff --git a/Content.Shared/_CP14/Skill/Specials/AddAction.cs b/Content.Shared/_CP14/Skill/Effects/AddAction.cs similarity index 55% rename from Content.Shared/_CP14/Skill/Specials/AddAction.cs rename to Content.Shared/_CP14/Skill/Effects/AddAction.cs index 35ab2d7ce7..1272ff51a4 100644 --- a/Content.Shared/_CP14/Skill/Specials/AddAction.cs +++ b/Content.Shared/_CP14/Skill/Effects/AddAction.cs @@ -1,21 +1,21 @@ using Content.Shared.Actions; using Robust.Shared.Prototypes; -namespace Content.Shared._CP14.Skill.Specials; +namespace Content.Shared._CP14.Skill.Effects; public sealed partial class AddAction : CP14SkillEffect { [DataField(required: true)] public EntProtoId Action; - public override void AddSkill(EntityManager entManager, EntityUid target) + public override void AddSkill(IEntityManager entManager, EntityUid target) { var actionsSystem = entManager.System(); actionsSystem.AddAction(target, Action); } - public override void RemoveSkill(EntityManager entManager, EntityUid target) + public override void RemoveSkill(IEntityManager entManager, EntityUid target) { var actionsSystem = entManager.System(); @@ -34,19 +34,13 @@ public sealed partial class AddAction : CP14SkillEffect } } - public override string? GetName(EntityManager entMagager, IPrototypeManager protoManager) + public override string? GetName(IEntityManager entMagager, IPrototypeManager protoManager) { - if (!protoManager.TryIndex(Action, out var indexedAction)) - return String.Empty; - - return indexedAction.Name; + return !protoManager.TryIndex(Action, out var indexedAction) ? string.Empty : indexedAction.Name; } - public override string? GetDescription(EntityManager entMagager, IPrototypeManager protoManager) + public override string? GetDescription(IEntityManager entMagager, IPrototypeManager protoManager) { - if (!protoManager.TryIndex(Action, out var indexedAction)) - return String.Empty; - - return indexedAction.Description; + return !protoManager.TryIndex(Action, out var indexedAction) ? string.Empty : indexedAction.Description; } } diff --git a/Content.Shared/_CP14/Skill/Effects/CP14SkillEffect.cs b/Content.Shared/_CP14/Skill/Effects/CP14SkillEffect.cs new file mode 100644 index 0000000000..63e4a617c6 --- /dev/null +++ b/Content.Shared/_CP14/Skill/Effects/CP14SkillEffect.cs @@ -0,0 +1,17 @@ +using JetBrains.Annotations; +using Robust.Shared.Prototypes; + +namespace Content.Shared._CP14.Skill.Effects; + +[ImplicitDataDefinitionForInheritors] +[MeansImplicitUse] +public abstract partial class CP14SkillEffect +{ + public abstract void AddSkill(IEntityManager entManager, EntityUid target); + + public abstract void RemoveSkill(IEntityManager entManager, EntityUid target); + + public abstract string? GetName(IEntityManager entMagager, IPrototypeManager protoManager); + + public abstract string? GetDescription(IEntityManager entMagager, IPrototypeManager protoManager); +} diff --git a/Content.Shared/_CP14/Skill/Effects/ReplaceAction.cs b/Content.Shared/_CP14/Skill/Effects/ReplaceAction.cs new file mode 100644 index 0000000000..75cc01192b --- /dev/null +++ b/Content.Shared/_CP14/Skill/Effects/ReplaceAction.cs @@ -0,0 +1,69 @@ +using Content.Shared.Actions; +using Robust.Shared.Prototypes; + +namespace Content.Shared._CP14.Skill.Effects; + +public sealed partial class ReplaceAction : CP14SkillEffect +{ + [DataField(required: true)] + public EntProtoId OldAction; + + [DataField(required: true)] + public EntProtoId NewAction; + + public override void AddSkill(IEntityManager entManager, EntityUid target) + { + var actionsSystem = entManager.System(); + + //Remove old action + foreach (var (uid, _) in actionsSystem.GetActions(target)) + { + if (!entManager.TryGetComponent(uid, out var metaData)) + continue; + + if (metaData.EntityPrototype == null) + continue; + + if (metaData.EntityPrototype != OldAction) + continue; + + actionsSystem.RemoveAction(target, uid); + } + + //Add new one + actionsSystem.AddAction(target, NewAction); + } + + public override void RemoveSkill(IEntityManager entManager, EntityUid target) + { + var actionsSystem = entManager.System(); + + //Remove old action + foreach (var (uid, _) in actionsSystem.GetActions(target)) + { + if (!entManager.TryGetComponent(uid, out var metaData)) + continue; + + if (metaData.EntityPrototype == null) + continue; + + if (metaData.EntityPrototype != NewAction) + continue; + + actionsSystem.RemoveAction(target, uid); + } + + //Add new one + actionsSystem.AddAction(target, OldAction); + } + + public override string? GetName(IEntityManager entMagager, IPrototypeManager protoManager) + { + return !protoManager.TryIndex(NewAction, out var indexedAction) ? string.Empty : indexedAction.Name; + } + + public override string? GetDescription(IEntityManager entMagager, IPrototypeManager protoManager) + { + return !protoManager.TryIndex(NewAction, out var indexedAction) ? string.Empty : indexedAction.Description; + } +} diff --git a/Content.Shared/_CP14/Skill/Prototypes/CP14SkillPrototype.cs b/Content.Shared/_CP14/Skill/Prototypes/CP14SkillPrototype.cs index d59aabdbd4..e7903889f3 100644 --- a/Content.Shared/_CP14/Skill/Prototypes/CP14SkillPrototype.cs +++ b/Content.Shared/_CP14/Skill/Prototypes/CP14SkillPrototype.cs @@ -1,5 +1,6 @@ using System.Numerics; -using Content.Shared._CP14.Skill.Specials; +using Content.Shared._CP14.Skill.Effects; +using Content.Shared._CP14.Skill.Restrictions; using Robust.Shared.Prototypes; using Robust.Shared.Utility; @@ -37,12 +38,6 @@ public sealed partial class CP14SkillPrototype : IPrototype [DataField] public float LearnCost = 1f; - /// - /// Prerequisites for this skill. This is used to determine if the player can learn the skill. If the player does not have all the prerequisites, they cannot learn the skill. - /// - [DataField] - public HashSet> Prerequisites = new(); - /// /// Skill UI position. This is used to determine where the skill will be displayed in the skill tree UI. /// @@ -61,4 +56,10 @@ public sealed partial class CP14SkillPrototype : IPrototype /// [DataField] public CP14SkillEffect? Effect; + + /// + /// Skill restriction. Limiters on learning. Any reason why a player cannot learn this skill. + /// + [DataField] + public List Restrictions = new(); } diff --git a/Content.Shared/_CP14/Skill/Restrictions/CP14SkillRestriction.cs b/Content.Shared/_CP14/Skill/Restrictions/CP14SkillRestriction.cs new file mode 100644 index 0000000000..01dda44d74 --- /dev/null +++ b/Content.Shared/_CP14/Skill/Restrictions/CP14SkillRestriction.cs @@ -0,0 +1,13 @@ +using JetBrains.Annotations; +using Robust.Shared.Prototypes; + +namespace Content.Shared._CP14.Skill.Restrictions; + +[ImplicitDataDefinitionForInheritors] +[MeansImplicitUse] +public abstract partial class CP14SkillRestriction +{ + public abstract bool Check(IEntityManager entManager, EntityUid target); + + public abstract string GetDescription(IEntityManager entManager, IPrototypeManager protoManager); +} diff --git a/Content.Shared/_CP14/Skill/Restrictions/NeedPrerequisite.cs b/Content.Shared/_CP14/Skill/Restrictions/NeedPrerequisite.cs new file mode 100644 index 0000000000..629706b8f1 --- /dev/null +++ b/Content.Shared/_CP14/Skill/Restrictions/NeedPrerequisite.cs @@ -0,0 +1,27 @@ +using Content.Shared._CP14.Skill.Components; +using Content.Shared._CP14.Skill.Prototypes; +using Robust.Shared.Prototypes; + +namespace Content.Shared._CP14.Skill.Restrictions; + +public sealed partial class NeedPrerequisite : CP14SkillRestriction +{ + [DataField(required: true)] + public ProtoId Prerequisite = new(); + + public override bool Check(IEntityManager entManager, EntityUid target) + { + if (!entManager.TryGetComponent(target, out var skillStorage)) + return false; + + var learned = skillStorage.LearnedSkills; + return learned.Contains(Prerequisite); + } + + public override string GetDescription(IEntityManager entManager, IPrototypeManager protoManager) + { + var skillSystem = entManager.System(); + + return Loc.GetString("cp14-skill-req-prerequisite", ("name", skillSystem.GetSkillName(Prerequisite))); + } +} diff --git a/Content.Shared/_CP14/Skill/Restrictions/SpeciesWhitelist.cs b/Content.Shared/_CP14/Skill/Restrictions/SpeciesWhitelist.cs new file mode 100644 index 0000000000..cc8b21a404 --- /dev/null +++ b/Content.Shared/_CP14/Skill/Restrictions/SpeciesWhitelist.cs @@ -0,0 +1,26 @@ +using Content.Shared.Humanoid; +using Content.Shared.Humanoid.Prototypes; +using Robust.Shared.Prototypes; + +namespace Content.Shared._CP14.Skill.Restrictions; + +public sealed partial class SpeciesWhitelist : CP14SkillRestriction +{ + [DataField(required: true)] + public ProtoId Species = new(); + + public override bool Check(IEntityManager entManager, EntityUid target) + { + if (!entManager.TryGetComponent(target, out var appearance)) + return false; + + return appearance.Species == Species; + } + + public override string GetDescription(IEntityManager entManager, IPrototypeManager protoManager) + { + var species = protoManager.Index(Species); + + return Loc.GetString("cp14-skill-req-species", ("name", Loc.GetString(species.Name))); + } +} diff --git a/Content.Shared/_CP14/Skill/Specials/CP14SkillEffect.cs b/Content.Shared/_CP14/Skill/Specials/CP14SkillEffect.cs deleted file mode 100644 index d5dc3403a8..0000000000 --- a/Content.Shared/_CP14/Skill/Specials/CP14SkillEffect.cs +++ /dev/null @@ -1,17 +0,0 @@ -using JetBrains.Annotations; -using Robust.Shared.Prototypes; - -namespace Content.Shared._CP14.Skill.Specials; - -[ImplicitDataDefinitionForInheritors] -[MeansImplicitUse] -public abstract partial class CP14SkillEffect -{ - public abstract void AddSkill(EntityManager entManager, EntityUid target); - - public abstract void RemoveSkill(EntityManager entManager, EntityUid target); - - public abstract string? GetName(EntityManager entMagager, IPrototypeManager protoManager); - - public abstract string? GetDescription(EntityManager entMagager, IPrototypeManager protoManager); -} diff --git a/Resources/Locale/en-US/_CP14/skill/requirements.ftl b/Resources/Locale/en-US/_CP14/skill/requirements.ftl new file mode 100644 index 0000000000..c627b45b0e --- /dev/null +++ b/Resources/Locale/en-US/_CP14/skill/requirements.ftl @@ -0,0 +1,2 @@ +cp14-skill-req-prerequisite = Skill "{$name}" must be learned. +cp14-skill-req-species = Available only to species "{$name}" \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_CP14/skill/requirements.ftl b/Resources/Locale/ru-RU/_CP14/skill/requirements.ftl new file mode 100644 index 0000000000..777930e29b --- /dev/null +++ b/Resources/Locale/ru-RU/_CP14/skill/requirements.ftl @@ -0,0 +1,2 @@ +cp14-skill-req-prerequisite = Навык "{$name}" должен быть изучен. +cp14-skill-req-species = Доступно только расе "{$name}" \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/T1_fire_rune.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/fire_rune.yml similarity index 100% rename from Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/T1_fire_rune.yml rename to Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/fire_rune.yml diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/T1_fireball.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/fireball.yml similarity index 100% rename from Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/T1_fireball.yml rename to Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/fireball.yml diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/T0_flame_creation.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/flame_creation.yml similarity index 100% rename from Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/T0_flame_creation.yml rename to Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/flame_creation.yml diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/T0_hell_ballade.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/hell_ballade.yml similarity index 100% rename from Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/T0_hell_ballade.yml rename to Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/hell_ballade.yml diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/T0_tiefling_inner_fire.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/tiefling_inner_fire.yml similarity index 100% rename from Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/T0_tiefling_inner_fire.yml rename to Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/tiefling_inner_fire.yml diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Life/sheep_polymorph.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Life/sheep_polymorph.yml index 854d150a2c..6ad1a98a63 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Life/sheep_polymorph.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Life/sheep_polymorph.yml @@ -24,8 +24,8 @@ - !type:Polymorph prototype: CP14Sheep - type: CP14MagicEffectVerbalAspect - startSpeech: "Pellis dolorem..." - endSpeech: "non novit" + startSpeech: "Pascam et custodiam..." + endSpeech: "pecora tua" - type: CP14MagicEffectCastingVisual proto: CP14RuneSheepPolymorph - type: EntityTargetAction diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/T0_mana_ballade.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/mana_ballade.yml similarity index 100% rename from Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/T0_mana_ballade.yml rename to Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/mana_ballade.yml diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/T0_mana_consume.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/mana_consume.yml similarity index 100% rename from Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/T0_mana_consume.yml rename to Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/mana_consume.yml diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/T0_mana_gift.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/mana_gift.yml similarity index 80% rename from Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/T0_mana_gift.yml rename to Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/mana_gift.yml index c64fd7776d..7b241fd9c0 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/T0_mana_gift.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/mana_gift.yml @@ -1,13 +1,3 @@ -- type: entity - id: CP14DummyActionSpellManaManipulation - name: Mana manipulation - description: You can manipulate mana by giving it to other objects or taking it from them. - categories: [ HideSpawnMenu ] - components: - - type: Sprite - sprite: _CP14/Actions/Spells/meta.rsi - state: mana - - type: entity id: CP14ActionSpellManaGift name: Mana transfer @@ -54,6 +44,25 @@ castTime: 10 breakOnMove: true +- type: entity + id: CP14ActionSpellManaGiftElf + parent: CP14ActionSpellManaGift + name: Carefull mana transfer + description: You transfer mana at a tremendous rate without dealing damage to the target. + components: + - type: CP14MagicEffectManaCost + manaCost: 20 + - type: CP14MagicEffect + effects: + - !type:CP14SpellSpawnEntityOnTarget + spawns: + - CP14ImpactEffectManaGift + - !type:CP14SpellApplyEntityEffect + effects: + - !type:CP14ManaChange + manaDelta: 20 + safe: true + - type: entity id: CP14RuneManaGift parent: CP14BaseMagicRune diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/T0_mana_splitting.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/mana_splitting.yml similarity index 100% rename from Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/T0_mana_splitting.yml rename to Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/mana_splitting.yml diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Physical/T0_Kick.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Physical/kick.yml similarity index 100% rename from Resources/Prototypes/_CP14/Entities/Actions/Spells/Physical/T0_Kick.yml rename to Resources/Prototypes/_CP14/Entities/Actions/Spells/Physical/kick.yml diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Physical/T0_Sprint.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Physical/sprint.yml similarity index 100% rename from Resources/Prototypes/_CP14/Entities/Actions/Spells/Physical/T0_Sprint.yml rename to Resources/Prototypes/_CP14/Entities/Actions/Spells/Physical/sprint.yml diff --git a/Resources/Prototypes/_CP14/Loadouts/skill_tree.yml b/Resources/Prototypes/_CP14/Loadouts/skill_tree.yml index f0fc9ca971..f93514f6aa 100644 --- a/Resources/Prototypes/_CP14/Loadouts/skill_tree.yml +++ b/Resources/Prototypes/_CP14/Loadouts/skill_tree.yml @@ -1,12 +1,12 @@ - type: loadoutGroup id: CP14SkillTree name: cp14-loadout-skill-tree - minLimit: 0 + minLimit: 2 maxLimit: 2 loadouts: - - CP14SkillTreePyrokinetic - - CP14SkillTreeHydrosophistry - CP14SkillTreeMetamagic + - CP14SkillTreeHydrosophistry + - CP14SkillTreePyrokinetic - CP14SkillTreeIllusion - CP14SkillTreeHealing - CP14SkillTreeAtlethic diff --git a/Resources/Prototypes/_CP14/Skill/atlethic.yml b/Resources/Prototypes/_CP14/Skill/atlethic.yml index e856b69d65..780da468c4 100644 --- a/Resources/Prototypes/_CP14/Skill/atlethic.yml +++ b/Resources/Prototypes/_CP14/Skill/atlethic.yml @@ -16,4 +16,21 @@ sprite: _CP14/Actions/Spells/physical.rsi state: sprint effect: !type:AddAction - action: CP14ActionSpellSprint \ No newline at end of file + action: CP14ActionSpellSprint + +- type: cp14Skill + id: CP14ActionSpellSprintGoblin + skillUiPosition: 2, 2 + learnCost: 0 + tree: Atlethic + icon: + sprite: _CP14/Actions/Spells/physical.rsi + state: sprint + effect: !type:ReplaceAction + oldAction: CP14ActionSpellSprint + newAction: CP14ActionSpellSprintGoblin + restrictions: + - !type:NeedPrerequisite + prerequisite: CP14ActionSpellSprint + - !type:SpeciesWhitelist + species: CP14Goblin \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Skill/hydrosophistry.yml b/Resources/Prototypes/_CP14/Skill/hydrosophistry.yml index 3920006885..af95644d63 100644 --- a/Resources/Prototypes/_CP14/Skill/hydrosophistry.yml +++ b/Resources/Prototypes/_CP14/Skill/hydrosophistry.yml @@ -27,6 +27,9 @@ state: beer_creation effect: !type:AddAction action: CP14ActionSpellBeerCreation + restrictions: + - !type:SpeciesWhitelist + species: CP14Dwarf - type: cp14Skill id: CP14ActionSpellIceShards diff --git a/Resources/Prototypes/_CP14/Skill/metamagic.yml b/Resources/Prototypes/_CP14/Skill/metamagic.yml index 7d52a92c38..74552479fa 100644 --- a/Resources/Prototypes/_CP14/Skill/metamagic.yml +++ b/Resources/Prototypes/_CP14/Skill/metamagic.yml @@ -20,16 +20,50 @@ action: CP14ActionSpellManaGift - type: cp14Skill - id: CP14ActionSpellManaConsume + id: CP14ActionSpellManaGiftElf skillUiPosition: 2, 2 learnCost: 0.5 tree: Metamagic + icon: + sprite: _CP14/Actions/Spells/meta.rsi + state: mana_gift + effect: !type:ReplaceAction + oldAction: CP14ActionSpellManaGift + newAction: CP14ActionSpellManaGiftElf + restrictions: + - !type:NeedPrerequisite + prerequisite: CP14ActionSpellManaGift + - !type:SpeciesWhitelist + species: CP14Elf + +- type: cp14Skill + id: CP14ActionSpellManaConsume + skillUiPosition: 0, 4 + learnCost: 0.5 + tree: Metamagic icon: sprite: _CP14/Actions/Spells/meta.rsi state: mana_consume effect: !type:AddAction action: CP14ActionSpellManaConsume +- type: cp14Skill + id: CP14ActionSpellManaConsumeElf + skillUiPosition: 2, 4 + learnCost: 0.5 + tree: Metamagic + icon: + sprite: _CP14/Actions/Spells/meta.rsi + state: mana_consume + effect: !type:ReplaceAction + oldAction: CP14ActionSpellManaConsume + newAction: CP14ActionSpellManaConsumeElf + restrictions: + - !type:NeedPrerequisite + prerequisite: CP14ActionSpellManaConsume + - !type:SpeciesWhitelist + species: CP14Elf + - type: cp14Skill id: CP14ActionSpellMagicBallade skillUiPosition: 0, 6 diff --git a/Resources/Prototypes/_CP14/Skill/pyrokinetic.yml b/Resources/Prototypes/_CP14/Skill/pyrokinetic.yml index 9a74f0a0df..ef5782ee55 100644 --- a/Resources/Prototypes/_CP14/Skill/pyrokinetic.yml +++ b/Resources/Prototypes/_CP14/Skill/pyrokinetic.yml @@ -10,10 +10,26 @@ - type: cp14Skill id: CP14ActionSpellHellBallade - skillUiPosition: 0, 10 + skillUiPosition: 0, 2 tree: Pyrokinetic icon: sprite: _CP14/Actions/Spells/fire.rsi state: fire_music effect: !type:AddAction - action: CP14ActionSpellHellBallade \ No newline at end of file + action: CP14ActionSpellHellBallade + restrictions: + - !type:SpeciesWhitelist + species: CP14Tiefling + +- type: cp14Skill + id: CP14ActionSpellTieflingInnerFire + skillUiPosition: 0, 4 + tree: Pyrokinetic + icon: + sprite: _CP14/Actions/Spells/fire.rsi + state: tiefling_revenge + effect: !type:AddAction + action: CP14ActionSpellTieflingInnerFire + restrictions: + - !type:SpeciesWhitelist + species: CP14Tiefling \ No newline at end of file