mirror of
https://github.com/correl/mage.git
synced 2025-04-05 17:00:10 -09:00
Fixed that Haste effects given to Obzedat on enters the battlefield stayed after going back to hand and recasting of it.
This commit is contained in:
parent
dc0d5a4bc8
commit
d1082293a8
4 changed files with 12 additions and 6 deletions
Mage.Sets/src/mage/sets/theros
Mage/src/mage/abilities
effects/common
keyword
|
@ -155,8 +155,9 @@ class WhipOfErebosReplacementEffect extends ReplacementEffectImpl<WhipOfErebosRe
|
|||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Card card = game.getCard(source.getFirstTarget());
|
||||
if (card != null) {
|
||||
card.moveToExile(null, "", source.getId(), game);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (card != null && controller != null) {
|
||||
controller.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, null);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.cards.Card;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -58,13 +59,14 @@ public class ExileSourceEffect extends OneShotEffect<ExileSourceEffect> {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (permanent != null) {
|
||||
return permanent.moveToExile(null, "", source.getId(), game);
|
||||
return controller.moveCardToExileWithInfo(permanent, null, null, source.getSourceId(), game, null);
|
||||
} else {
|
||||
// try to exile card
|
||||
// try to exile card -> is this correct in all cases? (LevelX2)
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (card != null) {
|
||||
return card.moveToExile(null, "", source.getSourceId(), game);
|
||||
return controller.moveCardToExileWithInfo(permanent, null, null, source.getSourceId(), game, null);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -109,6 +109,9 @@ public class GainAbilitySourceEffect extends ContinuousEffectImpl<GainAbilitySou
|
|||
permanent.addAbility(ability, source.getSourceId(), game);
|
||||
return true;
|
||||
}
|
||||
if (duration.equals(Duration.Custom)) {
|
||||
this.discard();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ public class UnearthAbility extends ActivatedAbilityImpl<UnearthAbility> {
|
|||
public UnearthAbility(ManaCosts costs) {
|
||||
super(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(), costs);
|
||||
this.timing = TimingRule.SORCERY;
|
||||
this.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield));
|
||||
this.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.Custom));
|
||||
this.addEffect(new CreateDelayedTriggeredAbilityEffect(new UnearthDelayedTriggeredAbility()));
|
||||
this.addEffect(new UnearthLeavesBattlefieldEffect());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue