forked from External/mage
[WHO] Implement Jamie McCrimmon
This commit is contained in:
parent
8eaee40584
commit
86694a91d8
2 changed files with 91 additions and 0 deletions
90
Mage.Sets/src/mage/cards/j/JamieMcCrimmon.java
Normal file
90
Mage.Sets/src/mage/cards/j/JamieMcCrimmon.java
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
package mage.cards.j;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.keyword.DoctorsCompanionAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.common.FilterHistoricSpell;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.Spell;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class JamieMcCrimmon extends CardImpl {
|
||||
|
||||
private static final FilterSpell filter = new FilterHistoricSpell();
|
||||
|
||||
public JamieMcCrimmon(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}");
|
||||
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.WARRIOR);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// Whenever you cast a historic spell, Jamie McCrimmon gets +X/+X until end of turn, where X is that spell's mana value.
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect(
|
||||
JamieMcCrimmonValue.instance, JamieMcCrimmonValue.instance, Duration.EndOfTurn
|
||||
), filter, false));
|
||||
|
||||
// Doctor's companion
|
||||
this.addAbility(DoctorsCompanionAbility.getInstance());
|
||||
}
|
||||
|
||||
private JamieMcCrimmon(final JamieMcCrimmon card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JamieMcCrimmon copy() {
|
||||
return new JamieMcCrimmon(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum JamieMcCrimmonValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
return Optional
|
||||
.ofNullable((Spell) effect.getValue("spellCast"))
|
||||
.filter(Objects::nonNull)
|
||||
.map(Spell::getManaValue)
|
||||
.orElse(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JamieMcCrimmonValue copy() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "that spell's mana value";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "X";
|
||||
}
|
||||
}
|
||||
|
|
@ -108,6 +108,7 @@ public final class DoctorWho extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Iraxxa, Empress of Mars", 89, Rarity.UNCOMMON, mage.cards.i.IraxxaEmpressOfMars.class));
|
||||
cards.add(new SetCardInfo("Irrigated Farmland", 288, Rarity.RARE, mage.cards.i.IrrigatedFarmland.class));
|
||||
cards.add(new SetCardInfo("Island", 198, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Jamie McCrimmon", 105, Rarity.RARE, mage.cards.j.JamieMcCrimmon.class));
|
||||
cards.add(new SetCardInfo("Jenny Flint", 136, Rarity.RARE, mage.cards.j.JennyFlint.class));
|
||||
cards.add(new SetCardInfo("Jenny, Generated Anomaly", 137, Rarity.RARE, mage.cards.j.JennyGeneratedAnomaly.class));
|
||||
cards.add(new SetCardInfo("K-9, Mark I", 47, Rarity.RARE, mage.cards.k.K9MarkI.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue