Skip to content

Conversation

@jtomse
Copy link

@jtomse jtomse commented Dec 29, 2025

This adds my number one favorite QoL feature from other MTG implementations (DOTP, Magic Arena, etc.) - castability highlighting. Or in other words, the game uses a thin yellow border to highlight cards that you are able to cast at any given moment based on your available mana, timing, etc. This does not highlight all playable cards, only cards that have a mana cost. The option is toggled off by default. Makes looking at hand and deciding what you can cast much easier to parse.

Details:
Added a private helper method (canCastCard()) that checks if a card in hand can be cast with available mana. The method:

  1. Verifies the card is in hand
  2. Gets the actual Card object from the game by matching ID
  3. Retrieves all spell abilities for the card
  4. For each spell ability, checks if it can be played (timing/restrictions)
  5. Verifies the player can pay the mana cost using ComputerUtilMana.canPayManaCost()

If a card is castable, a thin yellow border is drawn using the same logic as the current green "hover" border

Also added a descriptive toggle in the in-game Preferences menu (towards the bottom of the "Graphics Options" section) to allow users to activate this new functionality as desired. Been meaning to get around to adding this for prob 10 years now lol.

All feedback welcomed and appreciated


// Get the game view to access the actual Game object
final var gameView = matchUI.getGameView();
if (gameView == null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the spacing here. It looks kinda weird.

sa.setActivatingPlayer(player);

// Check if the player can actually pay the mana cost from available sources
if (ComputerUtilMana.canPayManaCost(sa, player, 0, false)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit of a misnomer here, since the AI not being able to pay the mana cost doesn't mean its not able to be paid. Also there could be circumstances where there's no legal targets, or other costs are unable to be paid that this would bypass.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, it's really to show if you have the available mana to cast something so you don't have to count in your head. But it doesn't mean there's necessarily a valid target, or that you have enough life to pay the additional cost , or that playing the card won't trigger a game loss, etc. It also doesn't highlight cards with no mana cost that can be played (lands, zero CMC, etc.). It really is just a helper so you don't have to do a manual mana check/count each turn to see if you finally have enough mana of the right kind to cast that creature you've been waiting to cast, or if you've tapped 2 Plains and 3 Islands this turn, do you still have enough available to cast your other UW. Do you think renaming the feature is in order? Something other than castability highlighting like "Mana available" or somthing like that? Lmk what you think.

@Jetz72 Jetz72 added the QOL Quality of Life label Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Desktop GUI QOL Quality of Life

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants