* fuck all * clean up * remove knowledge books * Update base.yml * cl * fix #991 * fix * Update subgamemodes.yml * manual migration + recipes fix * Update comoss.yml * setup data * setup skills systems * more blacksmithing skills * Update base.yml * Create CP14SkillEffectAction.cs * skill button returns * base graph UI window * skill tree drawing * UI improve * pyro setup * skill trees selection, dragging control * refactor skill system: rename Skills to LearnedSkills, add experience tracking and learning logic * Create available.png * skill description generation setup * auto parsing skill names and descriptions * Hydrosophistry * water light fire and metamagic ported to skill tre * ice dagger spell returns * Update ice_dagger.yml * delete old files * Update modular_garde.yml * ice arrow spell * link graph with parallax * show experience counter * polish * puf * p * pipap * finally ready to merg? * fix * fix 2
56 lines
1.5 KiB
C#
56 lines
1.5 KiB
C#
using Content.Shared._CP14.Skill;
|
|
using Content.Shared._CP14.Skill.Prototypes;
|
|
using Content.Shared._CP14.Workbench.Prototypes;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Utility;
|
|
|
|
namespace Content.Shared._CP14.Workbench.Requirements;
|
|
|
|
public sealed partial class SkillRequired : CP14WorkbenchCraftRequirement
|
|
{
|
|
public override bool HideRecipe { get; set; } = true;
|
|
|
|
[DataField(required: true)]
|
|
public List<ProtoId<CP14SkillPrototype>> Skills = new();
|
|
|
|
public override bool CheckRequirement(EntityManager entManager,
|
|
IPrototypeManager protoManager,
|
|
HashSet<EntityUid> placedEntities,
|
|
EntityUid user,
|
|
CP14WorkbenchRecipePrototype recipe)
|
|
{
|
|
var knowledgeSystem = entManager.System<CP14SharedSkillSystem>();
|
|
|
|
var haveAllSkills = true;
|
|
foreach (var skill in Skills)
|
|
{
|
|
if (!knowledgeSystem.HaveSkill(user, skill))
|
|
{
|
|
haveAllSkills = false;
|
|
break;
|
|
}
|
|
}
|
|
|
|
return haveAllSkills;
|
|
}
|
|
|
|
public override void PostCraft(EntityManager entManager, HashSet<EntityUid> placedEntities, EntityUid user)
|
|
{
|
|
}
|
|
|
|
public override string GetRequirementTitle(IPrototypeManager protoManager)
|
|
{
|
|
return string.Empty;
|
|
}
|
|
|
|
public override EntityPrototype? GetRequirementEntityView(IPrototypeManager protoManager)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public override SpriteSpecifier? GetRequirementTexture(IPrototypeManager protoManager)
|
|
{
|
|
return null;
|
|
}
|
|
}
|