Fixed cards with multiple kicker costs not being copied correctly

This commit is contained in:
Daniel Bomar 2021-12-04 09:36:58 -06:00
parent a8f7cfa17d
commit fe3595c3f6
No known key found for this signature in database
GPG key ID: C86C8658F4023918

View file

@ -1,5 +1,6 @@
package mage.abilities.condition.common;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.abilities.keyword.KickerAbility;
@ -21,9 +22,9 @@ public class KickedCostCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(source.getSourceId());
if (card != null) {
for (Ability ability: card.getAbilities()) {
MageObject sourceObject = source.getSourceObject(game);
if (sourceObject instanceof Card) {
for (Ability ability : ((Card) sourceObject).getAbilities(game)) {
if (ability instanceof KickerAbility) {
return ((KickerAbility) ability).isKicked(game, source, kickerCostText);
}