mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
fixed Ghostly Pilferer triggered ability
This commit is contained in:
parent
6804216ddc
commit
03a46ffec1
5 changed files with 58 additions and 128 deletions
|
@ -2,13 +2,13 @@ package mage.cards.g;
|
||||||
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.common.BecomesTappedSourceTriggeredAbility;
|
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.common.DiscardCardCost;
|
import mage.abilities.costs.common.DiscardCardCost;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.effects.common.DoIfCostPaid;
|
import mage.abilities.effects.common.DoIfCostPaid;
|
||||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect;
|
import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect;
|
||||||
|
import mage.abilities.keyword.InspiredAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
@ -34,10 +34,10 @@ public final class GhostlyPilferer extends CardImpl {
|
||||||
this.power = new MageInt(2);
|
this.power = new MageInt(2);
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
// Whenever Ghostly Pilferer becomes tapped, you may pay {2}. If you do, draw a card.
|
// Whenever Ghostly Pilferer becomes untapped, you may pay {2}. If you do, draw a card.
|
||||||
this.addAbility(new BecomesTappedSourceTriggeredAbility(new DoIfCostPaid(
|
this.addAbility(new InspiredAbility(new DoIfCostPaid(
|
||||||
new DrawCardSourceControllerEffect(1), new GenericManaCost(2)
|
new DrawCardSourceControllerEffect(1), new GenericManaCost(2)
|
||||||
)));
|
), false, false));
|
||||||
|
|
||||||
// Whenever an opponent casts a spell from anywhere other than their hand, draw a card.
|
// Whenever an opponent casts a spell from anywhere other than their hand, draw a card.
|
||||||
this.addAbility(new GhostlyPilfererTriggeredAbility());
|
this.addAbility(new GhostlyPilfererTriggeredAbility());
|
||||||
|
|
|
@ -1,84 +1,42 @@
|
||||||
|
|
||||||
package mage.cards.h;
|
package mage.cards.h;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.TriggeredAbility;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
|
||||||
import mage.abilities.effects.Effect;
|
|
||||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||||
|
import mage.abilities.keyword.InspiredAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.game.Game;
|
|
||||||
import mage.game.events.GameEvent;
|
|
||||||
import mage.game.events.GameEvent.EventType;
|
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public final class Hollowsage extends CardImpl {
|
public final class Hollowsage extends CardImpl {
|
||||||
|
|
||||||
public Hollowsage(UUID ownerId, CardSetInfo setInfo) {
|
public Hollowsage(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
|
||||||
this.subtype.add(SubType.MERFOLK);
|
this.subtype.add(SubType.MERFOLK);
|
||||||
this.subtype.add(SubType.WIZARD);
|
this.subtype.add(SubType.WIZARD);
|
||||||
|
|
||||||
this.power = new MageInt(2);
|
this.power = new MageInt(2);
|
||||||
this.toughness = new MageInt(2);
|
this.toughness = new MageInt(2);
|
||||||
|
|
||||||
// Whenever Hollowsage becomes untapped, you may have target player discard a card.
|
// Whenever Hollowsage becomes untapped, you may have target player discard a card.
|
||||||
TriggeredAbility ability = new BecomesUntappedTriggeredAbility(new DiscardTargetEffect(1), true);
|
Ability ability = new InspiredAbility(new DiscardTargetEffect(1), true, false);
|
||||||
ability.addTarget(new TargetPlayer());
|
ability.addTarget(new TargetPlayer());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Hollowsage(final Hollowsage card) {
|
public Hollowsage(final Hollowsage card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Hollowsage copy() {
|
public Hollowsage copy() {
|
||||||
return new Hollowsage(this);
|
return new Hollowsage(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class BecomesUntappedTriggeredAbility extends TriggeredAbilityImpl {
|
|
||||||
|
|
||||||
public BecomesUntappedTriggeredAbility(Effect effect, boolean isOptional) {
|
|
||||||
super(Zone.BATTLEFIELD, effect, isOptional);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BecomesUntappedTriggeredAbility(Effect effect) {
|
|
||||||
super(Zone.BATTLEFIELD, effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BecomesUntappedTriggeredAbility(final BecomesUntappedTriggeredAbility ability) {
|
|
||||||
super(ability);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BecomesUntappedTriggeredAbility copy() {
|
|
||||||
return new BecomesUntappedTriggeredAbility(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
|
||||||
return event.getType() == EventType.UNTAPPED;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
|
||||||
return event.getTargetId().equals(sourceId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getRule() {
|
|
||||||
return "When {this} becomes untapped, " + super.getRule();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.k;
|
package mage.cards.k;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.common.DiscardCardCost;
|
import mage.abilities.costs.common.DiscardCardCost;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
|
@ -11,35 +8,35 @@ import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.effects.common.DoIfCostPaid;
|
import mage.abilities.effects.common.DoIfCostPaid;
|
||||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect;
|
import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect;
|
||||||
|
import mage.abilities.keyword.InspiredAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.game.Game;
|
|
||||||
import mage.game.events.GameEvent;
|
|
||||||
import mage.game.events.GameEvent.EventType;
|
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author emerald000
|
* @author emerald000
|
||||||
*/
|
*/
|
||||||
public final class KeyToTheCity extends CardImpl {
|
public final class KeyToTheCity extends CardImpl {
|
||||||
|
|
||||||
public KeyToTheCity(UUID ownerId, CardSetInfo setInfo) {
|
public KeyToTheCity(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||||
|
|
||||||
// {T}, Discard a card: Up to one target creature can't be blocked this turn.
|
// {T}, Discard a card: Up to one target creature can't be blocked this turn.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedTargetEffect(), new TapSourceCost());
|
Ability ability = new SimpleActivatedAbility(new CantBeBlockedTargetEffect(), new TapSourceCost());
|
||||||
ability.addCost(new DiscardCardCost());
|
ability.addCost(new DiscardCardCost());
|
||||||
ability.addTarget(new TargetCreaturePermanent(0, 1));
|
ability.addTarget(new TargetCreaturePermanent(0, 1));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
// Whenever Key to the City becomes untapped, you may pay {2}. If you do, draw a card.
|
// Whenever Key to the City becomes untapped, you may pay {2}. If you do, draw a card.
|
||||||
this.addAbility(new KeyToTheCityTriggeredAbility());
|
this.addAbility(new InspiredAbility(new DoIfCostPaid(
|
||||||
|
new DrawCardSourceControllerEffect(1), new GenericManaCost(2)
|
||||||
|
), false, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public KeyToTheCity(final KeyToTheCity card) {
|
private KeyToTheCity(final KeyToTheCity card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,35 +45,3 @@ public final class KeyToTheCity extends CardImpl {
|
||||||
return new KeyToTheCity(this);
|
return new KeyToTheCity(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class KeyToTheCityTriggeredAbility extends TriggeredAbilityImpl{
|
|
||||||
|
|
||||||
KeyToTheCityTriggeredAbility() {
|
|
||||||
super(Zone.BATTLEFIELD, new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new GenericManaCost(2)));
|
|
||||||
}
|
|
||||||
|
|
||||||
KeyToTheCityTriggeredAbility(final KeyToTheCityTriggeredAbility ability) {
|
|
||||||
super(ability);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public KeyToTheCityTriggeredAbility copy() {
|
|
||||||
return new KeyToTheCityTriggeredAbility(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
|
||||||
return event.getType() == EventType.UNTAPPED;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
|
||||||
return event.getTargetId().equals(this.getSourceId());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getRule() {
|
|
||||||
return "Whenever Key to the City becomes untapped, you may pay {2}. If you do, draw a card.";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,29 +1,29 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without modification, are
|
* Redistribution and use in source and binary forms, with or without modification, are
|
||||||
* permitted provided that the following conditions are met:
|
* permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
* conditions and the following disclaimer.
|
* conditions and the following disclaimer.
|
||||||
*
|
*
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||||
* provided with the distribution.
|
* provided with the distribution.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* The views and conclusions contained in the software and documentation are those of the
|
* The views and conclusions contained in the software and documentation are those of the
|
||||||
* authors and should not be interpreted as representing official policies, either expressed
|
* authors and should not be interpreted as representing official policies, either expressed
|
||||||
* or implied, of BetaSteward_at_googlemail.com.
|
* or implied, of BetaSteward_at_googlemail.com.
|
||||||
*/
|
*/
|
||||||
package mage.abilities.keyword;
|
package mage.abilities.keyword;
|
||||||
|
|
||||||
|
@ -37,21 +37,28 @@ import mage.game.events.GameEvent.EventType;
|
||||||
/**
|
/**
|
||||||
* Inspired ability word
|
* Inspired ability word
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public class InspiredAbility extends TriggeredAbilityImpl {
|
public class InspiredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
|
private final boolean isInspired;
|
||||||
|
|
||||||
public InspiredAbility(Effect effect) {
|
public InspiredAbility(Effect effect) {
|
||||||
this(effect, false);
|
this(effect, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public InspiredAbility(Effect effect, boolean optional) {
|
public InspiredAbility(Effect effect, boolean optional) {
|
||||||
|
this(effect, optional, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public InspiredAbility(Effect effect, boolean optional, boolean isInspired) {
|
||||||
super(Zone.BATTLEFIELD, effect, optional);
|
super(Zone.BATTLEFIELD, effect, optional);
|
||||||
|
this.isInspired = isInspired;
|
||||||
}
|
}
|
||||||
|
|
||||||
public InspiredAbility(final InspiredAbility ability) {
|
public InspiredAbility(final InspiredAbility ability) {
|
||||||
super(ability);
|
super(ability);
|
||||||
|
this.isInspired = ability.isInspired;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -71,6 +78,6 @@ public class InspiredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
return "<i>Inspired</i> — Whenever {this} becomes untapped, " + super.getRule();
|
return (isInspired ? "<i>Inspired</i> — " : "") + "Whenever {this} becomes untapped, " + super.getRule();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37489,7 +37489,7 @@ Discontinuity|Core Set 2021|48|M|{3}{U}{U}{U}|Instant|||As long as it's your tur
|
||||||
Enthralling Hold|Core Set 2021|49|U|{3}{U}{U}|Enchantment - Aura|||Enchant creature$You can't choose an untapped creature as this spell's target as you cast it.$You control enchanted creature.|
|
Enthralling Hold|Core Set 2021|49|U|{3}{U}{U}|Enchantment - Aura|||Enchant creature$You can't choose an untapped creature as this spell's target as you cast it.$You control enchanted creature.|
|
||||||
Frantic Inventory|Core Set 2021|50|C|{1}{U}|Instant|||Draw a card, then draw cards equal to the number of cards named Frantic Inventory in your graveyard.|
|
Frantic Inventory|Core Set 2021|50|C|{1}{U}|Instant|||Draw a card, then draw cards equal to the number of cards named Frantic Inventory in your graveyard.|
|
||||||
Frost Breath|Core Set 2021|51|C|{2}{U}|Instant|||Tap up to two target creatures. Those creatures don't untap during their controller's next untap step.|
|
Frost Breath|Core Set 2021|51|C|{2}{U}|Instant|||Tap up to two target creatures. Those creatures don't untap during their controller's next untap step.|
|
||||||
Ghostly Pilferer|Core Set 2021|52|R|{1}{U}|Creature - Spirit Rogue|2|1|Whenever Ghostly Pilferer becomes tapped, you may pay {2}. If you do, draw a card.$Whenever an opponent casts a spell from anywhere other than their hand, draw a card.$Discard a card: Ghostly Pilferer can't be blocked this turn.|
|
Ghostly Pilferer|Core Set 2021|52|R|{1}{U}|Creature - Spirit Rogue|2|1|Whenever Ghostly Pilferer becomes untapped, you may pay {2}. If you do, draw a card.$Whenever an opponent casts a spell from anywhere other than their hand, draw a card.$Discard a card: Ghostly Pilferer can't be blocked this turn.|
|
||||||
Jeskai Elder|Core Set 2021|53|U|{1}{U}|Creature - Human Monk|1|2|Prowess$Whenever Jeskai Elder deals combat damage to a player, you may draw a card. If you do, discard a card.|
|
Jeskai Elder|Core Set 2021|53|U|{1}{U}|Creature - Human Monk|1|2|Prowess$Whenever Jeskai Elder deals combat damage to a player, you may draw a card. If you do, discard a card.|
|
||||||
Keen Glidemaster|Core Set 2021|54|C|{1}{U}|Creature - Human Soldier|2|1|{2}{U}: Target creature gains flying until end of turn.|
|
Keen Glidemaster|Core Set 2021|54|C|{1}{U}|Creature - Human Soldier|2|1|{2}{U}: Target creature gains flying until end of turn.|
|
||||||
Library Larcenist|Core Set 2021|55|C|{2}{U}|Creature - Merfolk Rogue|1|2|Whenever Library Larcenist attacks, draw a card.|
|
Library Larcenist|Core Set 2021|55|C|{2}{U}|Creature - Merfolk Rogue|1|2|Whenever Library Larcenist attacks, draw a card.|
|
||||||
|
|
Loading…
Reference in a new issue