mirror of
https://github.com/correl/mage.git
synced 2024-12-26 19:16:54 +00:00
[CLB] Implemented Eldritch Pact
This commit is contained in:
parent
ba49425c32
commit
d76aedff1b
2 changed files with 69 additions and 0 deletions
68
Mage.Sets/src/mage/cards/e/EldritchPact.java
Normal file
68
Mage.Sets/src/mage/cards/e/EldritchPact.java
Normal file
|
@ -0,0 +1,68 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class EldritchPact extends CardImpl {
|
||||
|
||||
public EldritchPact(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{6}{B}");
|
||||
|
||||
// Target player draws X cards and loses X life, where X is the number of cards in their graveyard.
|
||||
this.getSpellAbility().addEffect(new EldritchPactEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
}
|
||||
|
||||
private EldritchPact(final EldritchPact card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EldritchPact copy() {
|
||||
return new EldritchPact(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EldritchPactEffect extends OneShotEffect {
|
||||
|
||||
EldritchPactEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "target player draws X cards and loses X life, where X is the number of cards in their graveyard";
|
||||
}
|
||||
|
||||
private EldritchPactEffect(final EldritchPactEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EldritchPactEffect copy() {
|
||||
return new EldritchPactEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
int count = player.getGraveyard().size();
|
||||
if (count < 1) {
|
||||
return false;
|
||||
}
|
||||
player.drawCards(count, source, game);
|
||||
player.loseLife(count, game, source, false);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -73,6 +73,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Dungeoneer's Pack", 312, Rarity.UNCOMMON, mage.cards.d.DungeoneersPack.class));
|
||||
cards.add(new SetCardInfo("Earthquake Dragon", 228, Rarity.RARE, mage.cards.e.EarthquakeDragon.class));
|
||||
cards.add(new SetCardInfo("Elder Brain", 125, Rarity.RARE, mage.cards.e.ElderBrain.class));
|
||||
cards.add(new SetCardInfo("Eldritch Pact", 126, Rarity.RARE, mage.cards.e.EldritchPact.class));
|
||||
cards.add(new SetCardInfo("Ellyn Harbreeze, Busybody", 16, Rarity.UNCOMMON, mage.cards.e.EllynHarbreezeBusybody.class));
|
||||
cards.add(new SetCardInfo("Elminster", 274, Rarity.MYTHIC, mage.cards.e.Elminster.class));
|
||||
cards.add(new SetCardInfo("Elminster's Simulacrum", 68, Rarity.MYTHIC, mage.cards.e.ElminstersSimulacrum.class));
|
||||
|
|
Loading…
Reference in a new issue