From 99aab9f409d1b88963cae64d7c80fcdb4f3b6f98 Mon Sep 17 00:00:00 2001 From: Julian Giebel Date: Tue, 23 Aug 2022 16:04:17 +0200 Subject: [PATCH] Adds the super speed smite (#10707) * Add super speed smite * Increase acceleration and speed so it can actually gib --- .../Systems/AdminVerbSystem.Smites.cs | 20 ++++++++++++++++++ .../Systems/MovementSpeedModifierSystem.cs | 11 ++++++++++ .../Locale/en-US/administration/smites.ftl | 2 ++ .../Interface/AdminActions/super_speed.png | Bin 0 -> 216 bytes 4 files changed, 33 insertions(+) create mode 100644 Resources/Textures/Interface/AdminActions/super_speed.png diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs index 7806f636bd..bb3cc42df4 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs @@ -37,6 +37,7 @@ using Content.Shared.Inventory; using Content.Shared.MobState; using Content.Shared.MobState.Components; using Content.Shared.Movement.Components; +using Content.Shared.Movement.Systems; using Content.Shared.Nutrition.Components; using Content.Shared.Popups; using Content.Shared.Tabletop.Components; @@ -70,6 +71,7 @@ public sealed partial class AdminVerbSystem [Dependency] private readonly TabletopSystem _tabletopSystem = default!; [Dependency] private readonly VomitSystem _vomitSystem = default!; [Dependency] private readonly WeldableSystem _weldableSystem = default!; + [Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifierSystem = default!; // All smite verbs have names so invokeverb works. private void AddSmiteVerbs(GetVerbsEvent args) @@ -810,5 +812,23 @@ public sealed partial class AdminVerbSystem Message = Loc.GetString("admin-smite-disarm-prone-description"), }; args.Verbs.Add(disarmProne); + + Verb superSpeed = new() + { + Text = "Super speed", + Category = VerbCategory.Smite, + IconTexture = "/Textures/Interface/AdminActions/super_speed.png", + Act = () => + { + var movementSpeed = EnsureComp(args.Target); + _movementSpeedModifierSystem?.ChangeBaseSpeed(args.Target, 400, 8000, 40, movementSpeed); + + _popupSystem.PopupEntity(Loc.GetString("admin-smite-super-speed-prompt"), args.Target, + Filter.Entities(args.Target), PopupType.LargeCaution); + }, + Impact = LogImpact.Extreme, + Message = Loc.GetString("admin-smite-super-speed-description"), + }; + args.Verbs.Add(superSpeed); } } diff --git a/Content.Shared/Movement/Systems/MovementSpeedModifierSystem.cs b/Content.Shared/Movement/Systems/MovementSpeedModifierSystem.cs index 1c03a9719f..1d43b635f8 100644 --- a/Content.Shared/Movement/Systems/MovementSpeedModifierSystem.cs +++ b/Content.Shared/Movement/Systems/MovementSpeedModifierSystem.cs @@ -51,6 +51,17 @@ namespace Content.Shared.Movement.Systems Dirty(move); } + public void ChangeBaseSpeed(EntityUid uid, float baseWalkSpeed, float baseSprintSpeed, float acceleration, MovementSpeedModifierComponent? move = null) + { + if (!Resolve(uid, ref move, false)) + return; + + move.BaseWalkSpeed = baseWalkSpeed; + move.BaseSprintSpeed = baseSprintSpeed; + move.Acceleration = acceleration; + Dirty(move); + } + [Serializable, NetSerializable] private sealed class MovementSpeedModifierComponentState : ComponentState { diff --git a/Resources/Locale/en-US/administration/smites.ftl b/Resources/Locale/en-US/administration/smites.ftl index d382162c77..56fb23f78b 100644 --- a/Resources/Locale/en-US/administration/smites.ftl +++ b/Resources/Locale/en-US/administration/smites.ftl @@ -11,6 +11,7 @@ admin-smite-remove-hands-other = {CAPITALIZE($name)}'s hands fall off! admin-smite-turned-ash-other = {CAPITALISE($name)} turns into a pile of ash! admin-smite-stomach-removal-self = Your stomach feels hollow... admin-smite-run-walk-swap-prompt = You have to press shift to run! +admin-smite-super-speed-prompt = You move at mach 0.8! admin-smite-lung-removal-self = You can't breath! @@ -47,6 +48,7 @@ admin-smite-maid-description = Forcibly converts them into a janitorial cat maid admin-smite-zoom-in-description = Zooms in their view so that they can no longer see their surroundings. admin-smite-flip-eye-description = Flips their view, effectively reversing their controls and making the game annoying to play. admin-smite-run-walk-swap-description = Swaps running and walking, forcing them to hold shift to move fast. +admin-smite-super-speed-description = Makes them really fast, causing them to turn into gibs when hitting a wall. admin-smite-stomach-removal-description = Removes their stomach, rendering them unable to eat. admin-smite-speak-backwards-description = Forces them to speak backwards, so they can't call for help. admin-smite-lung-removal-description = Removes their lungs, drowning them. diff --git a/Resources/Textures/Interface/AdminActions/super_speed.png b/Resources/Textures/Interface/AdminActions/super_speed.png new file mode 100644 index 0000000000000000000000000000000000000000..3c0abad1c27af85a6e1112013f176f720e7e80a3 GIT binary patch literal 216 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}lRRA5?^jYkuyu`m=2z z*`lVet#urX?j6Yx{N1Hs{CuIH!rTwPcDV&ydz))w9Ne;+IafiuKwt8AUDN*uRSM;o zqTl;BhSxezOAYEdaN=7)m!QPWx*V2!eh#t{cP9kedUf4QaTKVT#QgA!kEyYVMHSF> N44$rjF6*2UngF{cR3-ob literal 0 HcmV?d00001