mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
[AFR] Implemented The Book of Exalted Deeds
This commit is contained in:
parent
9d9c8bf5ab
commit
dff5b201d5
5 changed files with 157 additions and 14 deletions
|
@ -1,8 +1,5 @@
|
|||
|
||||
|
||||
package mage.cards.p;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -11,28 +8,27 @@ import mage.abilities.keyword.FlyingAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public final class PlatinumAngel extends CardImpl {
|
||||
|
||||
public PlatinumAngel(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{7}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{7}");
|
||||
this.subtype.add(SubType.ANGEL);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlatinumAngelEffect()));
|
||||
this.addAbility(new SimpleStaticAbility(new PlatinumAngelEffect()));
|
||||
}
|
||||
|
||||
private PlatinumAngel(final PlatinumAngel card) {
|
||||
|
@ -67,13 +63,13 @@ public final class PlatinumAngel extends CardImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if ((event.getType() == GameEvent.EventType.WINS && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) ||
|
||||
(event.getType() == GameEvent.EventType.LOSES && event.getPlayerId().equals(source.getControllerId()))) {
|
||||
return true;
|
||||
switch (event.getType()) {
|
||||
case WINS:
|
||||
return game.getOpponents(source.getControllerId()).contains(event.getPlayerId());
|
||||
case LOSES:
|
||||
return source.isControlledBy(event.getPlayerId());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
109
Mage.Sets/src/mage/cards/t/TheBookOfExaltedDeeds.java
Normal file
109
Mage.Sets/src/mage/cards/t/TheBookOfExaltedDeeds.java
Normal file
|
@ -0,0 +1,109 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
|
||||
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.YouGainedLifeCondition;
|
||||
import mage.abilities.costs.common.ExileSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.abilities.hint.ConditionHint;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.token.GriffinToken;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.watchers.common.PlayerGainedLifeWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class TheBookOfExaltedDeeds extends CardImpl {
|
||||
|
||||
private static final Condition condition = new YouGainedLifeCondition(ComparisonType.MORE_THAN, 2);
|
||||
private static final Hint hint = new ConditionHint(condition, "You gained 3 or more life this turn");
|
||||
private static final FilterPermanent filter = new FilterPermanent(SubType.ANGEL, "Angel");
|
||||
|
||||
public TheBookOfExaltedDeeds(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{W}{W}{W}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
|
||||
// At the beginning of your end step, if you gained 3 or more life this turn, create a 3/3 white Angel creature token with flying.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfEndStepTriggeredAbility(
|
||||
new CreateTokenEffect(new GriffinToken()), TargetController.YOU, false
|
||||
), condition, "At the beginning of your end step, " +
|
||||
"if you gained 3 or more life this turn, create a 3/3 white Angel creature token with flying."
|
||||
).addHint(hint), new PlayerGainedLifeWatcher());
|
||||
|
||||
// {W}{W}{W}, {T}, Exile The Book of Exalted Deeds: Put an enlightened counter on target Angel. It gains "You can't lose the game and your opponents can't win the game." Activate only as a sorcery.
|
||||
Ability ability = new ActivateAsSorceryActivatedAbility(
|
||||
new AddCountersTargetEffect(CounterType.ENLIGHTENED.createInstance()), new ManaCostsImpl<>("{W}{W}{W}")
|
||||
);
|
||||
ability.addEffect(new GainAbilityTargetEffect(
|
||||
new SimpleStaticAbility(new TheBookOfExaltedDeedsEffect()), Duration.Custom,
|
||||
"It gains \"You can't lose the game and your opponents can't win the game.\""
|
||||
));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new ExileSourceCost());
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private TheBookOfExaltedDeeds(final TheBookOfExaltedDeeds card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TheBookOfExaltedDeeds copy() {
|
||||
return new TheBookOfExaltedDeeds(this);
|
||||
}
|
||||
}
|
||||
|
||||
class TheBookOfExaltedDeedsEffect extends ContinuousRuleModifyingEffectImpl {
|
||||
|
||||
TheBookOfExaltedDeedsEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit, false, false);
|
||||
staticText = "You can't lose the game and your opponents can't win the game";
|
||||
}
|
||||
|
||||
private TheBookOfExaltedDeedsEffect(final TheBookOfExaltedDeedsEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TheBookOfExaltedDeedsEffect copy() {
|
||||
return new TheBookOfExaltedDeedsEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
switch (event.getType()) {
|
||||
case WINS:
|
||||
return game.getOpponents(source.getControllerId()).contains(event.getPlayerId());
|
||||
case LOSES:
|
||||
return source.isControlledBy(event.getPlayerId());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -197,6 +197,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Sylvan Shepherd", 206, Rarity.COMMON, mage.cards.s.SylvanShepherd.class));
|
||||
cards.add(new SetCardInfo("Targ Nar, Demon-Fang Gnoll", 234, Rarity.UNCOMMON, mage.cards.t.TargNarDemonFangGnoll.class));
|
||||
cards.add(new SetCardInfo("Tasha's Hideous Laughter", 78, Rarity.RARE, mage.cards.t.TashasHideousLaughter.class));
|
||||
cards.add(new SetCardInfo("The Book of Exalted Deeds", 4, Rarity.MYTHIC, mage.cards.t.TheBookOfExaltedDeeds.class));
|
||||
cards.add(new SetCardInfo("The Deck of Many Things", 241, Rarity.MYTHIC, mage.cards.t.TheDeckOfManyThings.class));
|
||||
cards.add(new SetCardInfo("Tiamat", 235, Rarity.MYTHIC, mage.cards.t.Tiamat.class));
|
||||
cards.add(new SetCardInfo("Tiger-Tribe Hunter", 163, Rarity.UNCOMMON, mage.cards.t.TigerTribeHunter.class));
|
||||
|
|
|
@ -50,6 +50,7 @@ public enum CounterType {
|
|||
EGG("egg"),
|
||||
ELIXIR("elixir"),
|
||||
ENERGY("energy"),
|
||||
ENLIGHTENED("enlightened"),
|
||||
EON("eon"),
|
||||
EXPERIENCE("experience"),
|
||||
EYEBALL("eyeball"),
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class Angel33Token extends TokenImpl {
|
||||
|
||||
public Angel33Token() {
|
||||
super("Angel", "3/3 white Angel creature token with flying");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setWhite(true);
|
||||
subtype.add(SubType.ANGEL);
|
||||
power = new MageInt(3);
|
||||
toughness = new MageInt(3);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
availableImageSetCodes = Arrays.asList("AFR");
|
||||
}
|
||||
|
||||
public Angel33Token(final Angel33Token token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public Angel33Token copy() {
|
||||
return new Angel33Token(this);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue