mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Implemented Agitator Ant
This commit is contained in:
parent
eaf412590a
commit
e37438caf6
2 changed files with 99 additions and 0 deletions
98
Mage.Sets/src/mage/cards/a/AgitatorAnt.java
Normal file
98
Mage.Sets/src/mage/cards/a/AgitatorAnt.java
Normal file
|
@ -0,0 +1,98 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.combat.GoadTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class AgitatorAnt extends CardImpl {
|
||||
|
||||
public AgitatorAnt(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
|
||||
|
||||
this.subtype.add(SubType.INSECT);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// At the beginning of your end step, each player may put two +1/+1 counters on a creature they control. Goad each creature that had counters put on it this way.
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
new AgitatorAntEffect(), TargetController.YOU, false
|
||||
));
|
||||
}
|
||||
|
||||
private AgitatorAnt(final AgitatorAnt card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AgitatorAnt copy() {
|
||||
return new AgitatorAnt(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AgitatorAntEffect extends OneShotEffect {
|
||||
|
||||
AgitatorAntEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "each player may put two +1/+1 counters on a creature they control. " +
|
||||
"Goad each creature that had counters put on it this way.";
|
||||
}
|
||||
|
||||
private AgitatorAntEffect(final AgitatorAntEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AgitatorAntEffect copy() {
|
||||
return new AgitatorAntEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Player player : game
|
||||
.getState()
|
||||
.getPlayersInRange(source.getControllerId(), game)
|
||||
.stream()
|
||||
.map(game::getPlayer)
|
||||
.filter(Objects::nonNull).collect(Collectors.toList())) {
|
||||
if (game.getBattlefield().countAll(
|
||||
StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game
|
||||
) < 1 || !player.chooseUse(
|
||||
Outcome.BoostCreature, "Put two +1/+1 counters on a creature you control?", source, game
|
||||
)) {
|
||||
continue;
|
||||
}
|
||||
TargetPermanent targetPermanent = new TargetControlledCreaturePermanent(0, 1);
|
||||
targetPermanent.setNotTarget(true);
|
||||
player.choose(Outcome.BoostCreature, targetPermanent, source.getSourceId(), game);
|
||||
Permanent permanent = game.getPermanent(targetPermanent.getFirstTarget());
|
||||
if (permanent == null || !permanent.addCounters(CounterType.P1P1.createInstance(2), source, game)) {
|
||||
continue;
|
||||
}
|
||||
new GoadTargetEffect().setTargetPointer(new FixedTarget(permanent, game)).apply(game, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -36,6 +36,7 @@ public final class Commander2020Edition extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Acidic Slime", 165, Rarity.UNCOMMON, mage.cards.a.AcidicSlime.class));
|
||||
cards.add(new SetCardInfo("Adriana, Captain of the Guard", 200, Rarity.RARE, mage.cards.a.AdrianaCaptainOfTheGuard.class));
|
||||
cards.add(new SetCardInfo("Aerial Responder", 72, Rarity.UNCOMMON, mage.cards.a.AerialResponder.class));
|
||||
cards.add(new SetCardInfo("Agitator Ant", 49, Rarity.RARE, mage.cards.a.AgitatorAnt.class));
|
||||
cards.add(new SetCardInfo("Ajani Unyielding", 201, Rarity.MYTHIC, mage.cards.a.AjaniUnyielding.class));
|
||||
cards.add(new SetCardInfo("Akroma's Vengeance", 74, Rarity.RARE, mage.cards.a.AkromasVengeance.class));
|
||||
cards.add(new SetCardInfo("Akroma, Angel of Wrath", 73, Rarity.MYTHIC, mage.cards.a.AkromaAngelOfWrath.class));
|
||||
|
|
Loading…
Reference in a new issue