added Tribute to Hunger, Typhoid Rats, Unbreathing Horde

master
beholder 2011-10-01 09:25:46 +02:00
parent f5cde29568
commit 96698ba674
3 changed files with 188 additions and 0 deletions

View File

@ -5112,3 +5112,38 @@ cost={3}{G}
pt=0/13
ability=defender
timing=main
>Tribute to Hunger
image=http://magiccards.info/scans/en/isd/119.jpg
value=3
removal=2
rarity=U
type=Instant
color=b
converted=3
cost={2}{B}
timing=removal
>Typhoid Rats
image=http://magiccards.info/scans/en/isd/120.jpg
value=1
rarity=C
type=Creature
subtype=Rat
color=b
converted=1
cost={B}
pt=1/1
ability=deathtouch
timing=main
>Unbreathing Horde
image=http://magiccards.info/scans/en/isd/121.jpg
value=3
rarity=R
type=Creature
subtype=Zombie
color=b
converted=3
cost={2}{B}
timing=main

View File

@ -0,0 +1,75 @@
package magic.card;
import magic.model.MagicGame;
import magic.model.MagicPayedCost;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.MagicType;
import magic.model.action.MagicChangeLifeAction;
import magic.model.action.MagicMoveCardAction;
import magic.model.action.MagicPermanentAction;
import magic.model.action.MagicPlayerAction;
import magic.model.action.MagicSacrificeAction;
import magic.model.choice.MagicTargetChoice;
import magic.model.event.MagicEvent;
import magic.model.event.MagicEventAction;
import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
import magic.model.target.MagicSacrificeTargetPicker;
public class Tribute_to_Hunger {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final MagicPlayer player=cardOnStack.getController();
return new MagicEvent(
cardOnStack.getCard(),
player,
MagicTargetChoice.TARGET_OPPONENT,
new Object[]{cardOnStack,player},
this,
"Target opponent$ sacrifices a creature. " + player +
" gains life equal to that creature's toughness.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
final MagicCardOnStack cardOnStack = (MagicCardOnStack)data[0];
game.doAction(new MagicMoveCardAction(cardOnStack));
event.processTargetPlayer(game,choiceResults,0,new MagicPlayerAction() {
public void doAction(final MagicPlayer opponent) {
if (opponent.controlsPermanentWithType(MagicType.Creature,game)) {
game.addEvent(new MagicEvent(
cardOnStack.getCard(),
opponent,
MagicTargetChoice.SACRIFICE_CREATURE,
MagicSacrificeTargetPicker.getInstance(),
new Object[]{(MagicPlayer)data[1]},
EVENT_ACTION,
"Choose a creature to sacrifice$."));
}
}
});
}
};
private static final MagicEventAction EVENT_ACTION = new MagicEventAction() {
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
event.processTargetPermanent(game,choiceResults,0,new MagicPermanentAction() {
public void doAction(final MagicPermanent permanent) {
game.doAction(new MagicSacrificeAction(permanent));
final int toughness = permanent.getToughness(game);
game.doAction(new MagicChangeLifeAction((MagicPlayer)data[0],toughness));
}
});
}
};
}

View File

@ -0,0 +1,78 @@
package magic.card;
import magic.model.MagicCounterType;
import magic.model.MagicDamage;
import magic.model.MagicGame;
import magic.model.MagicPlayer;
import magic.model.MagicPermanent;
import magic.model.action.MagicChangeCountersAction;
import magic.model.event.MagicEvent;
import magic.model.target.MagicTargetFilter;
import magic.model.trigger.MagicIfDamageWouldBeDealtTrigger;
import magic.model.trigger.MagicWhenComesIntoPlayTrigger;
public class Unbreathing_Horde {
public static final MagicWhenComesIntoPlayTrigger T = new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
final MagicTargetFilter targetFilter = new MagicTargetFilter.MagicOtherPermanentTargetFilter(
MagicTargetFilter.TARGET_ZOMBIE_YOU_CONTROL,permanent);
int amount = game.filterTargets(player,targetFilter).size();
amount += game.filterTargets(player,MagicTargetFilter.TARGET_ZOMBIE_CARD_FROM_GRAVEYARD).size();
game.doAction(new MagicChangeCountersAction(
permanent,
MagicCounterType.PlusOne,
amount,
true));
return new MagicEvent(
permanent,
player,
new Object[]{permanent},
this,
permanent + " enters the battlefield with " +
amount + " +1/+1 counters on it.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
}
};
public static final MagicIfDamageWouldBeDealtTrigger T1 = new MagicIfDamageWouldBeDealtTrigger(4) {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicDamage damage) {
if (!damage.isUnpreventable() &&
damage.getAmount() > 0 &&
damage.getTarget() == permanent &&
permanent.getCounters(MagicCounterType.PlusOne) > 0) {
// Prevention effect.
damage.setAmount(0);
return new MagicEvent(
permanent,
permanent.getController(),
new Object[]{permanent},
this,
"Remove a +1/+1 counter from " + permanent + ".");
}
return MagicEvent.NONE;
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
game.doAction(new MagicChangeCountersAction(
(MagicPermanent)data[0],
MagicCounterType.PlusOne,
-1,
true));
}
};
}