diff --git a/resources/magic/data/cards.txt b/resources/magic/data/cards.txt index 8dde9725ab..eeabc89fa6 100644 --- a/resources/magic/data/cards.txt +++ b/resources/magic/data/cards.txt @@ -15975,3 +15975,30 @@ cost={2}{B} pt=2/1 ability=shadow timing=main + +>Looter il-Kor +url=http://magiccards.info/ts/en/66.html +image=http://magiccards.info/scans/en/ts/66.jpg +value=2 +removal=2 +rarity=C +type=Creature +subtype=Kor,Rogue +color=u +converted=2 +cost={1}{U} +pt=1/1 +ability=shadow +timing=main + +>Shadowstorm +url=http://magiccards.info/tp/en/202.html +image=http://magiccards.info/scans/en/tp/202.jpg +value=2 +removal=1 +rarity=U +type=Sorcery +color=r +converted=1 +cost={R} +timing=removal diff --git a/src/magic/card/Looter_il_Kor.java b/src/magic/card/Looter_il_Kor.java new file mode 100644 index 0000000000..abd9c2d9dc --- /dev/null +++ b/src/magic/card/Looter_il_Kor.java @@ -0,0 +1,39 @@ +package magic.card; + +import magic.model.MagicDamage; +import magic.model.MagicGame; +import magic.model.MagicPermanent; +import magic.model.MagicPlayer; +import magic.model.action.MagicDrawAction; +import magic.model.event.MagicDiscardEvent; +import magic.model.event.MagicEvent; +import magic.model.trigger.MagicWhenDamageIsDealtTrigger; + +public class Looter_il_Kor { + public static final MagicWhenDamageIsDealtTrigger T = new MagicWhenDamageIsDealtTrigger() { + @Override + public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) { + final MagicPlayer player = permanent.getController(); + return (damage.getSource() == permanent && + damage.getTarget().isPlayer() && + damage.getTarget() != player) ? + new MagicEvent( + permanent, + player, + new Object[]{player,permanent}, + this, + player + " draws a card, then discards a card."): + MagicEvent.NONE; + } + @Override + public void executeEvent( + final MagicGame game, + final MagicEvent event, + final Object data[], + final Object[] choiceResults) { + final MagicPlayer player = (MagicPlayer)data[0]; + game.doAction(new MagicDrawAction(player,1)); + game.addEvent(new MagicDiscardEvent((MagicPermanent)data[1],player,1,false)); + } + }; +} diff --git a/src/magic/card/Shadowstorm.java b/src/magic/card/Shadowstorm.java new file mode 100644 index 0000000000..1055074e54 --- /dev/null +++ b/src/magic/card/Shadowstorm.java @@ -0,0 +1,47 @@ +package magic.card; + +import magic.model.MagicCard; +import magic.model.MagicDamage; +import magic.model.MagicGame; +import magic.model.MagicPayedCost; +import magic.model.MagicSource; +import magic.model.action.MagicDealDamageAction; +import magic.model.action.MagicMoveCardAction; +import magic.model.event.MagicEvent; +import magic.model.event.MagicSpellCardEvent; +import magic.model.stack.MagicCardOnStack; +import magic.model.target.MagicTarget; +import magic.model.target.MagicTargetFilter; + +import java.util.Collection; + +public class Shadowstorm { + public static final MagicSpellCardEvent S = new MagicSpellCardEvent() { + @Override + public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) { + final MagicCard card = cardOnStack.getCard(); + return new MagicEvent( + card, + cardOnStack.getController(), + new Object[]{cardOnStack}, + this, + card + " deals 2 damage to each creature with shadow."); + } + @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)); + final MagicSource source = cardOnStack.getCard(); + final Collection targets = + game.filterTargets(cardOnStack.getController(),MagicTargetFilter.TARGET_CREATURE_WITH_SHADOW); + for (final MagicTarget target : targets) { + final MagicDamage damage = new MagicDamage(source,target,2,false); + game.doAction(new MagicDealDamageAction(damage)); + } + } + }; +}