Skip to content

Commit

Permalink
add envirogloves + check group requiremnents in client loadout profil…
Browse files Browse the repository at this point in the history
…e editor
  • Loading branch information
angelofallars committed Dec 18, 2024
1 parent 3df970a commit 6d14167
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 19 deletions.
52 changes: 40 additions & 12 deletions Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Content.Shared.Humanoid.Markings;
using Content.Shared.Humanoid.Prototypes;
using Content.Shared.Preferences;
using Content.Shared.Prototypes;
using Content.Shared.Roles;
using Content.Shared.StatusIcon;
using Content.Shared.Traits;
Expand Down Expand Up @@ -2024,18 +2025,45 @@ public void UpdateLoadouts(bool? showUnusable = null, bool reload = false)
_loadouts.Clear();
foreach (var loadout in _prototypeManager.EnumeratePrototypes<LoadoutPrototype>())
{
var usable = _characterRequirementsSystem.CheckRequirementsValid(
loadout.Requirements,
highJob ?? new JobPrototype(),
Profile ?? HumanoidCharacterProfile.DefaultWithSpecies(),
_requirements.GetRawPlayTimeTrackers(),
_requirements.IsWhitelisted(),
loadout,
_entManager,
_prototypeManager,
_cfgManager,
out _
);
var groupUsable = loadout.Groups.Count == 0 ? true : false;

// Check group requirement reasons
foreach (var groupID in loadout.Groups)
{
if (!_prototypeManager.TryIndex<CharacterItemGroupPrototype>(groupID, out var group))
continue;

groupUsable = _characterRequirementsSystem.CheckRequirementsValid(
group.Requirements,
highJob ?? new JobPrototype(),
Profile ?? HumanoidCharacterProfile.DefaultWithSpecies(),
_requirements.GetRawPlayTimeTrackers(),
_requirements.IsWhitelisted(),
loadout,
_entManager,
_prototypeManager,
_cfgManager,
out _
);

if (groupUsable)
break;
}

var usable = groupUsable ?
_characterRequirementsSystem.CheckRequirementsValid(
loadout.Requirements,
highJob ?? new JobPrototype(),
Profile ?? HumanoidCharacterProfile.DefaultWithSpecies(),
_requirements.GetRawPlayTimeTrackers(),
_requirements.IsWhitelisted(),
loadout,
_entManager,
_prototypeManager,
_cfgManager,
out _
) : false;

_loadouts.Add(loadout, usable);

var list = _loadoutPreferences.ToList();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- type: characterItemGroup
id: LoadoutPlasmamanEnvirogloves
minItems: 1
maxItems: 1
requirements:
- !type:CharacterSpeciesRequirement
species:
- Plasmaman
items:
- type: loadout
id: LoadoutSpeciesHandsGlovesEnvirogloves
priority: 0
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@
modifiers:
coefficients:
Caustic: 0.95
- type: IgniteFromGasImmunity
11 changes: 5 additions & 6 deletions Resources/Prototypes/Entities/Clothing/Hands/envirogloves.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
name: plasma envirogloves
description: Covers up those scandalous boney hands.
components:
- type: Sprite # TODO fix error sprite on worn sprite related to this
sprite: Clothing/Hands/Gloves/Envirogloves/plasma.rsi
- type: Sprite
sprite: Clothing/Hands/Gloves/Color/color.rsi
layers:
- state: icon
color: "#913b00"
- type: Item
sprite: Clothing/Hands/Gloves/Color/color.rsi
inhandVisuals:
Expand All @@ -23,7 +26,3 @@
color: "#913b00"
- type: Fiber
fiberColor: fibers-orange
- type: Armor
modifiers:
coefficients:
Caustic: 0.95
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@
- type: IgniteFromGasImmunity
- type: EyeProtection
- type: BreathMask
- type: GroupExamine
- type: PressureProtection # Same as EVA helmet
highPressureMultiplier: 0.6
lowPressureMultiplier: 1000
Expand Down
12 changes: 12 additions & 0 deletions Resources/Prototypes/Loadouts/Generic/species.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,15 @@
exclusive: true
items:
- ClothingHeadEnvirohelm

- type: loadout
id: LoadoutSpeciesHandsGlovesEnvirogloves
category: Hands
groups: [ LoadoutPlasmamanEnvirogloves ]
cost: 0
exclusive: true
items:
- ClothingHandsGlovesEnvirogloves
requirements:
- !type:CharacterItemGroupRequirement
group: LoadoutGloves

0 comments on commit 6d14167

Please sign in to comment.