mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
[EOE] Implement The Endstone
This commit is contained in:
parent
80fb46d59f
commit
0513012606
8 changed files with 144 additions and 114 deletions
|
|
@ -1,38 +0,0 @@
|
|||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class PlayLandOrCastSpellFromExileTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public PlayLandOrCastSpellFromExileTriggeredAbility(Effect effect) {
|
||||
super(Zone.BATTLEFIELD, effect);
|
||||
setTriggerPhrase("Whenever you play a land from exile or cast a spell from exile, ");
|
||||
}
|
||||
|
||||
private PlayLandOrCastSpellFromExileTriggeredAbility(final PlayLandOrCastSpellFromExileTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayLandOrCastSpellFromExileTriggeredAbility copy() {
|
||||
return new PlayLandOrCastSpellFromExileTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.LAND_PLAYED
|
||||
|| event.getType() == GameEvent.EventType.SPELL_CAST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return isControlledBy(event.getPlayerId()) && event.getZone() == Zone.EXILED;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class PlayLandOrCastSpellTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private final boolean fromExile;
|
||||
|
||||
public PlayLandOrCastSpellTriggeredAbility(Effect effect) {
|
||||
this(effect, false, false);
|
||||
}
|
||||
|
||||
public PlayLandOrCastSpellTriggeredAbility(Effect effect, boolean fromExile, boolean optional) {
|
||||
super(Zone.BATTLEFIELD, effect, optional);
|
||||
this.fromExile = fromExile;
|
||||
setTriggerPhrase("Whenever you play a land from exile or cast a spell" + (fromExile ? " from exile" : "") + ", ");
|
||||
}
|
||||
|
||||
private PlayLandOrCastSpellTriggeredAbility(final PlayLandOrCastSpellTriggeredAbility ability) {
|
||||
super(ability);
|
||||
this.fromExile = ability.fromExile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayLandOrCastSpellTriggeredAbility copy() {
|
||||
return new PlayLandOrCastSpellTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.LAND_PLAYED
|
||||
|| event.getType() == GameEvent.EventType.SPELL_CAST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return isControlledBy(event.getPlayerId()) && (!fromExile || event.getZone() == Zone.EXILED);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue