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:
Oleg Agafonov 2021-02-04 19:15:54 +04:00
parent 3eb57eade9
commit f38639e1db
24 changed files with 262 additions and 177 deletions

View file

@ -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;
}
}