mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
[STX] Implement Efreet Flamepainter (#7747)
* [STX] Implement Efreet Flamepainter * Add null check * Target needs to be chosen before ability resolution
This commit is contained in:
parent
68d5c66127
commit
042aa61ad4
4 changed files with 142 additions and 43 deletions
|
|
@ -0,0 +1,50 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class ExileCardEnteringGraveyardReplacementEffect extends ReplacementEffectImpl {
|
||||
|
||||
private final UUID cardId;
|
||||
|
||||
public ExileCardEnteringGraveyardReplacementEffect(UUID cardId) {
|
||||
super(Duration.EndOfTurn, Outcome.Exile);
|
||||
this.cardId = cardId;
|
||||
}
|
||||
|
||||
ExileCardEnteringGraveyardReplacementEffect(final ExileCardEnteringGraveyardReplacementEffect effect) {
|
||||
super(effect);
|
||||
this.cardId = effect.cardId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExileCardEnteringGraveyardReplacementEffect copy() {
|
||||
return new ExileCardEnteringGraveyardReplacementEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
((ZoneChangeEvent) event).setToZone(Zone.EXILED);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
return zEvent.getToZone() == Zone.GRAVEYARD
|
||||
&& zEvent.getTargetId().equals(this.cardId);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue