mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
* Seasinger - Fixed a bug that the controlling effect of target creature was reactivated if Seasinger was tapped again, also if not the same creature was targeted again. So Seasinger could control multiple creatures with untapping and using the control ability again.
This commit is contained in:
parent
b7c88b3c6d
commit
13af25bd1d
2 changed files with 6 additions and 21 deletions
|
@ -35,8 +35,8 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.StateTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SkipUntapOptionalAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.SourceTappedCondition;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
|
@ -89,7 +89,7 @@ public class Seasinger extends CardImpl<Seasinger> {
|
|||
this.addAbility(new SkipUntapOptionalAbility());
|
||||
|
||||
// {tap}: Gain control of target creature whose controller controls an Island for as long as you control Seasinger and Seasinger remains tapped.
|
||||
ConditionalContinousEffect effect = new ConditionalContinousEffect(new GainControlTargetEffect(Duration.Custom), new ControlsPermanentCondition(seasinger, ControlsPermanentCondition.CountType.EQUAL_TO, 1, TappedCondition.getInstance()), rule);
|
||||
ConditionalContinousEffect effect = new ConditionalContinousEffect(new GainControlTargetEffect(Duration.Custom), new ControlsPermanentCondition(seasinger, ControlsPermanentCondition.CountType.EQUAL_TO, 1, SourceTappedCondition.getInstance()), rule);
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
|
||||
creatureWhoseControllerControlsIsland.add(new ControllerControlsIslandPredicate());
|
||||
ability.addTarget(new TargetCreaturePermanent(creatureWhoseControllerControlsIsland));
|
||||
|
@ -148,21 +148,3 @@ class SeasingerTriggeredAbility extends StateTriggeredAbility<SeasingerTriggered
|
|||
return "When you control no islands, sacrifice {this}.";
|
||||
}
|
||||
}
|
||||
|
||||
class TappedCondition implements Condition {
|
||||
|
||||
private static TappedCondition fInstance = new TappedCondition();
|
||||
|
||||
public static Condition getInstance() {
|
||||
return fInstance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent seasinger = game.getBattlefield().getPermanent(source.getSourceId());
|
||||
if (seasinger != null) {
|
||||
return seasinger.isTapped();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package mage.abilities.decorator;
|
||||
|
||||
import mage.constants.Duration;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.FixedCondition;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.game.Game;
|
||||
|
@ -84,6 +84,9 @@ public class ConditionalContinousEffect extends ContinuousEffectImpl<Conditional
|
|||
if (!condition.apply(game, source) && effect.getDuration() == Duration.OneUse) {
|
||||
used = true;
|
||||
}
|
||||
if (!condition.apply(game, source) && effect.getDuration() == Duration.Custom) {
|
||||
this.discard();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue