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 System.Diagnostics.CodeAnalysis;
|
||||||
|
using Content.Shared.Armor;
|
||||||
using Content.Shared.Clothing.Components;
|
using Content.Shared.Clothing.Components;
|
||||||
using Content.Shared.DoAfter;
|
using Content.Shared.DoAfter;
|
||||||
using Content.Shared.Hands;
|
using Content.Shared.Hands;
|
||||||
@@ -114,7 +115,7 @@ public abstract partial class InventorySystem
|
|||||||
if (!_handsSystem.CanDropHeld(actor, hands.ActiveHand!, checkActionBlocker: false))
|
if (!_handsSystem.CanDropHeld(actor, hands.ActiveHand!, checkActionBlocker: false))
|
||||||
return;
|
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);
|
TryEquip(actor, actor, held.Value, ev.Slot, predicted: true, inventory: inventory, force: true, checkDoafter:true);
|
||||||
}
|
}
|
||||||
@@ -243,8 +244,16 @@ public abstract partial class InventorySystem
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
DebugTools.Assert(slotDefinition.Name == slot);
|
DebugTools.Assert(slotDefinition.Name == slot);
|
||||||
if (slotDefinition.DependsOn != null && !TryGetSlotEntity(target, slotDefinition.DependsOn, out _, inventory))
|
if (slotDefinition.DependsOn != null)
|
||||||
return false;
|
{
|
||||||
|
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) &&
|
var fittingInPocket = slotDefinition.SlotFlags.HasFlag(SlotFlags.POCKET) &&
|
||||||
item != null &&
|
item != null &&
|
||||||
@@ -301,7 +310,6 @@ public abstract partial class InventorySystem
|
|||||||
reason = itemAttemptEvent.Reason ?? reason;
|
reason = itemAttemptEvent.Reason ?? reason;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ public sealed partial class SlotDefinition
|
|||||||
|
|
||||||
[DataField("dependsOn")] public string? DependsOn { get; private set; }
|
[DataField("dependsOn")] public string? DependsOn { get; private set; }
|
||||||
|
|
||||||
|
[DataField("dependsOnComponents")] public ComponentRegistry? DependsOnComponents { get; private set; }
|
||||||
|
|
||||||
[DataField("displayName", required: true)]
|
[DataField("displayName", required: true)]
|
||||||
public string DisplayName { get; private set; } = string.Empty;
|
public string DisplayName { get; private set; } = string.Empty;
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
Heat: 0.80
|
Heat: 0.80
|
||||||
- type: ExplosionResistance
|
- type: ExplosionResistance
|
||||||
damageCoefficient: 0.90
|
damageCoefficient: 0.90
|
||||||
|
- type: AllowSuitStorage
|
||||||
|
|
||||||
#Alternate / slim basic armor vest
|
#Alternate / slim basic armor vest
|
||||||
- type: entity
|
- type: entity
|
||||||
@@ -211,6 +212,7 @@
|
|||||||
- type: ExplosionResistance
|
- type: ExplosionResistance
|
||||||
damageCoefficient: 0.65
|
damageCoefficient: 0.65
|
||||||
- type: GroupExamine
|
- type: GroupExamine
|
||||||
|
- type: AllowSuitStorage
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: ClothingOuterBaseLarge
|
parent: ClothingOuterBaseLarge
|
||||||
|
|||||||
@@ -138,6 +138,7 @@
|
|||||||
- WhitelistChameleon
|
- WhitelistChameleon
|
||||||
- type: ClothingRequiredStepTriggerImmune
|
- type: ClothingRequiredStepTriggerImmune
|
||||||
slots: WITHOUT_POCKET
|
slots: WITHOUT_POCKET
|
||||||
|
- type: AllowSuitStorage
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
abstract: true
|
abstract: true
|
||||||
@@ -158,6 +159,7 @@
|
|||||||
size: Huge
|
size: Huge
|
||||||
- type: ClothingRequiredStepTriggerImmune
|
- type: ClothingRequiredStepTriggerImmune
|
||||||
slots: WITHOUT_POCKET
|
slots: WITHOUT_POCKET
|
||||||
|
- type: AllowSuitStorage
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: ClothingOuterBase
|
parent: ClothingOuterBase
|
||||||
|
|||||||
@@ -137,4 +137,6 @@
|
|||||||
uiWindowPos: 2,0
|
uiWindowPos: 2,0
|
||||||
strippingWindowPos: 2,5
|
strippingWindowPos: 2,5
|
||||||
dependsOn: outerClothing
|
dependsOn: outerClothing
|
||||||
|
dependsOnComponents:
|
||||||
|
- type: AllowSuitStorage
|
||||||
displayName: Suit Storage
|
displayName: Suit Storage
|
||||||
|
|||||||
@@ -83,6 +83,8 @@
|
|||||||
uiWindowPos: 2,0
|
uiWindowPos: 2,0
|
||||||
strippingWindowPos: 2,5
|
strippingWindowPos: 2,5
|
||||||
dependsOn: outerClothing
|
dependsOn: outerClothing
|
||||||
|
dependsOnComponents:
|
||||||
|
- type: AllowSuitStorage
|
||||||
displayName: Suit Storage
|
displayName: Suit Storage
|
||||||
- name: belt
|
- name: belt
|
||||||
slotTexture: belt
|
slotTexture: belt
|
||||||
|
|||||||
@@ -84,6 +84,8 @@
|
|||||||
uiWindowPos: 2,0
|
uiWindowPos: 2,0
|
||||||
strippingWindowPos: 2,5
|
strippingWindowPos: 2,5
|
||||||
dependsOn: outerClothing
|
dependsOn: outerClothing
|
||||||
|
dependsOnComponents:
|
||||||
|
- type: AllowSuitStorage
|
||||||
displayName: Suit Storage
|
displayName: Suit Storage
|
||||||
- name: id
|
- name: id
|
||||||
slotTexture: id
|
slotTexture: id
|
||||||
|
|||||||
@@ -90,6 +90,8 @@
|
|||||||
uiWindowPos: 2,0
|
uiWindowPos: 2,0
|
||||||
strippingWindowPos: 2,5
|
strippingWindowPos: 2,5
|
||||||
dependsOn: outerClothing
|
dependsOn: outerClothing
|
||||||
|
dependsOnComponents:
|
||||||
|
- type: AllowSuitStorage
|
||||||
displayName: Suit Storage
|
displayName: Suit Storage
|
||||||
- name: id
|
- name: id
|
||||||
slotTexture: id
|
slotTexture: id
|
||||||
|
|||||||
@@ -45,6 +45,8 @@
|
|||||||
uiWindowPos: 2,0
|
uiWindowPos: 2,0
|
||||||
strippingWindowPos: 2,5
|
strippingWindowPos: 2,5
|
||||||
dependsOn: outerClothing
|
dependsOn: outerClothing
|
||||||
|
dependsOnComponents:
|
||||||
|
- type: AllowSuitStorage
|
||||||
displayName: Suit Storage
|
displayName: Suit Storage
|
||||||
- name: outerClothing
|
- name: outerClothing
|
||||||
slotTexture: suit
|
slotTexture: suit
|
||||||
|
|||||||
Reference in New Issue
Block a user