Playing cards (functional, not just props)

A place where new features are announced and discussed. (Feature suggestions go in the suggestions topic.)
Post Reply
User avatar
Rias
DEV
Posts: 2024
Joined: Sun Sep 03, 2017 4:06 pm
Location: Wandering Temicotli

Playing cards (functional, not just props)

Post by Rias »

Decks of playing cards are now available for purchase at a general store near you. These playing cards are functional, too:
hands
You are holding a deck of playing cards in your right hand.

look my cards
You take a closer look at a deck of Moonlighter playing cards ...
The image on the set of cards identifies it as a fairly standard Moonlighter deck of playing cards: Below a large crescent moon is a cloaked figure clutching a bulging pouch of riln, a single stylized eye gleaming out from the shadows of the figure's hood as it glances over its shoulder toward the viewer. Arguably the most widespread and popular deck of playing cards in the known world, the Moonlighter deck consists of four suits: Moons, Cloaks, Eyes, and Coins. Each suit contains 13 cards, for a total of 52 cards altogether.

You have the following 5 cards in your hand:
4 of moons
7 of moons
fool of cloaks
master of cloaks
fool of eyes


The following 2 cards are in play:
7 of coins
7 of eyes

There are 43 cards in the draw pile.
There are 2 cards in the discard pile, the top being a 4 of cloaks.

The following commands can be used to interact with your deck of Moonlighter playing cards:
discard
play
shuffle
draw
reset
sort
I'm actually not much of a cards guy myself, so if any functionality is lacking, let me know. There is currently no way to have a pooled draw or discard pile - you only interact with the single deck you're holding. You can however drop or give the deck to someone else, and someone else can pick up wherever you left off. That is to say: it's just one item, and all the cards data is contained within that single item, rather than each card being its own item.

I plan to add additional types of decks for various merchant events, festivals, etc. with varying suits and numbers of cards and all that, so people can come up with their own games and whatnot.

This started out as a simple desire to add a prop item, but then I ended up wanting to make them functional, and was a ton of fun to work on.
<Rias> PUT ON PANTS
<Fellborn> NO
Serity
Posts: 129
Joined: Wed Feb 16, 2022 2:59 pm

Re: Playing cards (functional, not just props)

Post by Serity »

Would it be possible to get some sort of multiplayer functionality going with these? As you say, the closest you can get is passing the deck around to people, but they all share the exact same hand, so a competitive element is difficult. Each person could buy their own deck, but nobody shares a draw or discard pile, so you end up with many duplicate cards.

As a potential solution, perhaps the deck could be placed in the room, and then you can use the cards command without holding it, then drawing from the deck creates a "hand of cards" object which communicates with, and is linked to, the deck that is in the room? Card Reset would then destroy all "hand of cards" objects linked with that deck. Dropping the hand of cards object would place all the cards in the linked deck's discard pile.
User avatar
Rias
DEV
Posts: 2024
Joined: Sun Sep 03, 2017 4:06 pm
Location: Wandering Temicotli

Re: Playing cards (functional, not just props)

Post by Rias »

Serity wrote: Sun Feb 27, 2022 7:35 pm Would it be possible to get some sort of multiplayer functionality going with these?
It's on the list! It's fiddly code to start with though, and making it involve multiple people (or decks) would make it moreso, so it's pretty low on that list.
<Rias> PUT ON PANTS
<Fellborn> NO
Post Reply