From e4beb38895515ebd2b53c00b946e1b2a799c9d3f Mon Sep 17 00:00:00 2001 From: ShawnieBoy Date: Fri, 19 Jun 2015 05:01:28 +0100 Subject: [PATCH] add Exotic Orchard to incomplete --- incomplete/Exotic_Orchard.groovy | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 incomplete/Exotic_Orchard.groovy diff --git a/incomplete/Exotic_Orchard.groovy b/incomplete/Exotic_Orchard.groovy new file mode 100644 index 0000000000..647ea51346 --- /dev/null +++ b/incomplete/Exotic_Orchard.groovy @@ -0,0 +1,26 @@ +def LAND_OPPONENT_CONTROLS = MagicTargetFilterFactory.permanent(MagicType.Land, Control.Opp); + +[ + new MagicStatic(MagicLayer.Ability) { + @Override + public void modAbilityFlags(final MagicPermanent source, final MagicPermanent permanent, final Set flags) { + final List manaTypes = new ArrayList(); + for (final MagicManaType coloredManaType : MagicManaType.ALL_COLORS) { //Color first to prevent duplicate colours. Can't use Set as MagicManaActivation requires List + for (final MagicPermanent land : LAND_OPPONENT_CONTROLS.filter(source)) { + for (final MagicManaActivation manaAbility : land.getManaActivations()) { + for (final MagicManaType generates : manaAbility.getManaTypes()){ + if (coloredManaType == generates) { + manaTypes.add(coloredManaType); + } + } + } + } + } + for (final MagicManaType mana : manaTypes) { + final MagicManaActivation landManaAbility = MagicManaActivation.create("{T}", manaTypes); + permanent.addAbility(landManaAbility); + } + } + } +] +//Too much scanning of the battlefield to determine types.