forked from External/mage
Token's zone change counter (ZCC) improves:
* Now token's zcc uses same logic as card's zcc: enters to battlefield with +1 zcc instead +0 zcc * It can improve support of copied spells that store zcc related data (bug example: lost kicked status for copied spell/token); * Kicker abilities - improved support with copied creature spells (example: Verazol, the Split Current, #7431, #7433); * Refactor: simplified kicker code;
This commit is contained in:
parent
3eb57eade9
commit
f38639e1db
24 changed files with 262 additions and 177 deletions
|
|
@ -1149,4 +1149,24 @@ public final class CardUtil {
|
|||
}
|
||||
return CardUtil.getSourceLogName(game, " (source: ", source, ")", "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Find actual ZCC of source object, works in any moment (even before source ability activated)
|
||||
* <p>
|
||||
* Use case for usage: if you want to get actual object ZCC before ability resolve
|
||||
* (ability gets zcc after resolve/activate/trigger only -- ?wtf workaround to targets setup I think?)
|
||||
*
|
||||
* @param game
|
||||
* @param source
|
||||
* @return
|
||||
*/
|
||||
public static int getActualSourceObjectZoneChangeCounter(Game game, Ability source) {
|
||||
// current object zcc, find from source object (it can be permanent or spell on stack)
|
||||
int zcc = source.getSourceObjectZoneChangeCounter();
|
||||
if (zcc == 0) {
|
||||
// if ability is not activated yet then use current object's zcc (example: triggered etb ability checking the kicker conditional)
|
||||
zcc = game.getState().getZoneChangeCounter(source.getSourceId());
|
||||
}
|
||||
return zcc;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue