mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 19:11:59 -08:00
[LTC] Implement Archivist of Gondor
This commit is contained in:
parent
c2ae74759d
commit
cb283cdf82
4 changed files with 82 additions and 1 deletions
63
Mage.Sets/src/mage/cards/a/ArchivistOfGondor.java
Normal file
63
Mage.Sets/src/mage/cards/a/ArchivistOfGondor.java
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
package mage.cards.a;
|
||||||
|
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||||
|
import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility;
|
||||||
|
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||||
|
import mage.abilities.effects.common.BecomesMonarchSourceEffect;
|
||||||
|
import mage.abilities.effects.common.DrawCardTargetEffect;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.SetTargetPointer;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.constants.TargetController;
|
||||||
|
import mage.filter.FilterPermanent;
|
||||||
|
import mage.filter.predicate.mageobject.CommanderPredicate;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public final class ArchivistOfGondor extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterPermanent filter = new FilterPermanent();
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(CommanderPredicate.instance);
|
||||||
|
filter.add(TargetController.YOU.getOwnerPredicate());
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArchivistOfGondor(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
|
||||||
|
|
||||||
|
this.subtype.add(SubType.HUMAN);
|
||||||
|
this.subtype.add(SubType.ADVISOR);
|
||||||
|
this.power = new MageInt(2);
|
||||||
|
this.toughness = new MageInt(3);
|
||||||
|
|
||||||
|
// When your commander deals combat damage to a player, if there is no monarch, you become the monarch.
|
||||||
|
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||||
|
new DealsDamageToAPlayerAllTriggeredAbility(
|
||||||
|
new BecomesMonarchSourceEffect(), filter, false,
|
||||||
|
SetTargetPointer.NONE, true
|
||||||
|
), (game, source) -> game.getMonarchId() == null, "When your commander " +
|
||||||
|
"deals combat damage to a player, if there is no monarch, you become the monarch."
|
||||||
|
));
|
||||||
|
|
||||||
|
// At the beginning of the monarch's end step, that player draws a card.
|
||||||
|
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||||
|
new DrawCardTargetEffect(1), TargetController.MONARCH, false
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
private ArchivistOfGondor(final ArchivistOfGondor card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ArchivistOfGondor copy() {
|
||||||
|
return new ArchivistOfGondor(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -23,6 +23,7 @@ public final class TalesOfMiddleEarthCommander extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Arbor Elf", 232, Rarity.COMMON, mage.cards.a.ArborElf.class));
|
cards.add(new SetCardInfo("Arbor Elf", 232, Rarity.COMMON, mage.cards.a.ArborElf.class));
|
||||||
cards.add(new SetCardInfo("Arcane Denial", 184, Rarity.COMMON, mage.cards.a.ArcaneDenial.class));
|
cards.add(new SetCardInfo("Arcane Denial", 184, Rarity.COMMON, mage.cards.a.ArcaneDenial.class));
|
||||||
cards.add(new SetCardInfo("Arcane Signet", 273, Rarity.COMMON, mage.cards.a.ArcaneSignet.class));
|
cards.add(new SetCardInfo("Arcane Signet", 273, Rarity.COMMON, mage.cards.a.ArcaneSignet.class));
|
||||||
|
cards.add(new SetCardInfo("Archivist of Gondor", 18, Rarity.RARE, mage.cards.a.ArchivistOfGondor.class));
|
||||||
cards.add(new SetCardInfo("Asceticism", 233, Rarity.RARE, mage.cards.a.Asceticism.class));
|
cards.add(new SetCardInfo("Asceticism", 233, Rarity.RARE, mage.cards.a.Asceticism.class));
|
||||||
cards.add(new SetCardInfo("Ash Barrens", 295, Rarity.UNCOMMON, mage.cards.a.AshBarrens.class));
|
cards.add(new SetCardInfo("Ash Barrens", 295, Rarity.UNCOMMON, mage.cards.a.AshBarrens.class));
|
||||||
cards.add(new SetCardInfo("Banishing Light", 161, Rarity.UNCOMMON, mage.cards.b.BanishingLight.class));
|
cards.add(new SetCardInfo("Banishing Light", 161, Rarity.UNCOMMON, mage.cards.b.BanishingLight.class));
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,14 @@ public class BeginningOfEndStepTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
this.getEffects().setTargetPointer(new FixedTarget(event.getPlayerId()));
|
this.getEffects().setTargetPointer(new FixedTarget(event.getPlayerId()));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
case MONARCH:
|
||||||
|
if (!event.getPlayerId().equals(game.getMonarchId())) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (getTargets().isEmpty()) {
|
||||||
|
this.getEffects().setTargetPointer(new FixedTarget(event.getPlayerId()));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -120,6 +128,8 @@ public class BeginningOfEndStepTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
return "At the beginning of the end step of enchanted permanent's controller, " + generateConditionString();
|
return "At the beginning of the end step of enchanted permanent's controller, " + generateConditionString();
|
||||||
case ENCHANTED:
|
case ENCHANTED:
|
||||||
return "At the beginning of enchanted player's end step, " + generateConditionString();
|
return "At the beginning of enchanted player's end step, " + generateConditionString();
|
||||||
|
case MONARCH:
|
||||||
|
return "At the beginning the monarch's end step, " + generateConditionString();
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,8 @@ public enum TargetController {
|
||||||
NEXT,
|
NEXT,
|
||||||
EACH_PLAYER,
|
EACH_PLAYER,
|
||||||
ENCHANTED,
|
ENCHANTED,
|
||||||
SOURCE_TARGETS;
|
SOURCE_TARGETS,
|
||||||
|
MONARCH;
|
||||||
|
|
||||||
private final OwnerPredicate ownerPredicate;
|
private final OwnerPredicate ownerPredicate;
|
||||||
private final PlayerPredicate playerPredicate;
|
private final PlayerPredicate playerPredicate;
|
||||||
|
|
@ -79,6 +80,8 @@ public enum TargetController {
|
||||||
return permanent != null && input.getObject().isOwnedBy(permanent.getAttachedTo());
|
return permanent != null && input.getObject().isOwnedBy(permanent.getAttachedTo());
|
||||||
case SOURCE_TARGETS:
|
case SOURCE_TARGETS:
|
||||||
return card.isOwnedBy(input.getSource().getFirstTarget());
|
return card.isOwnedBy(input.getSource().getFirstTarget());
|
||||||
|
case MONARCH:
|
||||||
|
return card.isOwnedBy(game.getMonarchId());
|
||||||
case ANY:
|
case ANY:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
|
|
@ -118,6 +121,8 @@ public enum TargetController {
|
||||||
return !player.getId().equals(playerId);
|
return !player.getId().equals(playerId);
|
||||||
case SOURCE_TARGETS:
|
case SOURCE_TARGETS:
|
||||||
return player.equals(input.getSource().getFirstTarget());
|
return player.equals(input.getSource().getFirstTarget());
|
||||||
|
case MONARCH:
|
||||||
|
return player.getId().equals(game.getMonarchId());
|
||||||
default:
|
default:
|
||||||
throw new UnsupportedOperationException("TargetController not supported");
|
throw new UnsupportedOperationException("TargetController not supported");
|
||||||
}
|
}
|
||||||
|
|
@ -159,6 +164,8 @@ public enum TargetController {
|
||||||
return permanent != null && input.getObject().isControlledBy(permanent.getAttachedTo());
|
return permanent != null && input.getObject().isControlledBy(permanent.getAttachedTo());
|
||||||
case SOURCE_TARGETS:
|
case SOURCE_TARGETS:
|
||||||
return object.isControlledBy(input.getSource().getFirstTarget());
|
return object.isControlledBy(input.getSource().getFirstTarget());
|
||||||
|
case MONARCH:
|
||||||
|
return object.isControlledBy(game.getMonarchId());
|
||||||
case ANY:
|
case ANY:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue