This repository has been archived by the owner on Dec 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
What else can ya ask for. There needs to be a proper way to specify skill requirements in YAML, likely a serializable struct. There's a basis for that commented out in the main System at the moment but I wanted to test if it actually worked. Other than that, I suppose it's just a matter of refining, helper functions, and of course, implementation.
- Loading branch information
1 parent
66175f0
commit 9744437
Showing
11 changed files
with
440 additions
and
308 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
Content.Server/SimpleStation14/Skills/RoleSkillsSpecial.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Content.Shared.Roles; | ||
using Content.Shared.SimpleStation14.Skills.Prototypes; | ||
using Content.Shared.SimpleStation14.Skills.Systems; | ||
using JetBrains.Annotations; | ||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary; | ||
|
||
namespace Content.Server.SimpleStation14.Skills; | ||
|
||
/// <summary> | ||
/// Adds to an Entity's skills on equip. | ||
/// </summary> | ||
[UsedImplicitly] | ||
public sealed class RoleSkillsSpecial : JobSpecial | ||
{ | ||
|
||
[DataField("skills", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<int, SkillPrototype>))] | ||
public Dictionary<string, int> Skills { get; } = new(); | ||
|
||
public override void AfterEquip(EntityUid mob) | ||
{ | ||
var entMan = IoCManager.Resolve<IEntityManager>(); | ||
var skillSystem = entMan.System<SharedSkillsSystem>(); | ||
|
||
foreach (var skill in Skills) | ||
skillSystem.TryModifySkillLevel(mob, skill.Key, skill.Value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.