added Revered Unicorn and Necrogen Censer

master
beholder 2011-10-05 12:07:21 +02:00
parent 832f65a8a5
commit 8a7dedb646
3 changed files with 182 additions and 0 deletions

View File

@ -12042,3 +12042,24 @@ converted=2
cost={1}{W}
pt=2/1
timing=fmain
>Revered Unicorn
image=http://magiccards.info/scans/en/wl/139.jpg
value=2
rarity=U
type=Creature
subtype=Unicorn
color=w
converted=2
cost={1}{W}
pt=2/3
timing=main
>Necrogen Censer
image=http://magiccards.info/scans/en/som/184.jpg
value=3
rarity=C
type=Artifact
converted=3
cost={3}
timing=artifact

View File

@ -0,0 +1,86 @@
package magic.card;
import magic.model.MagicCounterType;
import magic.model.MagicGame;
import magic.model.MagicPayedCost;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.MagicSource;
import magic.model.action.MagicChangeCountersAction;
import magic.model.action.MagicChangeLifeAction;
import magic.model.action.MagicPlayerAction;
import magic.model.choice.MagicTargetChoice;
import magic.model.condition.MagicCondition;
import magic.model.event.MagicActivationHints;
import magic.model.event.MagicEvent;
import magic.model.event.MagicPermanentActivation;
import magic.model.event.MagicRemoveCounterEvent;
import magic.model.event.MagicTapEvent;
import magic.model.event.MagicTiming;
import magic.model.trigger.MagicWhenComesIntoPlayTrigger;
public class Necrogen_Censer {
public static final MagicPermanentActivation A = new MagicPermanentActivation(
new MagicCondition[]{
MagicCondition.CAN_TAP_CONDITION,
MagicCondition.CHARGE_COUNTER_CONDITION},
new MagicActivationHints(MagicTiming.Removal),
"Damage") {
@Override
public MagicEvent[] getCostEvent(final MagicSource source) {
final MagicPermanent permanent=(MagicPermanent)source;
return new MagicEvent[]{
new MagicTapEvent(permanent),
new MagicRemoveCounterEvent(permanent,MagicCounterType.Charge,1)};
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
source.getController(),
MagicTargetChoice.NEG_TARGET_PLAYER,
MagicEvent.NO_DATA,
this,
"Target player$ loses 2 life.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
event.processTargetPlayer(game,choiceResults,0,new MagicPlayerAction() {
public void doAction(final MagicPlayer player) {
game.doAction(new MagicChangeLifeAction(player,-2));
}
});
}
};
public static final MagicWhenComesIntoPlayTrigger T = new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
return new MagicEvent(
permanent,
player,
new Object[]{permanent},
this,
permanent + " enters the battlefield with two charge counters on it.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
game.doAction(new MagicChangeCountersAction((MagicPermanent)data[0],MagicCounterType.Charge,2,false));
}
@Override
public boolean usesStack() {
return false;
}
};
}

View File

@ -0,0 +1,75 @@
package magic.card;
import magic.model.MagicCounterType;
import magic.model.MagicGame;
import magic.model.MagicManaCost;
import magic.model.MagicPlayer;
import magic.model.MagicPermanent;
import magic.model.action.MagicChangeCountersAction;
import magic.model.action.MagicChangeLifeAction;
import magic.model.action.MagicSacrificeAction;
import magic.model.choice.MagicMayChoice;
import magic.model.choice.MagicPayManaCostChoice;
import magic.model.event.MagicEvent;
import magic.model.trigger.MagicAtUpkeepTrigger;
import magic.model.trigger.MagicWhenOtherPutIntoGraveyardFromPlayTrigger;
public class Revered_Unicorn {
public static final MagicAtUpkeepTrigger T = new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer data) {
if (permanent.getController() == data) {
game.doAction(new MagicChangeCountersAction(permanent,MagicCounterType.Charge,1,true));
final int amount = permanent.getCounters(MagicCounterType.Charge);
return new MagicEvent(
permanent,
permanent.getController(),
new MagicMayChoice(
"You may pay {"+amount+"}.",
new MagicPayManaCostChoice(MagicManaCost.createCost("{"+amount+"}"))),
new Object[]{permanent},
this,
"You may$ pay {"+amount+"}. If you don't, sacrifice " + permanent + ".");
}
return MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
if (MagicMayChoice.isNoChoice(choiceResults[0])) {
game.doAction(new MagicSacrificeAction((MagicPermanent)data[0]));
}
}
};
public static final MagicWhenOtherPutIntoGraveyardFromPlayTrigger T2 = new MagicWhenOtherPutIntoGraveyardFromPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent data) {
if (permanent == data) {
final MagicPlayer player = permanent.getController();
final int amount = permanent.getCounters(MagicCounterType.Charge);
return new MagicEvent(
permanent,
player,
new Object[]{player,amount},
this,
player + " gains " + amount + " life.");
}
return 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]));
}
};
}