-
Notifications
You must be signed in to change notification settings - Fork 824
Added castability highlighting for cards in hand #9383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
forge-gui-desktop/src/main/java/forge/view/arcane/CardPanel.java
Outdated
Show resolved
Hide resolved
forge-gui-desktop/src/main/java/forge/view/arcane/CardPanel.java
Outdated
Show resolved
Hide resolved
|
|
||
| // Get the game view to access the actual Game object | ||
| final var gameView = matchUI.getGameView(); | ||
| if (gameView == null) { |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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:
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