Implemented Alaborn Zealot, fixed text on several cards with block triggers

This commit is contained in:
Evan Kranzler 2017-10-04 14:32:13 -04:00
parent 6725c50b4a
commit ee5bd655c6
9 changed files with 96 additions and 48 deletions

View file

@ -67,7 +67,7 @@ public class AgelessSentinels extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// When Ageless Sentinels blocks, it becomes a Bird Giant, and it loses defender.
Ability ability = new BlocksTriggeredAbility(new AgelessSentinelsEffect(), false);
Ability ability = new BlocksTriggeredAbility(new AgelessSentinelsEffect(), false, false, true);
Effect effect = new LoseAbilitySourceEffect(DefenderAbility.getInstance(), Duration.WhileOnBattlefield);
effect.setText("and it loses defender");
ability.addEffect(effect);

View file

@ -0,0 +1,69 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.effects.common.DestroySourceEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
/**
*
* @author TheElk801
*/
public class AlabornZealot extends CardImpl {
public AlabornZealot(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.SOLDIER);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// When Alaborn Zealot blocks a creature, destroy that creature and Alaborn Zealot.
Ability ability = new BlocksTriggeredAbility(new DestroyTargetEffect().setText("destroy that creature"), false, true, true);
ability.addEffect(new DestroySourceEffect().setText("and {this}"));
this.addAbility(ability);
}
public AlabornZealot(final AlabornZealot card) {
super(card);
}
@Override
public AlabornZealot copy() {
return new AlabornZealot(this);
}
}

View file

@ -55,9 +55,10 @@ public class CinderWall extends CardImpl {
// Defender
this.addAbility(DefenderAbility.getInstance());
// When Cinder Wall blocks, destroy it at end of combat.
this.addAbility(
new BlocksTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroySourceEffect()))
, false));
this.addAbility(new BlocksTriggeredAbility(
new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroySourceEffect())),
false, false, true
));
}
public CinderWall(final CinderWall card) {

View file

@ -80,7 +80,10 @@ public class DefiantVanguard extends CardImpl {
// When Defiant Vanguard blocks, at end of combat, destroy it and all creatures it blocked this turn.
this.addAbility(
new BlocksTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DefiantVanguardEffect())), false),
new BlocksTriggeredAbility(
new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DefiantVanguardEffect())),
false, false, true
),
new BlockedAttackerWatcher()
);

View file

@ -31,14 +31,12 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroySourceEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
@ -55,7 +53,9 @@ public class LoyalSentry extends CardImpl {
this.toughness = new MageInt(1);
// When Loyal Sentry blocks a creature, destroy that creature and Loyal Sentry.
this.addAbility(new BlocksTriggeredAbility(new LoyalSentryEffect(), false, true));
Ability ability = new BlocksTriggeredAbility(new DestroyTargetEffect().setText("destroy that creature"), false, true, true);
ability.addEffect(new DestroySourceEffect().setText("and {this}"));
this.addAbility(ability);
}
public LoyalSentry(final LoyalSentry card) {
@ -67,34 +67,3 @@ public class LoyalSentry extends CardImpl {
return new LoyalSentry(this);
}
}
class LoyalSentryEffect extends OneShotEffect {
LoyalSentryEffect() {
super(Outcome.DestroyPermanent);
staticText = "destroy that creature and {this}";
}
LoyalSentryEffect(LoyalSentryEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent p = game.getPermanent(getTargetPointer().getFirst(game, source));
if (p != null) {
p.destroy(source.getSourceId(), game, false);
}
Permanent s = game.getPermanent(source.getSourceId());
if (s != null) {
s.destroy(source.getSourceId(), game, false);
}
return true;
}
@Override
public LoyalSentryEffect copy() {
return new LoyalSentryEffect(this);
}
}

View file

@ -57,8 +57,11 @@ public class StoicEphemera extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Stoic Ephemera blocks, sacrifice it at end of combat.
this.addAbility(new BlocksTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(
new AtTheEndOfCombatDelayedTriggeredAbility(new SacrificeSourceEffect())), false));
this.addAbility(new BlocksTriggeredAbility(
new CreateDelayedTriggeredAbilityEffect(
new AtTheEndOfCombatDelayedTriggeredAbility(new SacrificeSourceEffect())
), false, false, true
));
}
public StoicEphemera(final StoicEphemera card) {

View file

@ -59,7 +59,7 @@ public class WallOfJunk extends CardImpl {
Effect effect = new CreateDelayedTriggeredAbilityEffect(
new AtTheEndOfCombatDelayedTriggeredAbility(new ReturnToHandSourceEffect(true)));
effect.setText("return it to its owner's hand at end of combat");
this.addAbility(new BlocksTriggeredAbility(effect, false));
this.addAbility(new BlocksTriggeredAbility(effect, false, false, true));
}
public WallOfJunk(final WallOfJunk card) {

View file

@ -51,7 +51,9 @@ public class ZephyrSpirit extends CardImpl {
// When Zephyr Spirit blocks, return it to its owner's hand.
this.addAbility(new BlocksTriggeredAbility(
new ReturnToHandSourceEffect(true).setText("return it to its owner's hand"), false));
new ReturnToHandSourceEffect(true).setText("return it to its owner's hand"),
false, false, true
));
}
public ZephyrSpirit(final ZephyrSpirit card) {

View file

@ -64,6 +64,7 @@ public class PortalSecondAge extends ExpansionSet {
cards.add(new SetCardInfo("Alaborn Musketeer", 123, Rarity.COMMON, mage.cards.a.AlabornMusketeer.class));
cards.add(new SetCardInfo("Alaborn Trooper", 124, Rarity.COMMON, mage.cards.a.AlabornTrooper.class));
cards.add(new SetCardInfo("Alaborn Veteran", 125, Rarity.RARE, mage.cards.a.AlabornVeteran.class));
cards.add(new SetCardInfo("Alaborn Zealot", 126, Rarity.UNCOMMON, mage.cards.a.AlabornZealot.class));
cards.add(new SetCardInfo("Alluring Scent", 61, Rarity.RARE, mage.cards.a.AlluringScent.class));
cards.add(new SetCardInfo("Ancient Craving", 2, Rarity.RARE, mage.cards.a.AncientCraving.class));
cards.add(new SetCardInfo("Angelic Blessing", 129, Rarity.COMMON, mage.cards.a.AngelicBlessing.class));