mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08:00
Merge pull request #5884 from jgray1206/chandras_embercat_fix
fixed chandras embercat issue #5880 + added unit tests for it
This commit is contained in:
commit
aad5099a45
3 changed files with 148 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue