added Allay and Anoint
parent
03233da0df
commit
55f642df8b
|
@ -17400,3 +17400,26 @@ color=g
|
|||
converted=1
|
||||
cost={G}
|
||||
timing=removal
|
||||
|
||||
>Allay
|
||||
url=http://magiccards.info/ex/en/1.html
|
||||
image=http://magiccards.info/scans/en/ex/1.jpg
|
||||
value=2
|
||||
removal=1
|
||||
rarity=C
|
||||
type=Instant
|
||||
color=w
|
||||
converted=2
|
||||
cost={1}{W}
|
||||
timing=removal
|
||||
|
||||
>Anoint
|
||||
url=http://magiccards.info/tp/en/215.html
|
||||
image=http://magiccards.info/scans/en/tp/215.jpg
|
||||
value=2
|
||||
rarity=C
|
||||
type=Instant
|
||||
color=w
|
||||
converted=1
|
||||
cost={W}
|
||||
timing=pump
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
package magic.card;
|
||||
|
||||
import magic.model.MagicGame;
|
||||
import magic.model.MagicLocationType;
|
||||
import magic.model.MagicManaCost;
|
||||
import magic.model.MagicPayedCost;
|
||||
import magic.model.MagicPermanent;
|
||||
import magic.model.action.MagicDestroyAction;
|
||||
import magic.model.action.MagicMoveCardAction;
|
||||
import magic.model.action.MagicPermanentAction;
|
||||
import magic.model.choice.MagicBuybackChoice;
|
||||
import magic.model.choice.MagicTargetChoice;
|
||||
import magic.model.event.MagicEvent;
|
||||
import magic.model.event.MagicSpellCardEvent;
|
||||
import magic.model.stack.MagicCardOnStack;
|
||||
import magic.model.target.MagicDestroyTargetPicker;
|
||||
|
||||
public class Allay {
|
||||
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
|
||||
@Override
|
||||
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
|
||||
return new MagicEvent(
|
||||
cardOnStack.getCard(),
|
||||
cardOnStack.getController(),
|
||||
new MagicBuybackChoice(
|
||||
MagicTargetChoice.NEG_TARGET_ENCHANTMENT,
|
||||
MagicManaCost.THREE),
|
||||
new MagicDestroyTargetPicker(false),
|
||||
new Object[]{cardOnStack},
|
||||
this,
|
||||
"Destroy target enchantment$. If the buyback cost was " +
|
||||
"payed$, return " + cardOnStack + " to its owner's " +
|
||||
"hand as it resolves.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event,
|
||||
final Object[] data,
|
||||
final Object[] choiceResults) {
|
||||
final MagicCardOnStack cardOnStack = (MagicCardOnStack)data[0];
|
||||
event.processTargetPermanent(game,choiceResults,0,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent permanent) {
|
||||
game.doAction(new MagicDestroyAction(permanent));
|
||||
}
|
||||
});
|
||||
if (MagicBuybackChoice.isYesChoice(choiceResults[1])) {
|
||||
game.doAction(new MagicMoveCardAction(
|
||||
cardOnStack.getCard(),
|
||||
MagicLocationType.Stack,
|
||||
MagicLocationType.OwnersHand));
|
||||
} else {
|
||||
game.doAction(new MagicMoveCardAction(cardOnStack));
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package magic.card;
|
||||
|
||||
import magic.model.MagicGame;
|
||||
import magic.model.MagicLocationType;
|
||||
import magic.model.MagicManaCost;
|
||||
import magic.model.MagicPayedCost;
|
||||
import magic.model.MagicPermanent;
|
||||
import magic.model.action.MagicMoveCardAction;
|
||||
import magic.model.action.MagicPermanentAction;
|
||||
import magic.model.action.MagicPreventDamageAction;
|
||||
import magic.model.choice.MagicBuybackChoice;
|
||||
import magic.model.choice.MagicTargetChoice;
|
||||
import magic.model.event.MagicEvent;
|
||||
import magic.model.event.MagicSpellCardEvent;
|
||||
import magic.model.stack.MagicCardOnStack;
|
||||
import magic.model.target.MagicPreventTargetPicker;
|
||||
|
||||
public class Anoint {
|
||||
public static final MagicSpellCardEvent E = new MagicSpellCardEvent() {
|
||||
@Override
|
||||
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
|
||||
return new MagicEvent(
|
||||
cardOnStack.getCard(),
|
||||
cardOnStack.getController(),
|
||||
new MagicBuybackChoice(
|
||||
MagicTargetChoice.POS_TARGET_CREATURE,
|
||||
MagicManaCost.THREE),
|
||||
MagicPreventTargetPicker.getInstance(),
|
||||
new Object[]{cardOnStack},
|
||||
this,
|
||||
"Prevent the next 3 damage that would be dealt to target " +
|
||||
"creature$ this turn. If the buyback cost was payed$, " +
|
||||
"return " + cardOnStack + " to its owner's hand as it resolves.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event,
|
||||
final Object[] data,
|
||||
final Object[] choiceResults) {
|
||||
final MagicCardOnStack cardOnStack = (MagicCardOnStack)data[0];
|
||||
event.processTargetPermanent(game,choiceResults,0,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent permanent) {
|
||||
game.doAction(new MagicPreventDamageAction(permanent,3));
|
||||
}
|
||||
});
|
||||
if (MagicBuybackChoice.isYesChoice(choiceResults[1])) {
|
||||
game.doAction(new MagicMoveCardAction(
|
||||
cardOnStack.getCard(),
|
||||
MagicLocationType.Stack,
|
||||
MagicLocationType.OwnersHand));
|
||||
} else {
|
||||
game.doAction(new MagicMoveCardAction(cardOnStack));
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue