notapixelstudio / starship-olympics

A fast-paced local party game with starships that battle in a 2d top-down arena
https://notapixel.itch.io/starship-olympics
Other
509 stars 43 forks source link

Handle multiple identical cards in hand in DraftArena #1081

Closed nitaku closed 1 year ago

nitaku commented 1 year ago

"Chaos World" currently contains the same card four times. This is intentional.

The Hand node in DraftArena checks if a card is in session.get_hand(), and the cards are exactly the same, so a card that has just been played is not graphically removed from hand.

Maybe we should use a sort of a card's instance? Maybe resources are not a good fit in this role, since they are unique (all these cards also share their internal state, which could be undesirable).

nitaku commented 1 year ago

I started to implement this by duplicating cards when they are dealt from their StartingDeck. This solved the issue of graphically remove the multiples in DraftArena's Hand node.

However, this caused many new issues. The get_id() method of duplicated resources does not work correctly, causing many parts of the game to fail to identify cards (such as TheUnlocker).

I linked a PR, but more work needs to be done.