Adds the super speed smite (#10707)

* Add super speed smite

* Increase acceleration and speed so it can actually gib
This commit is contained in:
Julian Giebel
2022-08-23 16:04:17 +02:00
committed by GitHub
parent 24090fcf9c
commit 99aab9f409
4 changed files with 33 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ using Content.Shared.Inventory;
using Content.Shared.MobState; using Content.Shared.MobState;
using Content.Shared.MobState.Components; using Content.Shared.MobState.Components;
using Content.Shared.Movement.Components; using Content.Shared.Movement.Components;
using Content.Shared.Movement.Systems;
using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.Components;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Tabletop.Components; using Content.Shared.Tabletop.Components;
@@ -70,6 +71,7 @@ public sealed partial class AdminVerbSystem
[Dependency] private readonly TabletopSystem _tabletopSystem = default!; [Dependency] private readonly TabletopSystem _tabletopSystem = default!;
[Dependency] private readonly VomitSystem _vomitSystem = default!; [Dependency] private readonly VomitSystem _vomitSystem = default!;
[Dependency] private readonly WeldableSystem _weldableSystem = default!; [Dependency] private readonly WeldableSystem _weldableSystem = default!;
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifierSystem = default!;
// All smite verbs have names so invokeverb works. // All smite verbs have names so invokeverb works.
private void AddSmiteVerbs(GetVerbsEvent<Verb> args) private void AddSmiteVerbs(GetVerbsEvent<Verb> args)
@@ -810,5 +812,23 @@ public sealed partial class AdminVerbSystem
Message = Loc.GetString("admin-smite-disarm-prone-description"), Message = Loc.GetString("admin-smite-disarm-prone-description"),
}; };
args.Verbs.Add(disarmProne); args.Verbs.Add(disarmProne);
Verb superSpeed = new()
{
Text = "Super speed",
Category = VerbCategory.Smite,
IconTexture = "/Textures/Interface/AdminActions/super_speed.png",
Act = () =>
{
var movementSpeed = EnsureComp<MovementSpeedModifierComponent>(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);
} }
} }

View File

@@ -51,6 +51,17 @@ namespace Content.Shared.Movement.Systems
Dirty(move); 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] [Serializable, NetSerializable]
private sealed class MovementSpeedModifierComponentState : ComponentState private sealed class MovementSpeedModifierComponentState : ComponentState
{ {

View File

@@ -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-turned-ash-other = {CAPITALISE($name)} turns into a pile of ash!
admin-smite-stomach-removal-self = Your stomach feels hollow... admin-smite-stomach-removal-self = Your stomach feels hollow...
admin-smite-run-walk-swap-prompt = You have to press shift to run! 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! 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-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-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-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-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-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. admin-smite-lung-removal-description = Removes their lungs, drowning them.

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B