Add verbs to Two Way Levers, make some odds and ends recyclable. (#12660)

This commit is contained in:
Mervill
2022-11-19 08:05:44 -08:00
committed by GitHub
parent 6a59e1b376
commit ac828008a3
9 changed files with 81 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ using Content.Server.Recycling.Components;
using Content.Shared.Audio;
using Content.Shared.Body.Components;
using Content.Shared.Emag.Systems;
using Content.Shared.Examine;
using Content.Shared.IdentityManagement;
using Content.Shared.Interaction.Events;
using Content.Shared.Recycling;
@@ -33,11 +34,17 @@ namespace Content.Server.Recycling
public override void Initialize()
{
SubscribeLocalEvent<RecyclerComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<RecyclerComponent, StartCollideEvent>(OnCollide);
SubscribeLocalEvent<RecyclerComponent, GotEmaggedEvent>(OnEmagged);
SubscribeLocalEvent<RecyclerComponent, SuicideEvent>(OnSuicide);
}
private void OnExamined(EntityUid uid, RecyclerComponent component, ExaminedEvent args)
{
args.PushMarkup(Loc.GetString("recycler-count-items", ("items", component.ItemsProcessed)));
}
private void OnSuicide(EntityUid uid, RecyclerComponent component, SuicideEvent args)
{
if (args.Handled) return;
@@ -119,6 +126,8 @@ namespace Content.Server.Recycling
SoundSystem.Play(component.Sound.GetSound(), Filter.Pvs(component.Owner, entityManager: EntityManager), component.Owner, AudioHelpers.WithVariation(0.01f).WithVolume(-3));
component.LastSound = _timing.CurTime;
}
component.ItemsProcessed++;
}
private bool CanGib(RecyclerComponent component, EntityUid entity)