mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
convert the ability granted by Banishing Knack to Ability_Cost.
This commit is contained in:
@@ -2220,7 +2220,9 @@ public class CardFactory_Instants {
|
|||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
final Card creature = getTargetCard();
|
final Card creature = getTargetCard();
|
||||||
final Ability_Tap tBanish = new Ability_Tap(creature) {
|
Ability_Cost abCost = new Ability_Cost("T", creature.getName(), true);
|
||||||
|
Target tgt = new Target("Select target nonland permanent", new String[] {"Permanent.nonLand"});
|
||||||
|
final Ability_Activated tBanish = new Ability_Activated(creature, abCost, tgt) {
|
||||||
private static final long serialVersionUID = -1008113001678623984L;
|
private static final long serialVersionUID = -1008113001678623984L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -2233,29 +2235,16 @@ public class CardFactory_Instants {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(creature).append(" - Return").append(getTargetCard()).append("to its owner's hand");
|
sb.append(creature).append(" - Return").append(getTargetCard()).append("to its owner's hand");
|
||||||
setStackDescription(sb.toString());
|
setStackDescription(sb.toString());
|
||||||
final Card[] target = new Card[1];
|
|
||||||
target[0] = getTargetCard();
|
|
||||||
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, target[0].getOwner());
|
|
||||||
|
|
||||||
if(AllZone.GameAction.isCardInPlay(target[0])
|
final Card target = getTargetCard();
|
||||||
&& CardFactoryUtil.canTarget(creature, target[0])) {
|
if(AllZone.GameAction.isCardInPlay(target)
|
||||||
AllZone.GameAction.moveTo(hand, target[0]);
|
&& CardFactoryUtil.canTarget(creature, target)) {
|
||||||
|
AllZone.GameAction.moveToHand(target);
|
||||||
}
|
}
|
||||||
}//resolve()
|
}//resolve()
|
||||||
};//tBanish;
|
};//tBanish;
|
||||||
tBanish.setDescription("tap: Return target nonland permanent to its owner's hand.");
|
tBanish.setDescription(abCost+"Return target nonland permanent to its owner's hand.");
|
||||||
creature.addSpellAbility(tBanish);
|
creature.addSpellAbility(tBanish);
|
||||||
CardList all = new CardList();
|
|
||||||
all.addAll(AllZone.Human_Battlefield.getCards());
|
|
||||||
all.addAll(AllZone.Computer_Battlefield.getCards());
|
|
||||||
all = all.filter(new CardListFilter() {
|
|
||||||
public boolean addCard(Card c) {
|
|
||||||
return (!c.isLand() && CardFactoryUtil.canTarget(creature, c));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
tBanish.setBeforePayMana(CardFactoryUtil.input_targetSpecific(tBanish, all,
|
|
||||||
"Return target nonland permanent to its owner's hand.", true, false));
|
|
||||||
AllZone.EndOfTurn.addUntil(new Command() {
|
AllZone.EndOfTurn.addUntil(new Command() {
|
||||||
private static final long serialVersionUID = -7819140065166374666L;
|
private static final long serialVersionUID = -7819140065166374666L;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user