Hardsuits, EVA suits, Firesuits, and others now protect your feet from Glass Shards (#26764)

* Hardsuits and softsuits count as having shoes for step triggers

* Add softsuit tag prototype

* Change to suitEVA tag

* Get rid of softsuit tag, found suitEVA tag

* Full pass of ShoesRequiredStepTriggerImmune

* Adds check to outerClothing for ShoesRequiredStepTriggerImmune

* return

* fuck Dionas

* Convert to comp, space dragons immune as well

* Merge conflict

* Merge conflict

* fix leftover tags

* empty spaces

* turns out the dragon didn't need it

* minor optimization

* Add access for system, add comp to baseShoes, check slotflags for every slot besides pockets

* fix

* fuck it we ball

---------

Co-authored-by: Plykiya <plykiya@protonmail.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Plykiya
2024-04-28 00:11:46 -07:00
committed by GitHub
parent db200faf11
commit 0efcd30ac6
22 changed files with 164 additions and 86 deletions

View File

@@ -27,6 +27,31 @@ public partial class InventorySystem : EntitySystem
.RemoveHandler(HandleViewVariablesSlots, ListViewVariablesSlots);
}
/// <summary>
/// Tries to find an entity in the specified slot with the specified component.
/// </summary>
public bool TryGetInventoryEntity<T>(Entity<InventoryComponent?> entity, out EntityUid targetUid)
where T : IComponent, IClothingSlots
{
if (TryGetContainerSlotEnumerator(entity.Owner, out var containerSlotEnumerator))
{
while (containerSlotEnumerator.NextItem(out var item, out var slot))
{
if (!TryComp<T>(item, out var required))
continue;
if ((((IClothingSlots) required).Slots & slot.SlotFlags) == 0x0)
continue;
targetUid = item;
return true;
}
}
targetUid = EntityUid.Invalid;
return false;
}
protected virtual void OnInit(EntityUid uid, InventoryComponent component, ComponentInit args)
{
if (!_prototypeManager.TryIndex(component.TemplateId, out InventoryTemplatePrototype? invTemplate))