Flashes, Expendablelights, and spray bottles will mark as trash when used up (#10430)
This commit is contained in:
@@ -10,6 +10,7 @@ using Content.Shared.Interaction.Events;
|
|||||||
using Content.Shared.Inventory;
|
using Content.Shared.Inventory;
|
||||||
using Content.Shared.Physics;
|
using Content.Shared.Physics;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
|
using Content.Shared.Tag;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
@@ -26,6 +27,7 @@ namespace Content.Server.Flash
|
|||||||
[Dependency] private readonly InventorySystem _inventorySystem = default!;
|
[Dependency] private readonly InventorySystem _inventorySystem = default!;
|
||||||
[Dependency] private readonly MetaDataSystem _metaSystem = default!;
|
[Dependency] private readonly MetaDataSystem _metaSystem = default!;
|
||||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||||
|
[Dependency] private readonly TagSystem _tagSystem = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -76,7 +78,7 @@ namespace Content.Server.Flash
|
|||||||
Flash(e, args.User, uid, comp.FlashDuration, comp.SlowTo);
|
Flash(e, args.User, uid, comp.FlashDuration, comp.SlowTo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnFlashUseInHand(EntityUid uid, FlashComponent comp, UseInHandEvent args)
|
private void OnFlashUseInHand(EntityUid uid, FlashComponent comp, UseInHandEvent args)
|
||||||
{
|
{
|
||||||
if (args.Handled || !UseFlash(comp, args.User))
|
if (args.Handled || !UseFlash(comp, args.User))
|
||||||
@@ -97,6 +99,8 @@ namespace Content.Server.Flash
|
|||||||
if (--comp.Uses == 0)
|
if (--comp.Uses == 0)
|
||||||
{
|
{
|
||||||
sprite.LayerSetState(0, "burnt");
|
sprite.LayerSetState(0, "burnt");
|
||||||
|
|
||||||
|
_tagSystem.AddTag(comp.Owner, "Trash");
|
||||||
comp.Owner.PopupMessage(user, Loc.GetString("flash-component-becomes-empty"));
|
comp.Owner.PopupMessage(user, Loc.GetString("flash-component-becomes-empty"));
|
||||||
}
|
}
|
||||||
else if (!comp.Flashing)
|
else if (!comp.Flashing)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using Content.Shared.Clothing.EntitySystems;
|
|||||||
using Content.Shared.Interaction.Events;
|
using Content.Shared.Interaction.Events;
|
||||||
using Content.Shared.Item;
|
using Content.Shared.Item;
|
||||||
using Content.Shared.Light.Component;
|
using Content.Shared.Light.Component;
|
||||||
|
using Content.Shared.Tag;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
@@ -17,6 +18,7 @@ namespace Content.Server.Light.EntitySystems
|
|||||||
{
|
{
|
||||||
[Dependency] private readonly SharedItemSystem _item = default!;
|
[Dependency] private readonly SharedItemSystem _item = default!;
|
||||||
[Dependency] private readonly ClothingSystem _clothing = default!;
|
[Dependency] private readonly ClothingSystem _clothing = default!;
|
||||||
|
[Dependency] private readonly TagSystem _tagSystem = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -60,6 +62,8 @@ namespace Content.Server.Light.EntitySystems
|
|||||||
meta.EntityName = Loc.GetString(component.SpentName);
|
meta.EntityName = Loc.GetString(component.SpentName);
|
||||||
meta.EntityDescription = Loc.GetString(component.SpentDesc);
|
meta.EntityDescription = Loc.GetString(component.SpentDesc);
|
||||||
|
|
||||||
|
_tagSystem.AddTag(component.Owner, "Trash");
|
||||||
|
|
||||||
UpdateSpriteAndSounds(component);
|
UpdateSpriteAndSounds(component);
|
||||||
UpdateVisualizer(component);
|
UpdateVisualizer(component);
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,9 @@
|
|||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Consumable/Food/skewer.rsi
|
sprite: Objects/Consumable/Food/skewer.rsi
|
||||||
state: skewer
|
state: skewer
|
||||||
|
- type: Tag
|
||||||
|
tags:
|
||||||
|
- Trash
|
||||||
|
|
||||||
# Custom Kebab Example
|
# Custom Kebab Example
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
sprayVelocity: 2
|
sprayVelocity: 2
|
||||||
spraySound:
|
spraySound:
|
||||||
path: /Audio/Effects/spray2.ogg
|
path: /Audio/Effects/spray2.ogg
|
||||||
|
- type: TrashOnEmpty
|
||||||
|
solution: spray
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: spray bottle
|
name: spray bottle
|
||||||
|
|||||||
@@ -78,6 +78,8 @@
|
|||||||
- type: SpaceGarbage
|
- type: SpaceGarbage
|
||||||
- type: StaticPrice
|
- type: StaticPrice
|
||||||
price: 75 # These are limited supply items.
|
price: 75 # These are limited supply items.
|
||||||
|
- type: TrashOnEmpty
|
||||||
|
solution: pen
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: emergency medipen
|
name: emergency medipen
|
||||||
|
|||||||
@@ -4,9 +4,6 @@
|
|||||||
id: GlowstickBase
|
id: GlowstickBase
|
||||||
description: Useful for raves and emergencies.
|
description: Useful for raves and emergencies.
|
||||||
components:
|
components:
|
||||||
- type: Tag
|
|
||||||
tags:
|
|
||||||
- Trash
|
|
||||||
- type: Recyclable
|
- type: Recyclable
|
||||||
- type: SpaceGarbage
|
- type: SpaceGarbage
|
||||||
- type: ExpendableLight
|
- type: ExpendableLight
|
||||||
|
|||||||
Reference in New Issue
Block a user