From 8220f404c6332f359b665a9ded93288d51c791bd Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 19 Apr 2013 15:17:30 +0200 Subject: [PATCH] Fixed #202 Simic Manipulator didn't work correct with (un)boosted P/T. Also fixed duration of control effect that only lasted while Simi Manipulator was on the battlefield. --- .../mage/sets/gatecrash/SimicManipulator.java | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Mage.Sets/src/mage/sets/gatecrash/SimicManipulator.java b/Mage.Sets/src/mage/sets/gatecrash/SimicManipulator.java index 7ab0de306d6..9c3da52b972 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/SimicManipulator.java +++ b/Mage.Sets/src/mage/sets/gatecrash/SimicManipulator.java @@ -81,8 +81,8 @@ public class SimicManipulator extends CardImpl { // {tap}, Remove one or more +1/+1 counters from Simic Manipulator: Gain control of target creature with power less than or equal to the number of +1/+1 counters removed this way. // TODO: Improve targeting, that only valid targets (power <= removed counters) can be choosen - // Disadvante now is, that a creature can be targeted that couldn't be targeted by rules. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SimicManipulatorGainControlTargetEffect(Duration.WhileOnBattlefield), new TapSourceCost()); + // Disadvantage now is, that a creature can be targeted that couldn't be targeted by rules. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SimicManipulatorGainControlTargetEffect(Duration.Custom), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent(filter)); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.P1P1.createInstance(),1)); this.addAbility(ability); @@ -100,21 +100,19 @@ public class SimicManipulator extends CardImpl { class SimicManipulatorGainControlTargetEffect extends ContinuousEffectImpl { + private boolean valid; + public SimicManipulatorGainControlTargetEffect(Duration duration) { super(duration, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); } public SimicManipulatorGainControlTargetEffect(final SimicManipulatorGainControlTargetEffect effect) { super(effect); + this.valid = effect.valid; } @Override - public SimicManipulatorGainControlTargetEffect copy() { - return new SimicManipulatorGainControlTargetEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { + public void init(Ability source, Game game) { Permanent permanent = game.getPermanent(source.getFirstTarget()); if (permanent != null) { int maxPower = 0; @@ -125,9 +123,22 @@ class SimicManipulatorGainControlTargetEffect extends ContinuousEffectImpl