From a737ced1118c8e49548cf30553ac8a5701f0ee2d Mon Sep 17 00:00:00 2001 From: ShawnieBoy Date: Wed, 27 May 2015 15:02:52 +0100 Subject: [PATCH] add Soul of Ravnica to incomplete unable to get graveyard activation to function --- incomplete/Soul_of_Ravnica.groovy | 90 +++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 incomplete/Soul_of_Ravnica.groovy diff --git a/incomplete/Soul_of_Ravnica.groovy b/incomplete/Soul_of_Ravnica.groovy new file mode 100644 index 0000000000..3c33d6016d --- /dev/null +++ b/incomplete/Soul_of_Ravnica.groovy @@ -0,0 +1,90 @@ +[ + new MagicCardAbilityActivation( + [MagicCondition.GRAVEYARD_CONDITION], + new MagicActivationHints(MagicTiming.Draw), + "Draw" + ) { + + @Override + public Iterable getCostEvent(final MagicCard source) { + return [ + new MagicPayManaCostEvent(source, "{5}{U}{U}"), + new MagicExileSelfEvent(source, MagicLocationType.Graveyard) + ]; + } + + @Override + public MagicEvent getEvent(final MagicSource source) { + return new MagicEvent( + source, + new MagicEventAction() { + @Override + public void executeEvent(final MagicGame game, final MagicEvent event) { + final MagicAbilityOnStack abilityOnStack = new MagicAbilityOnStack( + MagicCardAbilityActivation.this, + getCardEvent(event.getCard(), game.getPayedCost()) + ); + game.doAction(new PutItemOnStackAction(abilityOnStack)); + } + }, + "" + ); + } + + @Override + public MagicEvent getCardEvent(final MagicCard source, final MagicPayedCost payedCost) { + return new MagicEvent( + source, + this, + "PN draws a card for each color among permanents he or she controls." + ); + } + + @Override + public void executeEvent(final MagicGame game, final MagicEvent event) { + final MagicPlayer player = event.getPlayer(); + int amount = 0; + for (final MagicColor color : MagicColor.values()) { + if (player.controlsPermanent(color)) { + amount++; + } + } + game.logAppendValue(player, amount); + game.doAction(new DrawAction(event.getPlayer(), amount)); + } + }, + + new MagicPermanentActivation( + new MagicActivationHints(MagicTiming.Draw), + "Draw" + ) { + + @Override + public Iterable getCostEvent(final MagicPermanent source) { + return [ + new MagicPayManaCostEvent(source, "{5}{U}{U}") + ]; + } + + public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) { + return new MagicEvent( + source, + this, + "PN draws a card for each color among permanents he or she controls." + ); + } + + @Override + public void executeEvent(final MagicGame game, final MagicEvent event) { + final MagicPlayer player = event.getPlayer(); + int amount = 0; + for (final MagicColor color : MagicColor.values()) { + if (player.controlsPermanent(color)) { + amount++; + } + } + game.logAppendValue(player, amount); + game.doAction(new DrawAction(event.getPlayer(), amount)); + } + } +]