mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 19:11:59 -08:00
Fix Gitaxian Anatomist (#10960)
This commit is contained in:
parent
8fdae1dd70
commit
6d5d0ee60a
1 changed files with 38 additions and 2 deletions
|
|
@ -1,14 +1,18 @@
|
|||
package mage.cards.g;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.CostImpl;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.effects.common.counter.ProliferateEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -27,7 +31,7 @@ public final class GitaxianAnatomist extends CardImpl {
|
|||
|
||||
// When Gitaxian Anatomist enters the battlefield, you may tap it. If you do, proliferate.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(
|
||||
new DoIfCostPaid(new ProliferateEffect(), new TapSourceCost().setText("tap it"))
|
||||
new DoIfCostPaid(new ProliferateEffect(), new GitaxianAnatomistCost())
|
||||
));
|
||||
}
|
||||
|
||||
|
|
@ -40,3 +44,35 @@ public final class GitaxianAnatomist extends CardImpl {
|
|||
return new GitaxianAnatomist(this);
|
||||
}
|
||||
}
|
||||
|
||||
// TapSourceCost just does not work here as it is checking for permanent.canTap(game).
|
||||
class GitaxianAnatomistCost extends CostImpl {
|
||||
|
||||
public GitaxianAnatomistCost() {
|
||||
this.text = "tap it";
|
||||
}
|
||||
|
||||
public GitaxianAnatomistCost(GitaxianAnatomistCost cost) {
|
||||
super(cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pay(Ability ability, Game game, Ability source, UUID controllerId, boolean noMana, Cost costToPay) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
paid = permanent.tap(source, game);
|
||||
}
|
||||
return paid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPay(Ability ability, Ability source, UUID controllerId, Game game) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
return permanent != null && !permanent.isTapped();
|
||||
}
|
||||
|
||||
@Override
|
||||
public GitaxianAnatomistCost copy() {
|
||||
return new GitaxianAnatomistCost(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue