mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
[DMC] Implemented Verrak, Warped Sengir
This commit is contained in:
parent
d3e939e600
commit
71d12fdb72
3 changed files with 124 additions and 1 deletions
112
Mage.Sets/src/mage/cards/v/VerrakWarpedSengir.java
Normal file
112
Mage.Sets/src/mage/cards/v/VerrakWarpedSengir.java
Normal file
|
@ -0,0 +1,112 @@
|
|||
package mage.cards.v;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.costs.common.PayLifeCost;
|
||||
import mage.abilities.effects.common.CopyStackAbilityEffect;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.keyword.DeathtouchAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.abilities.mana.ActivatedManaAbilityImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.stack.StackAbility;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class VerrakWarpedSengir extends CardImpl {
|
||||
|
||||
public VerrakWarpedSengir(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{B}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.VAMPIRE);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Deathtouch
|
||||
this.addAbility(DeathtouchAbility.getInstance());
|
||||
|
||||
// Lifelink
|
||||
this.addAbility(LifelinkAbility.getInstance());
|
||||
|
||||
// Whenever you activate an ability that isn't a mana ability, if life was paid to activate it, you may pay that much life again. If you do, copy that ability. You may choose new targets for the copy.
|
||||
this.addAbility(new VerrakWarpedSengirTriggeredAbility());
|
||||
}
|
||||
|
||||
private VerrakWarpedSengir(final VerrakWarpedSengir card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VerrakWarpedSengir copy() {
|
||||
return new VerrakWarpedSengir(this);
|
||||
}
|
||||
}
|
||||
|
||||
class VerrakWarpedSengirTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
VerrakWarpedSengirTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, null);
|
||||
}
|
||||
|
||||
private VerrakWarpedSengirTriggeredAbility(final VerrakWarpedSengirTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VerrakWarpedSengirTriggeredAbility copy() {
|
||||
return new VerrakWarpedSengirTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ACTIVATED_ABILITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (!isControlledBy(event.getPlayerId())) {
|
||||
return false;
|
||||
}
|
||||
StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId());
|
||||
if (stackAbility == null || stackAbility.getStackAbility() instanceof ActivatedManaAbilityImpl) {
|
||||
return false;
|
||||
}
|
||||
int lifePaid = CardUtil.castStream(
|
||||
stackAbility
|
||||
.getStackAbility()
|
||||
.getCosts()
|
||||
.stream(),
|
||||
PayLifeCost.class
|
||||
).mapToInt(PayLifeCost::getLifePaid).sum();
|
||||
if (lifePaid > 0) {
|
||||
this.getEffects().clear();
|
||||
this.addEffect(new DoIfCostPaid(new CopyStackAbilityEffect(), new PayLifeCost(lifePaid)));
|
||||
this.getEffects().setValue("stackAbility", stackAbility);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever you activate an ability that isn't a mana ability, " +
|
||||
"if life was paid to activate it, you may pay that much life again. " +
|
||||
"If you do, copy that ability. You may choose new targets for the copy.";
|
||||
}
|
||||
}
|
|
@ -219,6 +219,7 @@ public final class DominariaUnitedCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Unbreakable Formation", 106, Rarity.RARE, mage.cards.u.UnbreakableFormation.class));
|
||||
cards.add(new SetCardInfo("Unite the Coalition", 15, Rarity.RARE, mage.cards.u.UniteTheCoalition.class));
|
||||
cards.add(new SetCardInfo("Urza's Ruinous Blast", 107, Rarity.RARE, mage.cards.u.UrzasRuinousBlast.class));
|
||||
cards.add(new SetCardInfo("Verrak, Warped Sengir", 16, Rarity.RARE, mage.cards.v.VerrakWarpedSengir.class));
|
||||
cards.add(new SetCardInfo("Wear // Tear", 174, Rarity.UNCOMMON, mage.cards.w.WearTear.class));
|
||||
cards.add(new SetCardInfo("Xyris, the Writhing Storm", 175, Rarity.MYTHIC, mage.cards.x.XyrisTheWrithingStorm.class));
|
||||
cards.add(new SetCardInfo("Zaxara, the Exemplary", 176, Rarity.MYTHIC, mage.cards.z.ZaxaraTheExemplary.class));
|
||||
|
|
|
@ -6,7 +6,6 @@ import mage.abilities.costs.CostImpl;
|
|||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
|
@ -18,6 +17,7 @@ import java.util.UUID;
|
|||
public class PayLifeCost extends CostImpl {
|
||||
|
||||
private final DynamicValue amount;
|
||||
private int lifePaid = 0;
|
||||
|
||||
public PayLifeCost(int amount) {
|
||||
this(StaticValue.get(amount), Integer.toString(amount) + " life");
|
||||
|
@ -55,6 +55,7 @@ public class PayLifeCost extends CostImpl {
|
|||
}
|
||||
int lifeToPayAmount = amount.calculate(game, ability, null);
|
||||
this.paid = CardUtil.tryPayLife(lifeToPayAmount, controller, source, game);
|
||||
this.lifePaid = lifeToPayAmount;
|
||||
return this.paid;
|
||||
}
|
||||
|
||||
|
@ -63,4 +64,13 @@ public class PayLifeCost extends CostImpl {
|
|||
return new PayLifeCost(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearPaid() {
|
||||
super.clearPaid();
|
||||
lifePaid = 0;
|
||||
}
|
||||
|
||||
public int getLifePaid() {
|
||||
return lifePaid;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue