* Copy spells - improved combo support with other abilities like Kicker or Entwine (#7192):

* Now ZCC of copied spells syncs with source card or coping spell (allows to keep ability settings that depends on ZCC);
  * Fixed bug that allows to lost kicked status in copied spells after counter the original spell or moves the original card (see #7192);
  * Test framework: improved support of targeting copy or non copy spells on stack;
This commit is contained in:
Oleg Agafonov 2020-12-15 20:06:53 +04:00
parent 936be75a66
commit 4d362d7edc
32 changed files with 522 additions and 302 deletions

View file

@ -159,18 +159,30 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.KICKED, source.getSourceId(), source, source.getControllerId()));
}
private String getActivationKey(Ability source, String costText, Game game) {
int zcc = 0;
if (source.getAbilityType() == AbilityType.TRIGGERED) {
zcc = source.getSourceObjectZoneChangeCounter();
}
/**
* Return activation zcc key for searching spell's settings in source object
*
* @param source
* @param game
* @return
*/
public static String getActivationKey(Ability source, Game game) {
// must use ZCC from the moment of spell's ability activation
int zcc = source.getSourceObjectZoneChangeCounter();
if (zcc == 0) {
// if ability is not activated yet (example: triggered ability checking the kicker conditional)
zcc = game.getState().getZoneChangeCounter(source.getSourceId());
}
if (zcc > 0 && (source.getAbilityType() == AbilityType.TRIGGERED)) {
// triggers or activated abilities moves to stack and card's ZCC is changed -- so you must use workaround to find spell's zcc
if (source.getAbilityType() == AbilityType.TRIGGERED || source.getAbilityType() == AbilityType.ACTIVATED) {
--zcc;
}
return zcc + ((kickerCosts.size() > 1) ? costText : "");
return zcc + "";
}
private String getActivationKey(Ability source, String costText, Game game) {
return getActivationKey(source, game) + ((kickerCosts.size() > 1) ? costText : "");
}
@Override