Implemented Thoughtbound Phantasm

This commit is contained in:
Evan Kranzler 2018-09-13 21:24:30 -04:00
parent e5a7c7d90a
commit 41a0ead77c
2 changed files with 97 additions and 0 deletions

View file

@ -0,0 +1,96 @@
package mage.cards.t;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.SourceHasCounterCondition;
import mage.abilities.decorator.ConditionalAsThoughEffect;
import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.constants.SubType;
import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author TheElk801
*/
public final class ThoughtboundPhantasm extends CardImpl {
public ThoughtboundPhantasm(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}");
this.subtype.add(SubType.SPIRIT);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Defender
this.addAbility(DefenderAbility.getInstance());
// Whenever you surveil, put a +1/+1 counter on Thoughtbound Phantasm.
this.addAbility(new ThoughtboundPhantasmTriggeredAbility());
// As long as Thoughtbound Phantasm has three or more +1/+1 counters on it, it can attack as though it didn't have defender.
this.addAbility(new SimpleStaticAbility(
Zone.BATTLEFIELD,
new ConditionalAsThoughEffect(
new CanAttackAsThoughItDidntHaveDefenderSourceEffect(
Duration.WhileOnBattlefield
), new SourceHasCounterCondition(CounterType.P1P1, 3)
).setText("As long as {this} has three "
+ "or more +1/+1 counters on it, "
+ "it can attack as though it "
+ "didn't have defender.")
));
}
public ThoughtboundPhantasm(final ThoughtboundPhantasm card) {
super(card);
}
@Override
public ThoughtboundPhantasm copy() {
return new ThoughtboundPhantasm(this);
}
}
class ThoughtboundPhantasmTriggeredAbility extends TriggeredAbilityImpl {
public ThoughtboundPhantasmTriggeredAbility() {
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(
CounterType.P1P1.createInstance()
), false);
}
public ThoughtboundPhantasmTriggeredAbility(final ThoughtboundPhantasmTriggeredAbility ability) {
super(ability);
}
@Override
public ThoughtboundPhantasmTriggeredAbility copy() {
return new ThoughtboundPhantasmTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SURVEIL;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getPlayerId().equals(this.getControllerId());
}
@Override
public String getRule() {
return "Whenever you surveil, put a +1/+1 counter on {this}.";
}
}

View file

@ -135,6 +135,7 @@ public final class GuildsOfRavnica extends ExpansionSet {
cards.add(new SetCardInfo("Swarm Guildmage", 201, Rarity.UNCOMMON, mage.cards.s.SwarmGuildmage.class)); cards.add(new SetCardInfo("Swarm Guildmage", 201, Rarity.UNCOMMON, mage.cards.s.SwarmGuildmage.class));
cards.add(new SetCardInfo("Temple Garden", 258, Rarity.RARE, mage.cards.t.TempleGarden.class)); cards.add(new SetCardInfo("Temple Garden", 258, Rarity.RARE, mage.cards.t.TempleGarden.class));
cards.add(new SetCardInfo("Thought Erasure", 206, Rarity.UNCOMMON, mage.cards.t.ThoughtErasure.class)); cards.add(new SetCardInfo("Thought Erasure", 206, Rarity.UNCOMMON, mage.cards.t.ThoughtErasure.class));
cards.add(new SetCardInfo("Thoughtbound Phantasm", 55, Rarity.UNCOMMON, mage.cards.t.ThoughtboundPhantasm.class));
cards.add(new SetCardInfo("Underrealm Lich", 211, Rarity.MYTHIC, mage.cards.u.UnderrealmLich.class)); cards.add(new SetCardInfo("Underrealm Lich", 211, Rarity.MYTHIC, mage.cards.u.UnderrealmLich.class));
cards.add(new SetCardInfo("Unexplained Disappearance", 56, Rarity.COMMON, mage.cards.u.UnexplainedDisappearance.class)); cards.add(new SetCardInfo("Unexplained Disappearance", 56, Rarity.COMMON, mage.cards.u.UnexplainedDisappearance.class));
cards.add(new SetCardInfo("Vivid Revival", 148, Rarity.RARE, mage.cards.v.VividRevival.class)); cards.add(new SetCardInfo("Vivid Revival", 148, Rarity.RARE, mage.cards.v.VividRevival.class));