mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 04:09:54 -08:00
implement [EOE] Lightstall Inquisitor
This commit is contained in:
parent
59ff808af2
commit
5c08d310a7
7 changed files with 322 additions and 8 deletions
|
|
@ -84,7 +84,8 @@ public enum MageIdentifier {
|
|||
QuilledGreatwurmAlternateCast,
|
||||
WickerfolkIndomitableAlternateCast,
|
||||
UriangerAugureltAlternateCast,
|
||||
ValgavothTerrorEaterAlternateCast;
|
||||
ValgavothTerrorEaterAlternateCast,
|
||||
LightstallInquisitorAlternateCast;
|
||||
|
||||
/**
|
||||
* Additional text if there is need to differentiate two very similar effects
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import mage.abilities.costs.Cost;
|
|||
import mage.abilities.costs.Costs;
|
||||
import mage.abilities.costs.CostsImpl;
|
||||
import mage.abilities.effects.AsThoughEffectImpl;
|
||||
import mage.abilities.effects.common.replacement.MorEnteringTappedEffect;
|
||||
import mage.abilities.effects.common.replacement.SpellMorEnteringTappedEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterCard;
|
||||
|
|
@ -170,7 +170,7 @@ class CastFromGraveyardOnceWatcher extends Watcher {
|
|||
if (target != null) {
|
||||
MageObjectReference mor = new MageObjectReference(target, game);
|
||||
game.getState().addEffect(
|
||||
new MorEnteringTappedEffect(mor),
|
||||
new SpellMorEnteringTappedEffect(mor),
|
||||
event.getApprovingObject().getApprovingAbility() // ability that approved the cast is the source of the tapping.
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,66 @@
|
|||
package mage.abilities.effects.common.replacement;
|
||||
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.EntersTheBattlefieldEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
* Used to affect a card that will enter the battlefield (land played, or card put into play by effect).
|
||||
* The permanent it becomes enters tapped.
|
||||
* <p>
|
||||
* Short-lived replacement effect, auto-cleanup if the mor is no longer current.
|
||||
*
|
||||
* @author Susucr
|
||||
*/
|
||||
public class CardMorEnteringTappedEffect extends ReplacementEffectImpl {
|
||||
|
||||
private final MageObjectReference mor;
|
||||
|
||||
public CardMorEnteringTappedEffect(MageObjectReference mor) {
|
||||
super(Duration.OneUse, Outcome.Tap);
|
||||
this.staticText = "That permanent enters the battlefield tapped";
|
||||
this.mor = mor;
|
||||
}
|
||||
|
||||
private CardMorEnteringTappedEffect(final CardMorEnteringTappedEffect effect) {
|
||||
super(effect);
|
||||
this.mor = effect.mor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CardMorEnteringTappedEffect copy() {
|
||||
return new CardMorEnteringTappedEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Card morCard = mor.getCard(game);
|
||||
if (morCard == null) {
|
||||
// cleanup if something other than resolving happens to the spell.
|
||||
discard();
|
||||
return false;
|
||||
}
|
||||
return event.getTargetId().equals(morCard.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||
if (permanent != null) {
|
||||
permanent.setTapped(true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -19,24 +19,24 @@ import mage.game.stack.Spell;
|
|||
*
|
||||
* @author Susucr
|
||||
*/
|
||||
public class MorEnteringTappedEffect extends ReplacementEffectImpl {
|
||||
public class SpellMorEnteringTappedEffect extends ReplacementEffectImpl {
|
||||
|
||||
private final MageObjectReference mor;
|
||||
|
||||
public MorEnteringTappedEffect(MageObjectReference mor) {
|
||||
public SpellMorEnteringTappedEffect(MageObjectReference mor) {
|
||||
super(Duration.OneUse, Outcome.Tap);
|
||||
this.staticText = "That permanent enters the battlefield tapped";
|
||||
this.mor = mor;
|
||||
}
|
||||
|
||||
private MorEnteringTappedEffect(final MorEnteringTappedEffect effect) {
|
||||
private SpellMorEnteringTappedEffect(final SpellMorEnteringTappedEffect effect) {
|
||||
super(effect);
|
||||
this.mor = effect.mor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MorEnteringTappedEffect copy() {
|
||||
return new MorEnteringTappedEffect(this);
|
||||
public SpellMorEnteringTappedEffect copy() {
|
||||
return new SpellMorEnteringTappedEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
Loading…
Add table
Add a link
Reference in a new issue