mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
[MOC] Implement Blight Titan
This commit is contained in:
parent
a82acfff31
commit
eb27c30409
9 changed files with 100 additions and 11 deletions
81
Mage.Sets/src/mage/cards/b/BlightTitan.java
Normal file
81
Mage.Sets/src/mage/cards/b/BlightTitan.java
Normal file
|
@ -0,0 +1,81 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldOrAttacksSourceTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.MillCardsControllerEffect;
|
||||
import mage.abilities.effects.keyword.IncubateEffect;
|
||||
import mage.abilities.keyword.DeathtouchAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class BlightTitan extends CardImpl {
|
||||
|
||||
public BlightTitan(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}");
|
||||
|
||||
this.subtype.add(SubType.PHYREXIAN);
|
||||
this.subtype.add(SubType.GIANT);
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
// Deathtouch
|
||||
this.addAbility(DeathtouchAbility.getInstance());
|
||||
|
||||
// Whenever Blight Titan enters the battlefield or attacks, mill two cards, then incubate X, where X is the number of creature cards in your graveyard.
|
||||
Ability ability = new EntersBattlefieldOrAttacksSourceTriggeredAbility(new MillCardsControllerEffect(2));
|
||||
ability.addEffect(new BlightTitanEffect());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private BlightTitan(final BlightTitan card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlightTitan copy() {
|
||||
return new BlightTitan(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BlightTitanEffect extends OneShotEffect {
|
||||
|
||||
BlightTitanEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = ", then incubate X, where X is the number of creature cards in your graveyard";
|
||||
}
|
||||
|
||||
private BlightTitanEffect(final BlightTitanEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlightTitanEffect copy() {
|
||||
return new BlightTitanEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int count = Optional.of(source.getControllerId())
|
||||
.map(game::getPlayer)
|
||||
.filter(Objects::nonNull)
|
||||
.map(Player::getGraveyard)
|
||||
.map(graveyard -> graveyard.count(StaticFilters.FILTER_CARD_CREATURE, game))
|
||||
.orElse(0);
|
||||
return IncubateEffect.doIncubate(count, game, source);
|
||||
}
|
||||
}
|
|
@ -78,6 +78,6 @@ class BloatedProcessorEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = source.getSourcePermanentOrLKI(game);
|
||||
return permanent != null && new IncubateEffect(permanent.getPower().getValue()).apply(game, source);
|
||||
return permanent != null && IncubateEffect.doIncubate(permanent.getPower().getValue(), game, source);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,6 +68,6 @@ class ChromeHostSeedsharkEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Spell spell = (Spell) getValue("spellCast");
|
||||
return spell != null && new IncubateEffect(spell.getManaValue()).apply(game, source);
|
||||
return spell != null && IncubateEffect.doIncubate(spell.getManaValue(), game, source);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,6 +77,6 @@ class FurnaceGremlinEffect extends OneShotEffect {
|
|||
.map(MageObject::getPower)
|
||||
.map(MageInt::getValue)
|
||||
.orElse(0);
|
||||
return new IncubateEffect(power).apply(game, source);
|
||||
return IncubateEffect.doIncubate(power, game, source);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,8 +58,8 @@ class GlisteningDawnEffect extends OneShotEffect {
|
|||
StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND,
|
||||
source.getControllerId(), source, game
|
||||
);
|
||||
new IncubateEffect(lands).apply(game, source);
|
||||
new IncubateEffect(lands).apply(game, source);
|
||||
IncubateEffect.doIncubate(lands, game, source);
|
||||
IncubateEffect.doIncubate(lands, game, source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ class ProgenitorExarchEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
for (int i = 0; i < xValue; i++) {
|
||||
new IncubateEffect(3).apply(game, source);
|
||||
IncubateEffect.doIncubate(3, game, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ class SunfallEffect extends OneShotEffect {
|
|||
StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source, game
|
||||
));
|
||||
player.moveCards(cards, Zone.EXILED, source, game);
|
||||
new IncubateEffect(cards.size()).apply(game, source);
|
||||
IncubateEffect.doIncubate(cards.size(), game, source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ public final class MarchOfTheMachineCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Begin the Invasion", 79, Rarity.MYTHIC, mage.cards.b.BeginTheInvasion.class));
|
||||
cards.add(new SetCardInfo("Bitterthorn, Nissa's Animus", 45, Rarity.RARE, mage.cards.b.BitterthornNissasAnimus.class));
|
||||
cards.add(new SetCardInfo("Blade Splicer", 175, Rarity.RARE, mage.cards.b.BladeSplicer.class));
|
||||
cards.add(new SetCardInfo("Blight Titan", 25, Rarity.RARE, mage.cards.b.BlightTitan.class));
|
||||
cards.add(new SetCardInfo("Bloodforged Battle-Axe", 349, Rarity.RARE, mage.cards.b.BloodforgedBattleAxe.class));
|
||||
cards.add(new SetCardInfo("Bloodline Pretender", 350, Rarity.UNCOMMON, mage.cards.b.BloodlinePretender.class));
|
||||
cards.add(new SetCardInfo("Bojuka Bog", 391, Rarity.COMMON, mage.cards.b.BojukaBog.class));
|
||||
|
|
|
@ -39,14 +39,21 @@ public class IncubateEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return doIncubate(amount, game, source);
|
||||
}
|
||||
|
||||
public static boolean doIncubate(int amount, Game game, Ability source) {
|
||||
return doIncubate(amount, source.getControllerId(), game, source);
|
||||
}
|
||||
|
||||
public static boolean doIncubate(int amount, UUID playerId, Game game, Ability source) {
|
||||
Token token = new IncubatorToken();
|
||||
token.putOntoBattlefield(1, game, source);
|
||||
token.putOntoBattlefield(1, game, source, playerId);
|
||||
for (UUID tokenId : token.getLastAddedTokenIds()) {
|
||||
Permanent permanent = game.getPermanent(tokenId);
|
||||
if (permanent == null) {
|
||||
continue;
|
||||
if (permanent != null && amount > 0) {
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(amount), source.getControllerId(), source, game);
|
||||
}
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(amount), source.getControllerId(), source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue