diff --git a/Content.Server/Cuffs/Components/CuffableComponent.cs b/Content.Server/Cuffs/Components/CuffableComponent.cs index 9fdbdda562..d1e07fe1aa 100644 --- a/Content.Server/Cuffs/Components/CuffableComponent.cs +++ b/Content.Server/Cuffs/Components/CuffableComponent.cs @@ -17,6 +17,7 @@ using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.Player; +using Content.Server.Recycling.Components; namespace Content.Server.Cuffs.Components { @@ -270,6 +271,8 @@ namespace Content.Server.Cuffs.Components { sprite.LayerSetState(0, cuff.BrokenState); // TODO: safety check to see if RSI contains the state? } + + _entMan.AddComponent(cuffsToRemove.Value); } CanStillInteract = _entMan.TryGetComponent(Owner, out HandsComponent? handsComponent) && handsComponent.SortedHands.Count() > CuffedHandCount; diff --git a/Content.Server/MachineLinking/System/TwoWayLeverSystem.cs b/Content.Server/MachineLinking/System/TwoWayLeverSystem.cs index 72159c57fb..8a144a494a 100644 --- a/Content.Server/MachineLinking/System/TwoWayLeverSystem.cs +++ b/Content.Server/MachineLinking/System/TwoWayLeverSystem.cs @@ -1,6 +1,7 @@ using Content.Server.MachineLinking.Components; using Content.Shared.Interaction; using Content.Shared.MachineLinking; +using Content.Shared.Verbs; namespace Content.Server.MachineLinking.System { @@ -8,11 +9,15 @@ namespace Content.Server.MachineLinking.System { [Dependency] private readonly SignalLinkerSystem _signalSystem = default!; + const string _leftToggleImage = "rotate_ccw.svg.192dpi.png"; + const string _rightToggleImage = "rotate_cw.svg.192dpi.png"; + public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnInit); SubscribeLocalEvent(OnActivated); + SubscribeLocalEvent>(OnGetInteractionVerbs); } private void OnInit(EntityUid uid, TwoWayLeverComponent component, ComponentInit args) @@ -33,6 +38,56 @@ namespace Content.Server.MachineLinking.System _ => throw new ArgumentOutOfRangeException() }; + StateChanged(uid, component); + + args.Handled = true; + } + + private void OnGetInteractionVerbs(EntityUid uid, TwoWayLeverComponent component, GetVerbsEvent args) + { + InteractionVerb verbLeft = new() + { + Act = () => + { + component.State = component.State switch + { + TwoWayLeverState.Middle => TwoWayLeverState.Left, + TwoWayLeverState.Right => TwoWayLeverState.Middle, + _ => throw new ArgumentOutOfRangeException() + }; + StateChanged(uid, component); + }, + Message = Loc.GetString("two-way-lever-cant"), + Disabled = component.State == TwoWayLeverState.Left, + IconTexture = $"/Textures/Interface/VerbIcons/{_leftToggleImage}", + Text = Loc.GetString("two-way-lever-left"), + }; + + args.Verbs.Add(verbLeft); + + InteractionVerb verbRight = new() + { + Act = () => + { + component.State = component.State switch + { + TwoWayLeverState.Left => TwoWayLeverState.Middle, + TwoWayLeverState.Middle => TwoWayLeverState.Right, + _ => throw new ArgumentOutOfRangeException() + }; + StateChanged(uid, component); + }, + Message = Loc.GetString("two-way-lever-cant"), + Disabled = component.State == TwoWayLeverState.Right, + IconTexture = $"/Textures/Interface/VerbIcons/{_rightToggleImage}", + Text = Loc.GetString("two-way-lever-right"), + }; + + args.Verbs.Add(verbRight); + } + + private void StateChanged(EntityUid uid, TwoWayLeverComponent component) + { if (component.State == TwoWayLeverState.Middle) component.NextSignalLeft = !component.NextSignalLeft; @@ -48,7 +103,6 @@ namespace Content.Server.MachineLinking.System }; _signalSystem.InvokePort(uid, port); - args.Handled = true; } } } diff --git a/Content.Server/Recycling/Components/RecyclerComponent.cs b/Content.Server/Recycling/Components/RecyclerComponent.cs index f7634ac2f3..e9284680e2 100644 --- a/Content.Server/Recycling/Components/RecyclerComponent.cs +++ b/Content.Server/Recycling/Components/RecyclerComponent.cs @@ -43,5 +43,7 @@ namespace Content.Server.Recycling.Components // Ratelimit sounds to avoid spam public TimeSpan LastSound; + + public int ItemsProcessed; } } diff --git a/Content.Server/Recycling/RecyclerSystem.cs b/Content.Server/Recycling/RecyclerSystem.cs index 06eb407259..08a9f61558 100644 --- a/Content.Server/Recycling/RecyclerSystem.cs +++ b/Content.Server/Recycling/RecyclerSystem.cs @@ -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(OnExamined); SubscribeLocalEvent(OnCollide); SubscribeLocalEvent(OnEmagged); SubscribeLocalEvent(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) diff --git a/Resources/Locale/en-US/machine/machine.ftl b/Resources/Locale/en-US/machine/machine.ftl index 8b76e68f14..1a3fbfee2e 100644 --- a/Resources/Locale/en-US/machine/machine.ftl +++ b/Resources/Locale/en-US/machine/machine.ftl @@ -11,3 +11,9 @@ machine-upgrade-not-upgraded = [color=yellow]{CAPITALIZE($upgraded)}[/color] not upgrade-power-draw = power draw upgrade-max-charge = max charge upgrade-power-supply = power supply + +two-way-lever-left = push left +two-way-lever-right = push right +two-way-lever-cant = can't push the lever that way! + +recycler-count-items = Recycled {$items} objects. \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Clothing/Masks/masks.yml b/Resources/Prototypes/Entities/Clothing/Masks/masks.yml index 3c696fe83d..c100b93433 100644 --- a/Resources/Prototypes/Entities/Clothing/Masks/masks.yml +++ b/Resources/Prototypes/Entities/Clothing/Masks/masks.yml @@ -146,6 +146,7 @@ - type: Tag tags: - PetWearable + - type: Recyclable - type: entity parent: ClothingMaskBase diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_flasks.yml b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_flasks.yml index b90a79bf2f..11ece212d4 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_flasks.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_flasks.yml @@ -23,6 +23,8 @@ reagents: - ReagentId: Water Quantity: 50 + - type: TrashOnEmpty + solution: drink - type: entity parent: DrinkBase diff --git a/Resources/Prototypes/Entities/Objects/Misc/paper.yml b/Resources/Prototypes/Entities/Objects/Misc/paper.yml index 524b464baf..b2946b8e49 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/paper.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/paper.yml @@ -30,6 +30,7 @@ - Document - type: Appearance - type: PaperVisuals + - type: Recyclable - type: entity parent: Paper @@ -76,6 +77,7 @@ sprite: Objects/Misc/bureaucracy.rsi heldPrefix: pen size: 2 + - type: Recyclable - type: entity name: Cybersun pen diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/toy.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/toy.yml index 3909d4c28d..39542eccc2 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/toy.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/toy.yml @@ -12,3 +12,4 @@ sprite: Objects/Fun/toys.rsi layers: - state: foamdart + - type: Recyclable \ No newline at end of file