Merge pull request #5884 from jgray1206/chandras_embercat_fix

fixed chandras embercat issue #5880 + added unit tests for it
This commit is contained in:
Oleg Agafonov 2019-07-07 03:31:38 +02:00 committed by GitHub
commit aad5099a45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 148 additions and 4 deletions

View file

@ -0,0 +1,33 @@
package mage.abilities.mana.conditional;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.condition.Condition;
import mage.abilities.costs.Cost;
import mage.game.Game;
import java.util.UUID;
/**
* @author jgray1206
*/
public class PlaneswalkerCastManaCondition extends ManaCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
if (source instanceof SpellAbility) {
MageObject object = game.getObject(source.getSourceId());
if (object != null && object.isPlaneswalker()) {
return true;
}
}
return false;
}
@Override
public boolean apply(Game game, Ability source, UUID originalId, Cost costToPay) {
return apply(game, source);
}
}