Adding shock collar and electropack (#30529)

* Adding shock collar with the new ShockOnTrigger

* Cleaning and updating the shock collar

* Add StripDelay datafield to ClothingComponent

* Adding SelfUnremovableClothingComponent

* ShockCollar Update

* Correction of the shock collar

* Correction of the shock collar 2

* Renaming the DamageSpecifier DataField to Damage

* Fixing the damage field in ShockCollar

* Cleaning the ShockCollar

* Renaming ShockCollar to ClothingNeckShockCollar

* Adding ClothingNeckShockCollar as a stealTarget to a thief

* Fixing a typo of the sprite path in ClothingNeckShockCollar

* Cleaning the ShockOnTriggerComponent

* Revision of SelfUnremovableClothing

* Adding a ClothingBackpackElectropack

* Sprite fix

* Code review

* Shock Collar sprite update

* add commit hash

---------

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
This commit is contained in:
to4no_fix
2024-08-15 17:30:39 +03:00
committed by GitHub
parent 02eed07e21
commit 6567fa36e4
29 changed files with 326 additions and 21 deletions

View File

@@ -28,13 +28,19 @@ public abstract class SharedStrippableSystem : EntitySystem
args.Handled = true;
}
public (TimeSpan Time, bool Stealth) GetStripTimeModifiers(EntityUid user, EntityUid target, TimeSpan initialTime)
/// <summary>
/// Modify the strip time via events. Raised directed at the item being stripped, the player stripping someone and the player being stripped.
/// </summary>
public (TimeSpan Time, bool Stealth) GetStripTimeModifiers(EntityUid user, EntityUid targetPlayer, EntityUid? targetItem, TimeSpan initialTime)
{
var userEv = new BeforeStripEvent(initialTime);
var itemEv = new BeforeItemStrippedEvent(initialTime, false);
if (targetItem != null)
RaiseLocalEvent(targetItem.Value, ref itemEv);
var userEv = new BeforeStripEvent(itemEv.Time, itemEv.Stealth);
RaiseLocalEvent(user, ref userEv);
var ev = new BeforeGettingStrippedEvent(userEv.Time, userEv.Stealth);
RaiseLocalEvent(target, ref ev);
return (ev.Time, ev.Stealth);
var targetEv = new BeforeGettingStrippedEvent(userEv.Time, userEv.Stealth);
RaiseLocalEvent(targetPlayer, ref targetEv);
return (targetEv.Time, targetEv.Stealth);
}
private void OnDragDrop(EntityUid uid, StrippableComponent component, ref DragDropDraggedEvent args)