forked from External/mage
[MOC] Implement Elspeth's Talent
This commit is contained in:
parent
be03991af5
commit
bc752a2107
2 changed files with 101 additions and 0 deletions
100
Mage.Sets/src/mage/cards/e/ElspethsTalent.java
Normal file
100
Mage.Sets/src/mage/cards/e/ElspethsTalent.java
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.SoldierToken;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetPlaneswalkerPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class ElspethsTalent extends CardImpl {
|
||||
|
||||
public ElspethsTalent(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}");
|
||||
|
||||
this.subtype.add(SubType.AURA);
|
||||
|
||||
// Enchant planeswalker
|
||||
TargetPermanent auraTarget = new TargetPlaneswalkerPermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
this.addAbility(new EnchantAbility(auraTarget));
|
||||
|
||||
// Enchanted planeswalker has "[+1]: Create three 1/1 white Soldier creature tokens."
|
||||
this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect(
|
||||
new LoyaltyAbility(new CreateTokenEffect(new SoldierToken(), 3), 1),
|
||||
AttachmentType.AURA, Duration.WhileOnBattlefield, null, "planeswalker"
|
||||
)));
|
||||
|
||||
// Whenever you activate a loyalty ability of enchanted planeswalker, creatures you control get +2/+2 and gain vigilance until end of turn.
|
||||
this.addAbility(new ElspethsTalentTriggeredAbility());
|
||||
}
|
||||
|
||||
private ElspethsTalent(final ElspethsTalent card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElspethsTalent copy() {
|
||||
return new ElspethsTalent(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ElspethsTalentTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
ElspethsTalentTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new BoostControlledEffect(2, 2, Duration.EndOfTurn));
|
||||
this.addEffect(new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE));
|
||||
}
|
||||
|
||||
private ElspethsTalentTriggeredAbility(final ElspethsTalentTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElspethsTalentTriggeredAbility copy() {
|
||||
return new ElspethsTalentTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ACTIVATED_ABILITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = getSourcePermanentIfItStillExists(game);
|
||||
return permanent != null
|
||||
&& event.getSourceId().equals(permanent.getAttachedTo())
|
||||
&& isControlledBy(event.getPlayerId())
|
||||
&& game
|
||||
.getAbility(event.getTargetId(), event.getSourceId())
|
||||
.map(LoyaltyAbility.class::isInstance)
|
||||
.orElse(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever you activate a loyalty ability of enchanted planeswalker, " +
|
||||
"creatures you control get +2/+2 and gain vigilance until end of turn.";
|
||||
}
|
||||
}
|
||||
|
|
@ -97,6 +97,7 @@ public final class MarchOfTheMachineCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Elenda and Azor", 6, Rarity.MYTHIC, mage.cards.e.ElendaAndAzor.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Elenda and Azor", 90, Rarity.MYTHIC, mage.cards.e.ElendaAndAzor.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Elite Scaleguard", 181, Rarity.UNCOMMON, mage.cards.e.EliteScaleguard.class));
|
||||
cards.add(new SetCardInfo("Elspeth's Talent", 72, Rarity.RARE, mage.cards.e.ElspethsTalent.class));
|
||||
cards.add(new SetCardInfo("Elspeth, Sun's Champion", 182, Rarity.MYTHIC, mage.cards.e.ElspethSunsChampion.class));
|
||||
cards.add(new SetCardInfo("Emergent Woodwurm", 37, Rarity.RARE, mage.cards.e.EmergentWoodwurm.class));
|
||||
cards.add(new SetCardInfo("Emeria Angel", 183, Rarity.RARE, mage.cards.e.EmeriaAngel.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue