Files
wwdpublic/Content.Shared/_EstacaoPirata/Cards/Stack/CardStackComponent.cs
RadsammyT bb612d3ac7 [Port] Playing Cards (#1451)
# Description

This ports Playing Cards from:
Estacao Pirata...
Frontier...
and GoobStation...

More specifically, ports
https://github.com/Goob-Station/Goob-Station/pull/1215 and
https://github.com/Goob-Station/Goob-Station/pull/1311 sequentially.

In short...
 - Adds 3 skins of the playing cards: Nanotrasen, Syndicate, and Black.
- NT can be obtained as an item in your loadout but is locked behind a
command job.
 - Syndicate can be obtained as a pointless item in the uplink for 1 TC.
- Black can be obtained both as an item in your loadout and from the
Games Vendor.

---

# TODO before review

<!--
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
-->

- [X] De-namespace all of (_)EstacaoPirata? (not required, it is an EE
fork)
- [X] **_TO MAINTAINERS/CONTRIBS, NEED YOUR INPUT!!!_**: See
`Content.Client/Inventory/StrippableBoundUserInterface.cs:220`'s "DRAFT
TODO". Basically its me asking how to involve the thieving trait in the
omission of the playing cards in the strip menu. Currently, it does not
take into account the trait and simply obscures. (prolly dont take the
trait into account, obscure regardless)
- [X] Figure out what to do with the Nanotrasen deck variant: should it
remain free like the black deck or restricted like the syndicate? Locked
behind any command job? (prolly this)
- [X] Get media actually filled in

---

<!--
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/user-attachments/assets/66c94a1d-4389-4a65-a547-c11c54efac42)

</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: Playing Cards. You may get one in the Games Vendor or as an item
in your loadout.

---------

Co-authored-by: VMSolidus <evilexecutive@gmail.com>
(cherry picked from commit 9b5cce20f185d8da3cdddd2fa6cad14ccd38db77)
2025-01-29 20:10:09 +03:00

84 lines
2.1 KiB
C#

using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared._EstacaoPirata.Cards.Stack;
/// <summary>
/// This is used for holding the prototype ids of the cards in the stack or hand.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class CardStackComponent : Component
{
[DataField]
public List<EntProtoId> InitialContent = [];
[DataField]
public SoundSpecifier ShuffleSound = new SoundCollectionSpecifier("cardFan");
[DataField]
public SoundSpecifier PickUpSound = new SoundCollectionSpecifier("cardSlide");
[DataField]
public SoundSpecifier PlaceDownSound = new SoundCollectionSpecifier("cardShove");
/// <summary>
/// The containers that contain the items held in the stack
/// </summary>
[ViewVariables]
public Container ItemContainer = default!;
/// <summary>
/// The list EntityUIds of Cards
/// </summary>
[DataField, AutoNetworkedField]
public List<EntityUid> Cards = [];
}
[Serializable, NetSerializable]
public sealed class CardStackInitiatedEvent(NetEntity cardStack) : EntityEventArgs
{
public NetEntity CardStack = cardStack;
}
/// <summary>
/// This gets Updated when new cards are added or removed from the stack
/// </summary>
[Serializable, NetSerializable]
public sealed class CardStackQuantityChangeEvent(NetEntity stack, NetEntity? card, StackQuantityChangeType type) : EntityEventArgs
{
public NetEntity Stack = stack;
public NetEntity? Card = card;
public StackQuantityChangeType Type = type;
}
[Serializable, NetSerializable]
public enum StackQuantityChangeType : sbyte
{
Added,
Removed,
Joined,
Split
}
[Serializable, NetSerializable]
public sealed class CardStackReorderedEvent(NetEntity stack) : EntityEventArgs
{
public NetEntity Stack = stack;
}
[Serializable, NetSerializable]
public sealed class CardStackFlippedEvent(NetEntity cardStack) : EntityEventArgs
{
public NetEntity CardStack = cardStack;
}