added Cradle of Vitality and Sanguine Bond

master
beholder 2011-09-20 16:38:13 +02:00
parent cbe89c0cdb
commit a4c93679ee
3 changed files with 111 additions and 0 deletions

View File

@ -6175,6 +6175,26 @@ converted=3
cost={2}{B}
timing=enchantment
>Cradle of Vitality
image=http://magiccards.info/scans/en/ala/7.jpg
value=4
rarity=R
type=Enchantment
color=w
converted=4
cost={3}{W}
timing=enchantment
>Sanguine Bond
image=http://magiccards.info/scans/en/m10/111.jpg
value=4
rarity=R
type=Enchantment
color=b
converted=5
cost={3}{B}{B}
timing=enchantment
>Call to the Grave
image=http://magiccards.info/scans/en/m12/85.jpg
value=4

View File

@ -0,0 +1,55 @@
package magic.card;
import magic.model.MagicCounterType;
import magic.model.MagicGame;
import magic.model.MagicManaCost;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.action.MagicChangeCountersAction;
import magic.model.action.MagicPermanentAction;
import magic.model.choice.MagicMayChoice;
import magic.model.choice.MagicPayManaCostChoice;
import magic.model.choice.MagicTargetChoice;
import magic.model.event.MagicEvent;
import magic.model.trigger.MagicWhenLifeIsGainedTrigger;
public class Cradle_of_Vitality {
public static final MagicWhenLifeIsGainedTrigger T = new MagicWhenLifeIsGainedTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final Object[] data) {
final MagicPlayer player = permanent.getController();
final int amount = (Integer)data[1];
return (player == (MagicPlayer)data[0]) ?
new MagicEvent(
permanent,
player,
new MagicMayChoice(
"You may pay {1}{W}.",
new MagicPayManaCostChoice(MagicManaCost.ONE_WHITE),
MagicTargetChoice.POS_TARGET_CREATURE),
new Object[]{amount},
this,
"You may$ pay {1}{W}$. If you do, put a +1/+1 counter " +
"on target creature$ for each 1 life you gained."):
MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
if (MagicMayChoice.isYesChoice(choiceResults[0])) {
event.processTargetPermanent(game,choiceResults,2,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
game.doAction(new MagicChangeCountersAction(
creature,
MagicCounterType.PlusOne,
(Integer)data[0],
true));
}
});
}
}
};
}

View File

@ -0,0 +1,36 @@
package magic.card;
import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.action.MagicChangeLifeAction;
import magic.model.event.MagicEvent;
import magic.model.trigger.MagicWhenLifeIsGainedTrigger;
public class Sanguine_Bond {
public static final MagicWhenLifeIsGainedTrigger T = new MagicWhenLifeIsGainedTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final Object[] data) {
final MagicPlayer player = permanent.getController();
final int amount = (Integer)data[1];
return (player == (MagicPlayer)data[0]) ?
new MagicEvent(
permanent,
player,
new Object[]{game.getOpponent(player),amount},
this,
game.getOpponent(player) + " loses "+amount+" life."):
MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
game.doAction(new MagicChangeLifeAction(
(MagicPlayer)data[0],
-(Integer)data[1]));
}
};
}