mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 13:37:47 +03:00
# Description Some improvements to loadouts too. --- # TODO - [x] Points logic - [x] Server-side validation - [x] Categorize traits - [x] Assign points to traits - [x] Header costs - [x] Sort entries - [x] Max traits - [x] Communicate max traits - [x] Point bar - [x] Group exclusivity - Black outline on text - [x] Fix existing component whitelists --- <details><summary><h1>Media</h1></summary> <p> ## Accurate except for small details  ### Something to note:    </p> </details> --- # Changelog 🆑 - add: Added trait points - add: Added categories for traits --------- Co-authored-by: VMSolidus <evilexecutive@gmail.com>
44 lines
1.4 KiB
C#
44 lines
1.4 KiB
C#
using Content.Shared.Preferences;
|
|
using Content.Shared.Roles;
|
|
using Robust.Shared.Configuration;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Utility;
|
|
|
|
namespace Content.Shared.Customization.Systems;
|
|
|
|
|
|
public sealed class CharacterRequirementsSystem : EntitySystem
|
|
{
|
|
public bool CheckRequirementsValid(IPrototype prototype, List<CharacterRequirement> requirements, JobPrototype job,
|
|
HumanoidCharacterProfile profile, Dictionary<string, TimeSpan> playTimes,
|
|
IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager,
|
|
out List<FormattedMessage> reasons)
|
|
{
|
|
reasons = new List<FormattedMessage>();
|
|
var valid = true;
|
|
|
|
foreach (var requirement in requirements)
|
|
{
|
|
// Set valid to false if the requirement is invalid and not inverted
|
|
// If it's inverted set valid to false when it's valid
|
|
if (!requirement.IsValid(prototype, job, profile, playTimes,
|
|
entityManager, prototypeManager, configManager,
|
|
out var reason))
|
|
{
|
|
if (valid)
|
|
valid = requirement.Inverted;
|
|
}
|
|
else
|
|
{
|
|
if (valid)
|
|
valid = !requirement.Inverted;
|
|
}
|
|
|
|
if (reason != null) // To appease the compiler
|
|
reasons.Add(reason);
|
|
}
|
|
|
|
return valid;
|
|
}
|
|
}
|