Files
wwdpublic/Content.Server/Traits/Assorted/LayingDownModifierSystem.cs
Mnemotechnican 64f30dca54 Feat: Togglable Under-Table Crawling (#1036)
# Description
This reverts most code changes done by
https://github.com/Simple-Station/Einstein-Engines/pull/939 and
re-implements them in a better way:
- Players can now toggle under-furniture crawling with a keybind
(shift-R by default)
- Crawling that way is 50% slower for obvious balancing reasons
- The respective cvar for it is now true by default and prevents players
from beginning the "crawl under furniture" thing

Also cleaned up a few methods I was seriously pissed off by. There is
still a lot to clean up and fix, but I will leave it for a dedicated PR
in the future.

# Why (balancing)
Let me lie on the bed instead of under it!!!!!!!

<details><summary><h1>Media</h1></summary>
<p>


https://github.com/user-attachments/assets/5f04c82a-b88b-4005-8052-a1a6f011bcc9

</p>
</details>

# Changelog
🆑
- add: You can now toggle crawling under furniture! The default keybind
is Shift-R, you can change it in settings.
2024-10-19 13:45:49 +07:00

23 lines
716 B
C#

using Content.Server.Traits.Assorted;
using Content.Shared.Standing;
namespace Content.Shared.Traits.Assorted.Systems;
public sealed class LayingDownModifierSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<LayingDownModifierComponent, ComponentStartup>(OnStartup);
}
private void OnStartup(EntityUid uid, LayingDownModifierComponent component, ComponentStartup args)
{
if (!TryComp<LayingDownComponent>(uid, out var layingDown))
return;
layingDown.StandingUpTime *= component.LayingDownCooldownMultiplier;
layingDown.LyingSpeedModifier *= component.DownedSpeedMultiplierMultiplier;
}
}