* Dash - Fixed that the return effect did also return the creature it it was already recast before end of turn.

This commit is contained in:
LevelX2 2015-01-30 20:03:22 +01:00
parent 861a1614c4
commit e74c10289e
3 changed files with 23 additions and 5 deletions

View file

@ -2,4 +2,5 @@ woogerworks (North America):xmage.woogerworks.com:17171
XMage.info 1 (Europe) :176.31.186.181:17171
XMage.info 2 (Europe) :176.31.186.181:17000
Seedds Server (Asia) :115.29.203.80:17171
Felipejoys (Brazil) :felipejoys.no-ip.org:17171
localhost -> connect to your local server (must be started):localhost:17171

View file

@ -27,9 +27,13 @@
*/
package mage.abilities.common.delayed;
import mage.constants.TargetController;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.constants.TargetController;
import static mage.constants.TargetController.ANY;
import static mage.constants.TargetController.CONTROLLER_ATTACHED_TO;
import static mage.constants.TargetController.OPPONENT;
import static mage.constants.TargetController.YOU;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@ -57,6 +61,14 @@ public class AtTheBeginOfNextEndStepDelayedTriggeredAbility extends DelayedTrigg
this.targetController = ability.targetController;
}
@Override
public void init(Game game) {
super.init(game);
for (Effect effect: this.getEffects()) {
effect.getTargetPointer().init(game, this);
}
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == EventType.END_TURN_STEP_PRE) {

View file

@ -43,8 +43,10 @@ import mage.abilities.costs.Cost;
import mage.abilities.costs.Costs;
import mage.abilities.costs.CostsImpl;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
import mage.cards.Card;
import mage.constants.Duration;
@ -52,6 +54,7 @@ import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
/**
*
@ -74,7 +77,9 @@ public class DashAbility extends StaticAbility implements AlternativeSourceCosts
Ability ability = new EntersBattlefieldAbility(
new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.Custom, false),
DashedCondition.getInstance(), false, "","");
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnToHandSourceEffect(true)), false));
Effect effect = new ReturnToHandTargetEffect();
effect.setTargetPointer(new FixedTarget(card.getId()));
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect), false));
card.addAbility(ability);
}