Make suit storage only available for hardsuits, softsuits, and armor (#27546)
* AAAAAAAAAAAAdd! * o shit * I FUCKING HATE INDENTATION GRAAAAAAAAAH
This commit is contained in:
committed by
GitHub
parent
b55cf45ec5
commit
da2b9afc3a
10
Content.Shared/Armor/AllowSuitStorageComponent.cs
Normal file
10
Content.Shared/Armor/AllowSuitStorageComponent.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Content.Shared.Armor;
|
||||
|
||||
/// <summary>
|
||||
/// Used on outerclothing to allow use of suit storage
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed partial class AllowSuitStorageComponent : Component
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Shared.Armor;
|
||||
using Content.Shared.Clothing.Components;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Hands;
|
||||
@@ -114,7 +115,7 @@ public abstract partial class InventorySystem
|
||||
if (!_handsSystem.CanDropHeld(actor, hands.ActiveHand!, checkActionBlocker: false))
|
||||
return;
|
||||
|
||||
RaiseLocalEvent(held.Value, new HandDeselectedEvent(actor), false);
|
||||
RaiseLocalEvent(held.Value, new HandDeselectedEvent(actor));
|
||||
|
||||
TryEquip(actor, actor, held.Value, ev.Slot, predicted: true, inventory: inventory, force: true, checkDoafter:true);
|
||||
}
|
||||
@@ -243,9 +244,17 @@ public abstract partial class InventorySystem
|
||||
return false;
|
||||
|
||||
DebugTools.Assert(slotDefinition.Name == slot);
|
||||
if (slotDefinition.DependsOn != null && !TryGetSlotEntity(target, slotDefinition.DependsOn, out _, inventory))
|
||||
if (slotDefinition.DependsOn != null)
|
||||
{
|
||||
if (!TryGetSlotEntity(target, slotDefinition.DependsOn, out EntityUid? slotEntity, inventory))
|
||||
return false;
|
||||
|
||||
if (slotDefinition.DependsOnComponents is { } componentRegistry)
|
||||
foreach (var (_, entry) in componentRegistry)
|
||||
if (!HasComp(slotEntity, entry.Component.GetType()))
|
||||
return false;
|
||||
}
|
||||
|
||||
var fittingInPocket = slotDefinition.SlotFlags.HasFlag(SlotFlags.POCKET) &&
|
||||
item != null &&
|
||||
_item.GetSizePrototype(item.Size) <= _item.GetSizePrototype(PocketableItemSize);
|
||||
@@ -301,7 +310,6 @@ public abstract partial class InventorySystem
|
||||
reason = itemAttemptEvent.Reason ?? reason;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@ public sealed partial class SlotDefinition
|
||||
|
||||
[DataField("dependsOn")] public string? DependsOn { get; private set; }
|
||||
|
||||
[DataField("dependsOnComponents")] public ComponentRegistry? DependsOnComponents { get; private set; }
|
||||
|
||||
[DataField("displayName", required: true)]
|
||||
public string DisplayName { get; private set; } = string.Empty;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
Heat: 0.80
|
||||
- type: ExplosionResistance
|
||||
damageCoefficient: 0.90
|
||||
- type: AllowSuitStorage
|
||||
|
||||
#Alternate / slim basic armor vest
|
||||
- type: entity
|
||||
@@ -211,6 +212,7 @@
|
||||
- type: ExplosionResistance
|
||||
damageCoefficient: 0.65
|
||||
- type: GroupExamine
|
||||
- type: AllowSuitStorage
|
||||
|
||||
- type: entity
|
||||
parent: ClothingOuterBaseLarge
|
||||
|
||||
@@ -138,6 +138,7 @@
|
||||
- WhitelistChameleon
|
||||
- type: ClothingRequiredStepTriggerImmune
|
||||
slots: WITHOUT_POCKET
|
||||
- type: AllowSuitStorage
|
||||
|
||||
- type: entity
|
||||
abstract: true
|
||||
@@ -158,6 +159,7 @@
|
||||
size: Huge
|
||||
- type: ClothingRequiredStepTriggerImmune
|
||||
slots: WITHOUT_POCKET
|
||||
- type: AllowSuitStorage
|
||||
|
||||
- type: entity
|
||||
parent: ClothingOuterBase
|
||||
|
||||
@@ -137,4 +137,6 @@
|
||||
uiWindowPos: 2,0
|
||||
strippingWindowPos: 2,5
|
||||
dependsOn: outerClothing
|
||||
dependsOnComponents:
|
||||
- type: AllowSuitStorage
|
||||
displayName: Suit Storage
|
||||
|
||||
@@ -83,6 +83,8 @@
|
||||
uiWindowPos: 2,0
|
||||
strippingWindowPos: 2,5
|
||||
dependsOn: outerClothing
|
||||
dependsOnComponents:
|
||||
- type: AllowSuitStorage
|
||||
displayName: Suit Storage
|
||||
- name: belt
|
||||
slotTexture: belt
|
||||
|
||||
@@ -84,6 +84,8 @@
|
||||
uiWindowPos: 2,0
|
||||
strippingWindowPos: 2,5
|
||||
dependsOn: outerClothing
|
||||
dependsOnComponents:
|
||||
- type: AllowSuitStorage
|
||||
displayName: Suit Storage
|
||||
- name: id
|
||||
slotTexture: id
|
||||
|
||||
@@ -90,6 +90,8 @@
|
||||
uiWindowPos: 2,0
|
||||
strippingWindowPos: 2,5
|
||||
dependsOn: outerClothing
|
||||
dependsOnComponents:
|
||||
- type: AllowSuitStorage
|
||||
displayName: Suit Storage
|
||||
- name: id
|
||||
slotTexture: id
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
uiWindowPos: 2,0
|
||||
strippingWindowPos: 2,5
|
||||
dependsOn: outerClothing
|
||||
dependsOnComponents:
|
||||
- type: AllowSuitStorage
|
||||
displayName: Suit Storage
|
||||
- name: outerClothing
|
||||
slotTexture: suit
|
||||
|
||||
Reference in New Issue
Block a user