mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
[VOW] Implemented Change of Fortune
This commit is contained in:
parent
ef2a45227d
commit
7da842a754
2 changed files with 64 additions and 0 deletions
63
Mage.Sets/src/mage/cards/c/ChangeOfFortune.java
Normal file
63
Mage.Sets/src/mage/cards/c/ChangeOfFortune.java
Normal file
|
@ -0,0 +1,63 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardHandControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.game.Game;
|
||||
import mage.watchers.common.DiscardedCardWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class ChangeOfFortune extends CardImpl {
|
||||
|
||||
public ChangeOfFortune(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}");
|
||||
|
||||
// Discard your hand, then draw a card for each card you've discarded this turn.
|
||||
this.getSpellAbility().addEffect(new DiscardHandControllerEffect());
|
||||
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(ChangeOfFortuneValue.instance));
|
||||
this.getSpellAbility().addWatcher(new DiscardedCardWatcher());
|
||||
}
|
||||
|
||||
private ChangeOfFortune(final ChangeOfFortune card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChangeOfFortune copy() {
|
||||
return new ChangeOfFortune(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum ChangeOfFortuneValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
return DiscardedCardWatcher.getDiscarded(sourceAbility.getControllerId(), game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChangeOfFortuneValue copy() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "card you've discarded this turn";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "X";
|
||||
}
|
||||
}
|
|
@ -34,6 +34,7 @@ public final class InnistradCrimsonVow extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Anje, Maid of Dishonor", 231, Rarity.RARE, mage.cards.a.AnjeMaidOfDishonor.class));
|
||||
cards.add(new SetCardInfo("Apprentice Sharpshooter", 185, Rarity.COMMON, mage.cards.a.ApprenticeSharpshooter.class));
|
||||
cards.add(new SetCardInfo("By Invitation Only", 5, Rarity.RARE, mage.cards.b.ByInvitationOnly.class));
|
||||
cards.add(new SetCardInfo("Change of Fortune", 150, Rarity.RARE, mage.cards.c.ChangeOfFortune.class));
|
||||
cards.add(new SetCardInfo("Deathcap Glade", 261, Rarity.RARE, mage.cards.d.DeathcapGlade.class));
|
||||
cards.add(new SetCardInfo("Demonic Bargain", 103, Rarity.RARE, mage.cards.d.DemonicBargain.class));
|
||||
cards.add(new SetCardInfo("Dig Up", 197, Rarity.RARE, mage.cards.d.DigUp.class));
|
||||
|
|
Loading…
Reference in a new issue