forked from External/mage
[PIP] Implement Vault 87: Forced Evolution (#12560)
This commit is contained in:
parent
80b095afd8
commit
36492b4a15
2 changed files with 115 additions and 0 deletions
113
Mage.Sets/src/mage/cards/v/Vault87ForcedEvolution.java
Normal file
113
Mage.Sets/src/mage/cards/v/Vault87ForcedEvolution.java
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
package mage.cards.v;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SagaAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.AddCardSubTypeTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.abilities.hint.ValueHint;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SagaChapter;
|
||||
import mage.constants.SubType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.game.Game;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
* @author Cguy7777
|
||||
*/
|
||||
public final class Vault87ForcedEvolution extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Mutant creature");
|
||||
private static final Hint hint = new ValueHint(
|
||||
"Highest power among Mutants you control", Vault87ForcedEvolutionValue.instance);
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(SubType.MUTANT.getPredicate()));
|
||||
}
|
||||
|
||||
public Vault87ForcedEvolution(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}{U}");
|
||||
|
||||
this.subtype.add(SubType.SAGA);
|
||||
|
||||
// (As this Saga enters and after your draw step, add a lore counter. Sacrifice after III.)
|
||||
SagaAbility sagaAbility = new SagaAbility(this);
|
||||
|
||||
// I -- Gain control of target non-Mutant creature for as long as you control Vault 87.
|
||||
sagaAbility.addChapterEffect(
|
||||
this,
|
||||
SagaChapter.CHAPTER_I,
|
||||
new GainControlTargetEffect(Duration.WhileControlled),
|
||||
new TargetCreaturePermanent(filter));
|
||||
|
||||
// II -- Put a +1/+1 counter on target creature you control. It becomes a Mutant in addition to its other types.
|
||||
sagaAbility.addChapterEffect(
|
||||
this,
|
||||
SagaChapter.CHAPTER_II,
|
||||
new Effects(
|
||||
new AddCountersTargetEffect(CounterType.P1P1.createInstance()),
|
||||
new AddCardSubTypeTargetEffect(SubType.MUTANT, Duration.Custom)
|
||||
.setText("It becomes a Mutant in addition to its other types")),
|
||||
new TargetControlledCreaturePermanent());
|
||||
|
||||
// III -- Draw cards equal to the greatest power among Mutants you control.
|
||||
sagaAbility.addChapterEffect(
|
||||
this,
|
||||
SagaChapter.CHAPTER_III,
|
||||
new DrawCardSourceControllerEffect(Vault87ForcedEvolutionValue.instance)
|
||||
.setText("draw cards equal to the greatest power among Mutants you control"));
|
||||
this.addAbility(sagaAbility.addHint(hint));
|
||||
}
|
||||
|
||||
private Vault87ForcedEvolution(final Vault87ForcedEvolution card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vault87ForcedEvolution copy() {
|
||||
return new Vault87ForcedEvolution(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum Vault87ForcedEvolutionValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
return game.getBattlefield()
|
||||
.getAllActivePermanents(sourceAbility.getControllerId())
|
||||
.stream()
|
||||
.filter(permanent1 -> permanent1.isCreature(game))
|
||||
.filter(permanent -> permanent.hasSubtype(SubType.MUTANT, game))
|
||||
.map(MageObject::getPower)
|
||||
.mapToInt(MageInt::getValue)
|
||||
.max()
|
||||
.orElse(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicValue copy() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -392,6 +392,8 @@ public final class Fallout extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Vault 21: House Gambit", 69, Rarity.RARE, mage.cards.v.Vault21HouseGambit.class));
|
||||
cards.add(new SetCardInfo("Vault 75: Middle School", 27, Rarity.RARE, mage.cards.v.Vault75MiddleSchool.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Vault 75: Middle School", 555, Rarity.RARE, mage.cards.v.Vault75MiddleSchool.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Vault 87: Forced Evolution", 122, Rarity.RARE, mage.cards.v.Vault87ForcedEvolution.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Vault 87: Forced Evolution", 650, Rarity.RARE, mage.cards.v.Vault87ForcedEvolution.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Veronica, Dissident Scribe", 70, Rarity.RARE, mage.cards.v.VeronicaDissidentScribe.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Veronica, Dissident Scribe", 395, Rarity.RARE, mage.cards.v.VeronicaDissidentScribe.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Veronica, Dissident Scribe", 598, Rarity.RARE, mage.cards.v.VeronicaDissidentScribe.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue