mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Implemented Agent of Treachery
This commit is contained in:
parent
11dcc127a1
commit
c94ed2bf75
2 changed files with 72 additions and 0 deletions
71
Mage.Sets/src/mage/cards/a/AgentOfTreachery.java
Normal file
71
Mage.Sets/src/mage/cards/a/AgentOfTreachery.java
Normal file
|
@ -0,0 +1,71 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.game.Game;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class AgentOfTreachery extends CardImpl {
|
||||
|
||||
public AgentOfTreachery(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{U}");
|
||||
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.ROGUE);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// When Agent of Treachery enters the battlefield, gain control of target permanent.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new GainControlTargetEffect(Duration.Custom));
|
||||
ability.addTarget(new TargetPermanent());
|
||||
this.addAbility(ability);
|
||||
|
||||
// At the beginning of your end step, if you control three or more permanents you don't own, draw three cards.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfEndStepTriggeredAbility(
|
||||
new DrawCardSourceControllerEffect(3),
|
||||
TargetController.YOU, false
|
||||
), AgentOfTreacheryCondition.instance, "At the beginning of your end step, " +
|
||||
"if you control three or more permanents you don't own, draw three cards."
|
||||
));
|
||||
}
|
||||
|
||||
private AgentOfTreachery(final AgentOfTreachery card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AgentOfTreachery copy() {
|
||||
return new AgentOfTreachery(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum AgentOfTreacheryCondition implements Condition {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return game.getBattlefield()
|
||||
.getAllActivePermanents(source.getControllerId())
|
||||
.stream()
|
||||
.map(permanent -> !permanent.getOwnerId().equals(source.getControllerId()))
|
||||
.count() > 2;
|
||||
}
|
||||
}
|
|
@ -28,6 +28,7 @@ public final class CoreSet2020 extends ExpansionSet {
|
|||
this.maxCardNumberInBooster = 280;
|
||||
|
||||
cards.add(new SetCardInfo("Aerial Assault", 1, Rarity.COMMON, mage.cards.a.AerialAssault.class));
|
||||
cards.add(new SetCardInfo("Agent of Treachery", 43, Rarity.RARE, mage.cards.a.AgentOfTreachery.class));
|
||||
cards.add(new SetCardInfo("Ajani, Strength of the Pride", 2, Rarity.MYTHIC, mage.cards.a.AjaniStrengthOfThePride.class));
|
||||
cards.add(new SetCardInfo("Angel of Vitality", 4, Rarity.UNCOMMON, mage.cards.a.AngelOfVitality.class));
|
||||
cards.add(new SetCardInfo("Atemsis, All-Seeing", 46, Rarity.RARE, mage.cards.a.AtemsisAllSeeing.class));
|
||||
|
|
Loading…
Reference in a new issue