* 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

@ -1,5 +1,3 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
@ -21,10 +19,15 @@ public enum KickedCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(source.getSourceId());
if (card == null) {
// if permanent spell was copied then it enters with sourceId = PermanentToken instead Card (example: Lithoform Engine)
card = game.getPermanentEntering(source.getSourceId());
}
if (card != null) {
for (Ability ability: card.getAbilities()) {
for (Ability ability : card.getAbilities()) {
if (ability instanceof KickerAbility) {
if(((KickerAbility) ability).isKicked(game, source, "")) {
if (((KickerAbility) ability).isKicked(game, source, "")) {
return true;
}
}