Files
wwdpublic/Content.Shared/Strip/ThievingSystem.cs
WarMechanic e06045ce58 Felinid Soft Thieving + Trait (#500)
<!--
This is a semi-strict format, you can add/remove sections as needed but
the order/format should be kept the same
Remove these comments before submitting
-->

# Description

<!--
Explain this PR in as much detail as applicable

Some example prompts to consider:
How might this affect the game? The codebase?
What might be some alternatives to this?
How/Who does this benefit/hurt [the game/codebase]?
-->

Reworks felinid thieving to no longer act like passive thieving gloves
which grant invisible stripping (hereon referred to as hard stealing),
in favour of soft thievery (hereon referred to as soft stealing).

Soft thievery comprises of the following:
- A smaller popup, with the thief anonymised.
- A visible doafter bar
- A 33% faster strip speed, that stacks with Thieving gloves
- An additional ability to identify hidden items to better plan your
course of action

You no longer need to completely avoid felinids to maintain your
precious items as long as you pay attention. For a felinid to utilise
their thieving passive, they are encouraged to exploit any distractions
to make moves on a target. If there is none, create one through
conversation or other forms of player interaction. If you are suspected,
persuade your victim that the thief is in fact, the other person.

A faster strip speed makes thief bonuses diegetic to other players, and
also improves the value proposition of thieving gloves on someone who
already has thieving bonuses.

Any other race can also gain soft thievery via a moderate costing trait.
Non-felinid thieves are encouraged to exploit any felinids as a
scapegoat.

---

# TODO

<!--
A list of everything you have to do before this PR is "complete"
You probably won't have to complete everything before merging but it's
good to leave future references
-->
Code
- [X] IgnoreStripHidden - allows thieves to look into peoples pockets
- [X] StripTimeMultiplier - stripping at a multiplicative rate helps
strip bags/belts which creates trait value
- [X] Stealthy > Stealth - rather than a bool, distinguishes stealth
levels as an enum

Balance
- [X] Soft thieves can identify items in pockets, which creates player
agency
- [X] Soft thieves steal 33% faster, which stacks with thieving gloves
- [X] Victims to soft stealing get a smaller popup, useful if they're
preoccupied
- [X] Soft thievery is a trait, which Felinids get for free
- [X] Felinids no longer hard steal items

Media
- [x] Attach media
---

<!--
This is default collapsed, readers click to expand it and see all your
media
The PR media section can get very large at times, so this is a good way
to keep it clean
The title is written using HTML tags
The title must be within the <summary> tags or you won't see it
-->

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


![image](https://github.com/Simple-Station/Einstein-Engines/assets/69510347/c0c6e81f-21e2-48c5-a535-777c1f683ef7)
![video](https://www.youtube.com/embed/elDfOgAPmIs?si=yV5JjOaSYvurGZer)
</p>
</details>

---

# Changelog

<!--
You can add an author after the `🆑` to change the name that appears
in the changelog (ex: `🆑 Death`)
Leaving it blank will default to your GitHub display name
This includes all available types for the changelog
-->

🆑
- add: Added the Thievery trait, which provides various soft stripping
bonuses
- tweak: Felinids no longer have passive thieving gloves, they instead
get the Thievery trait by default

---------

Signed-off-by: WarMechanic <69510347+WarMechanic@users.noreply.github.com>
Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com>
2024-07-05 13:49:24 -04:00

59 lines
1.6 KiB
C#

using Content.Shared.Inventory;
using Content.Shared.Popups;
using Content.Shared.Strip.Components;
using Robust.Shared.Serialization;
namespace Content.Shared.Strip;
public sealed class ThievingSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ThievingComponent, BeforeStripEvent>(OnBeforeStrip);
SubscribeLocalEvent<ThievingComponent, InventoryRelayedEvent<BeforeStripEvent>>((e, c, ev) => OnBeforeStrip(e, c, ev.Args));
}
private void OnBeforeStrip(EntityUid uid, ThievingComponent component, BeforeStripEvent args)
{
args.Stealth = (ThievingStealth) Math.Max((sbyte) args.Stealth, (sbyte) component.Stealth);
args.Additive -= component.StripTimeReduction;
args.Multiplier *= component.StripTimeMultiplier;
}
public PopupType? GetPopupTypeFromStealth(ThievingStealth stealth)
{
switch (stealth)
{
case ThievingStealth.Hidden:
return null;
case ThievingStealth.Subtle:
return PopupType.Small;
default:
return PopupType.Large;
}
}
}
[Serializable, NetSerializable]
public enum ThievingStealth : sbyte
{
/// <summary>
/// Target sees a large popup indicating that an item is being stolen by who
/// </summary>
Obvious = 0,
/// <summary>
/// Target sees a small popup indicating that an item is being stolen
/// </summary>
Subtle = 1,
/// <summary>
/// Target does not see any popup regarding the stealing of an item
/// </summary>
Hidden = 2
}