forked from External/mage
[SNC] Implemented Unlicensed Hearse
This commit is contained in:
parent
f26c1d7bc0
commit
48ce0b56a8
2 changed files with 97 additions and 0 deletions
96
Mage.Sets/src/mage/cards/u/UnlicensedHearse.java
Normal file
96
Mage.Sets/src/mage/cards/u/UnlicensedHearse.java
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
package mage.cards.u;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.ExileTargetForSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.abilities.hint.ValueHint;
|
||||
import mage.abilities.keyword.CrewAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.target.common.TargetCardInASingleGraveyard;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class UnlicensedHearse extends CardImpl {
|
||||
|
||||
private static final Hint hint = new ValueHint("Cards exiled", UnlicensedHearseValue.instance);
|
||||
|
||||
public UnlicensedHearse(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||
|
||||
this.subtype.add(SubType.VEHICLE);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(0);
|
||||
|
||||
// {T}: Exile up to two target cards from a single graveyard.
|
||||
Ability ability = new SimpleActivatedAbility(new ExileTargetForSourceEffect(), new TapSourceCost());
|
||||
ability.addTarget(new TargetCardInASingleGraveyard(
|
||||
0, 2, StaticFilters.FILTER_CARD_CARDS
|
||||
));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Unlicensed Hearse's power and toughness are each equal to the number of cards exiled with it.
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.ALL,
|
||||
new SetPowerToughnessSourceEffect(
|
||||
UnlicensedHearseValue.instance, Duration.Custom
|
||||
)
|
||||
).addHint(hint));
|
||||
|
||||
// Crew 2
|
||||
this.addAbility(new CrewAbility(2));
|
||||
}
|
||||
|
||||
private UnlicensedHearse(final UnlicensedHearse card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UnlicensedHearse copy() {
|
||||
return new UnlicensedHearse(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum UnlicensedHearseValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
return Optional.of(game
|
||||
.getExile()
|
||||
.getExileZone(CardUtil.getExileZoneId(game, sourceAbility)))
|
||||
.filter(Objects::nonNull)
|
||||
.map(HashSet::size)
|
||||
.orElse(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UnlicensedHearseValue copy() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "cards exiled with it";
|
||||
}
|
||||
}
|
||||
|
|
@ -135,6 +135,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Topiary Stomper", 160, Rarity.RARE, mage.cards.t.TopiaryStomper.class));
|
||||
cards.add(new SetCardInfo("Tramway Station", 258, Rarity.COMMON, mage.cards.t.TramwayStation.class));
|
||||
cards.add(new SetCardInfo("Unleash the Inferno", 229, Rarity.RARE, mage.cards.u.UnleashTheInferno.class));
|
||||
cards.add(new SetCardInfo("Unlicensed Hearse", 246, Rarity.RARE, mage.cards.u.UnlicensedHearse.class));
|
||||
cards.add(new SetCardInfo("Unlucky Witness", 128, Rarity.UNCOMMON, mage.cards.u.UnluckyWitness.class));
|
||||
cards.add(new SetCardInfo("Urabrask, Heretic Praetor", 129, Rarity.MYTHIC, mage.cards.u.UrabraskHereticPraetor.class));
|
||||
cards.add(new SetCardInfo("Vampire Scrivener", 98, Rarity.UNCOMMON, mage.cards.v.VampireScrivener.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue