magefree / magefree/mage

Auto clean exile zones from outdated cards (on source removed)

Open
#13,028 2 comments 1 reaction 0 assignees View on GitHub
enhancement refactoring
Dominant language
Java
Stars
2.4k
Forks
940
Avg merge
2d 12h
Merged PRs (30d)
160

Description

Many effects store exiled cards in own zone to make additional actions later in the game (cast from exile, boost, etc). When source card removed from battlefield (zcc changed) then such zone is outdated and will be never used again. User don't need such windows.

There are possible dozen of outdated exile windows in late game, card example: Keen-Eyed Curator
![shot_241024_220132](https://github.com/user-attachments/assets/3f8a398f-19e1-4395-ab32-f5d12b7cdd3f)

So there are must be some tools to auto-clean it like `cleanupOnEndTurn`. As example: `cleanupOnOutdate(MageObjectReference mor)` and check it on cleanup code with end of turn or in other place.

Possible usage in `ExileTargetForSourceEffect`:
![shot_241024_220818](https://github.com/user-attachments/assets/198983cc-dff4-4825-badd-9d09d43acc7b)

Other potentially places with usage of:
* `.moveCardsToExile(`
* `getExile().createZone(`
* and other

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing ExileTargetForSourceEffect and the cleanupOnEndTurn flow, then search for moveCardsToExile and getExile().createZone as suggested. Determine how source removal and MageObjectReference changes are represented before assessing the proposed cleanupOnOutdate approach. Done means outdated source-linked exile zones are automatically removed without affecting still-valid zones.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.