Dev Discussion: have some shared exileId code when relevant
- Dominant language
- Java
- Stars
- 2.4k
- Forks
- 940
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 160
Description
So working on [[Savvy Trader]], I realized it would be better if at most 1 exile zone was opened per player. As Savvy Trader has no linked ability that would care about the card in exile.
https://github.com/magefree/mage/blob/9da91b51eac827e317e03e0ad248e6b11ada9f2f/Mage.Sets/src/mage/cards/s/SavvyTrader.java#L99-L101
(I realize writing this post that the exileName should be more like the card's text "for as long as the cards are exiled", instead of "until end of game", will fix it right after)
But more than that, it does not matter if a card is exiled by Savvy Hunter effect or [[Extraordinary Journey]] effect, it should go in the shared exile zone where, and not open one new exile zone per effect.
I propose that we introduce a ExileZonesUtil class, where card/effect code could retrieve keys for the shared zones.
A shared exile zone could also have auto settings of when it should be auto cleared (like for instance a shared zone of cards you may play until end of turn). So maybe the util code should actually create the ExileZone if it does not exist and create it with the right settings?
Then a slow rework of the individual cards/effects to replace the current per-card/per-source code. Only when the cards should not have a specific per-source exile zone for linked abilities and the like. If there is a difference in duration (until end of your next turn should be 1 different exile per 'your next turn'). You may play/You may cast zones should be different, as zones for card that may play using any type of mana, any color or mana, or without paying mana cost. But all that should be clear on effect resolution anyway.
Face down should not matter? Like there could be a shared zone between [[Gonti, Lord of Luxury]] and [[Dead Man's Chest]], just some of the cards in it are face down.
As another grouping that makes sense [[Abbot of Keral Keep]] [[Act on Impulse]] and [[Experimental Synthesizer]] could all have a shared zone per (player, turn number), and I'm sure there are many others that could benefit from zone grouping.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with Mage.Sets/src/mage/cards/s/SavvyTrader.java around lines 99-101 and compare the linked exile-zone behavior with the issue's examples, including Extraordinary Journey. Review the proposed ExileZonesUtil design and determine how shared zones, durations, play or cast permissions, and linked abilities should be grouped. Done means an agreed design and a coordinated rework of the affected card and effect code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- game-dev
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100