Implemented Isolation Tower

This commit is contained in:
Evan Kranzler 2018-06-21 19:43:55 -04:00
parent 547257bc60
commit 055d97d8ac
2 changed files with 89 additions and 0 deletions

View file

@ -0,0 +1,88 @@
package mage.cards.i;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.mana.ColorlessManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AsThoughEffectType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author TheElk801
*/
public final class IsolationTower extends CardImpl {
public IsolationTower(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
// {T}: Add {C}.
this.addAbility(new ColorlessManaAbility());
// {1}, {T}: Until end of turn, your opponents and creatures with hexproof they control can be the targets of spells and abilities you control as though they didn't have hexproof.
Ability ability = new SimpleActivatedAbility(
new IsolationTowerEffect(),
new GenericManaCost(1)
);
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}
public IsolationTower(final IsolationTower card) {
super(card);
}
@Override
public IsolationTower copy() {
return new IsolationTower(this);
}
}
class IsolationTowerEffect extends AsThoughEffectImpl {
public IsolationTowerEffect() {
super(AsThoughEffectType.HEXPROOF, Duration.EndOfTurn, Outcome.Benefit);
staticText = "until end of turn, your opponents and "
+ "creatures with hexproof they control "
+ "can be the targets of spells and abilities "
+ "you control as though they didn't have hexproof";
}
public IsolationTowerEffect(final IsolationTowerEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public IsolationTowerEffect copy() {
return new IsolationTowerEffect(this);
}
@Override
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
if (affectedControllerId.equals(source.getControllerId())) {
if (game.getOpponents(source.getControllerId()).contains(sourceId)) {
return true;
}
Permanent creature = game.getPermanent(sourceId);
if (creature != null
&& game.getOpponents(source.getControllerId()).contains(creature.getControllerId())) {
return true;
}
}
return false;
}
}

View file

@ -128,6 +128,7 @@ public final class CoreSet2019 extends ExpansionSet {
cards.add(new SetCardInfo("Invoke the Divine", 16, Rarity.COMMON, mage.cards.i.InvokeTheDivine.class));
cards.add(new SetCardInfo("Isareth the Awakener", 104, Rarity.RARE, mage.cards.i.IsarethTheAwakener.class));
cards.add(new SetCardInfo("Isolate", 17, Rarity.RARE, mage.cards.i.Isolate.class));
cards.add(new SetCardInfo("Isolation Tower", 249, Rarity.RARE, mage.cards.i.IsolationTower.class));
cards.add(new SetCardInfo("Kargan Dragonrider", 297, Rarity.COMMON, mage.cards.k.KarganDragonrider.class));
cards.add(new SetCardInfo("Knight of the Tusk", 18, Rarity.COMMON, mage.cards.k.KnightOfTheTusk.class));
cards.add(new SetCardInfo("Knight's Pledge", 19, Rarity.COMMON, mage.cards.k.KnightsPledge.class));