Skip to content

context.drawing_to_play_area - #1480

Open
nh6574 wants to merge 1 commit into
Steamodded:mainfrom
nh6574:drawing_to_play_area
Open

context.drawing_to_play_area#1480
nh6574 wants to merge 1 commit into
Steamodded:mainfrom
nh6574:drawing_to_play_area

Conversation

@nh6574

@nh6574 nh6574 commented Aug 4, 2026

Copy link
Copy Markdown
Member

Adds a context before cards are moved from G.hand to G.play for scoring allowing easy manipulation of played cards. It runs once for every card in G.hand and add_to_hand/remove_from_hand returns can be used to manipulate the played hand.

Also allows returning return_to_hand = true and adds card.ability.return_to_hand for the card to be able to come back to the hand instead of being discarded to bypass the use of context.stay_flipped.

Some considerations:

  • It doesn't handle the case where no cards are being added to the hand and it will just crash if the hand detected is not valid. I didn't add a case for this since I know some mods like Cryptid add null hands as a valid type and I don't recall other contexts handling similar cases. This can be avoided by checking #context.full_hand > 1 before removing (since context.full_hand is a reference to G.hand.highlighted and updates after each card.
  • Sorting the hand is somewhat awkward in this context since the cards are sorted by screen position immediately after. This seemed like the most logical behavior by default but it forces you to either sort the entire hand (G.hand I mean) manually or sort it in a later context like press_play or before

I take suggestions for a better name

Additional Info:

  • I didn't modify api's or I've made a PR to the wiki repo.
  • I didn't modify api's or I've updated lsp definitions.
  • I didn't make new lovely files or all new lovely files have appropriate priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant