mirror of
https://github.com/correl/mage.git
synced 2025-04-10 17:00:08 -09:00
Implemented Tectonic Hellion
This commit is contained in:
parent
ab7ca5a4ff
commit
649078ab1b
2 changed files with 94 additions and 0 deletions
Mage.Sets/src/mage
93
Mage.Sets/src/mage/cards/t/TectonicHellion.java
Normal file
93
Mage.Sets/src/mage/cards/t/TectonicHellion.java
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
package mage.cards.t;
|
||||||
|
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.AttacksTriggeredAbility;
|
||||||
|
import mage.abilities.effects.Effect;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.SacrificeEffect;
|
||||||
|
import mage.abilities.keyword.HasteAbility;
|
||||||
|
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.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public final class TectonicHellion extends CardImpl {
|
||||||
|
|
||||||
|
public TectonicHellion(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{R}{R}");
|
||||||
|
|
||||||
|
this.subtype.add(SubType.HELLION);
|
||||||
|
this.power = new MageInt(8);
|
||||||
|
this.toughness = new MageInt(5);
|
||||||
|
|
||||||
|
// Haste
|
||||||
|
this.addAbility(HasteAbility.getInstance());
|
||||||
|
|
||||||
|
// Whenever Tectonic Hellion attacks, each player who controls the most lands sacrifices two lands.
|
||||||
|
this.addAbility(new AttacksTriggeredAbility(new TectonicHellionEffect(), false));
|
||||||
|
}
|
||||||
|
|
||||||
|
private TectonicHellion(final TectonicHellion card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TectonicHellion copy() {
|
||||||
|
return new TectonicHellion(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class TectonicHellionEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
TectonicHellionEffect() {
|
||||||
|
super(Outcome.Benefit);
|
||||||
|
staticText = "each player who controls the most lands sacrifices two lands";
|
||||||
|
}
|
||||||
|
|
||||||
|
private TectonicHellionEffect(final TectonicHellionEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TectonicHellionEffect copy() {
|
||||||
|
return new TectonicHellionEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Map<UUID, Integer> landMap = new HashMap<>();
|
||||||
|
game.getState()
|
||||||
|
.getPlayersInRange(source.getControllerId(), game)
|
||||||
|
.stream()
|
||||||
|
.map(uuid -> landMap.put(uuid, game.getBattlefield().getActivePermanents(
|
||||||
|
StaticFilters.FILTER_LAND, uuid, source.getSourceId(), game
|
||||||
|
).size()));
|
||||||
|
int max = landMap
|
||||||
|
.values()
|
||||||
|
.stream()
|
||||||
|
.max(Math::max)
|
||||||
|
.get();
|
||||||
|
Effect effect = new SacrificeEffect(StaticFilters.FILTER_LANDS, 2, "");
|
||||||
|
game.getState()
|
||||||
|
.getPlayersInRange(source.getControllerId(), game)
|
||||||
|
.stream()
|
||||||
|
.filter(uuid -> landMap.getOrDefault(uuid, 0) == max)
|
||||||
|
.forEachOrdered(uuid -> {
|
||||||
|
effect.setTargetPointer(new FixedTarget(uuid, game));
|
||||||
|
effect.apply(game, source);
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -166,6 +166,7 @@ public final class Commander2019Edition extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Swamp", 294, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Swamp", 294, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Swiftwater Cliffs", 279, Rarity.COMMON, mage.cards.s.SwiftwaterCliffs.class));
|
cards.add(new SetCardInfo("Swiftwater Cliffs", 279, Rarity.COMMON, mage.cards.s.SwiftwaterCliffs.class));
|
||||||
cards.add(new SetCardInfo("Talrand, Sky Summoner", 97, Rarity.RARE, mage.cards.t.TalrandSkySummoner.class));
|
cards.add(new SetCardInfo("Talrand, Sky Summoner", 97, Rarity.RARE, mage.cards.t.TalrandSkySummoner.class));
|
||||||
|
cards.add(new SetCardInfo("Tectonic Hellion", 29, Rarity.RARE, mage.cards.t.TectonicHellion.class));
|
||||||
cards.add(new SetCardInfo("Temple of the False God", 280, Rarity.UNCOMMON, mage.cards.t.TempleOfTheFalseGod.class));
|
cards.add(new SetCardInfo("Temple of the False God", 280, Rarity.UNCOMMON, mage.cards.t.TempleOfTheFalseGod.class));
|
||||||
cards.add(new SetCardInfo("Tempt with Discovery", 183, Rarity.RARE, mage.cards.t.TemptWithDiscovery.class));
|
cards.add(new SetCardInfo("Tempt with Discovery", 183, Rarity.RARE, mage.cards.t.TemptWithDiscovery.class));
|
||||||
cards.add(new SetCardInfo("Terramorphic Expanse", 281, Rarity.COMMON, mage.cards.t.TerramorphicExpanse.class));
|
cards.add(new SetCardInfo("Terramorphic Expanse", 281, Rarity.COMMON, mage.cards.t.TerramorphicExpanse.class));
|
||||||
|
|
Loading…
Add table
Reference in a new issue