mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
[Y22] Implemented Kindred Denial
This commit is contained in:
parent
263e475dea
commit
752243a6ad
2 changed files with 73 additions and 0 deletions
72
Mage.Sets/src/mage/cards/k/KindredDenial.java
Normal file
72
Mage.Sets/src/mage/cards/k/KindredDenial.java
Normal file
|
@ -0,0 +1,72 @@
|
|||
package mage.cards.k;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.ManaValuePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetSpell;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class KindredDenial extends CardImpl {
|
||||
|
||||
public KindredDenial(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}{U}");
|
||||
|
||||
// Counter target spell. Seek a card with the same mana value as that spell.
|
||||
this.getSpellAbility().addEffect(new KindredDenialEffect());
|
||||
this.getSpellAbility().addTarget(new TargetSpell());
|
||||
}
|
||||
|
||||
private KindredDenial(final KindredDenial card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KindredDenial copy() {
|
||||
return new KindredDenial(this);
|
||||
}
|
||||
}
|
||||
|
||||
class KindredDenialEffect extends OneShotEffect {
|
||||
|
||||
KindredDenialEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "counter target spell. Seek a card with the same mana value as that spell";
|
||||
}
|
||||
|
||||
private KindredDenialEffect(final KindredDenialEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KindredDenialEffect copy() {
|
||||
return new KindredDenialEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Spell spell = game.getSpell(source.getFirstTarget());
|
||||
if (player == null || spell == null) {
|
||||
return false;
|
||||
}
|
||||
int manaValue = spell.getManaValue();
|
||||
spell.counter(source, game);
|
||||
FilterCard filter = new FilterCard();
|
||||
filter.add(new ManaValuePredicate(ComparisonType.EQUAL_TO, manaValue));
|
||||
player.seekCard(filter, source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -25,6 +25,7 @@ public final class AlchemyInnistrad extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Faithful Disciple", 7, Rarity.UNCOMMON, mage.cards.f.FaithfulDisciple.class));
|
||||
cards.add(new SetCardInfo("Ishkanah, Broodmother", 52, Rarity.MYTHIC, mage.cards.i.IshkanahBroodmother.class));
|
||||
cards.add(new SetCardInfo("Key to the Archive", 59, Rarity.RARE, mage.cards.k.KeyToTheArchive.class));
|
||||
cards.add(new SetCardInfo("Kindred Denial", 18, Rarity.UNCOMMON, mage.cards.k.KindredDenial.class));
|
||||
cards.add(new SetCardInfo("Soulstealer Axe", 60, Rarity.UNCOMMON, mage.cards.s.SoulstealerAxe.class));
|
||||
cards.add(new SetCardInfo("Tireless Angler", 23, Rarity.RARE, mage.cards.t.TirelessAngler.class));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue