Syndicate gas mask flash protection (#8818)
* Syndicate gas masks protect from flashbangs * fix var name * update to loop through all slots * update based on review comments
This commit is contained in:
@@ -195,12 +195,13 @@ namespace Content.Server.Flash
|
|||||||
|
|
||||||
private void OnInventoryFlashAttempt(EntityUid uid, InventoryComponent component, FlashAttemptEvent args)
|
private void OnInventoryFlashAttempt(EntityUid uid, InventoryComponent component, FlashAttemptEvent args)
|
||||||
{
|
{
|
||||||
// Forward the event to a worn helmet, if one is equipped.
|
foreach (var slot in new string[]{"head", "eyes", "mask"})
|
||||||
if (_inventorySystem.TryGetSlotEntity(uid, "head", out var maskSlotEntity, component))
|
{
|
||||||
RaiseLocalEvent(maskSlotEntity.Value, args);
|
if (args.Cancelled)
|
||||||
// Forward the event to the glasses, if any.
|
break;
|
||||||
if(!args.Cancelled && _inventorySystem.TryGetSlotEntity(uid, "eyes", out var eyeSlotEntity, component))
|
if (_inventorySystem.TryGetSlotEntity(uid, slot, out var item, component))
|
||||||
RaiseLocalEvent(eyeSlotEntity.Value, args);
|
RaiseLocalEvent(item.Value, args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnFlashImmunityFlashAttempt(EntityUid uid, FlashImmunityComponent component, FlashAttemptEvent args)
|
private void OnFlashImmunityFlashAttempt(EntityUid uid, FlashImmunityComponent component, FlashAttemptEvent args)
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
- type: IngestionBlocker
|
- type: IngestionBlocker
|
||||||
- type: DiseaseProtection
|
- type: DiseaseProtection
|
||||||
protection: 0.05
|
protection: 0.05
|
||||||
|
- type: FlashImmunity
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: ClothingMaskBase
|
parent: ClothingMaskBase
|
||||||
|
|||||||
Reference in New Issue
Block a user