1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-03-30 01:03:57 -09:00

[MOM] Implement Invasion of Kylem / Valor's Reach Tag Team

This commit is contained in:
theelk801 2023-04-15 17:37:14 -04:00
parent b90f6fc19d
commit e7f6173cc2
4 changed files with 168 additions and 0 deletions
Mage.Sets/src/mage
Mage/src/main/java/mage/game/permanent/token

View file

@ -0,0 +1,52 @@
package mage.cards.i;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SiegeAbility;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class InvasionOfKylem extends CardImpl {
public InvasionOfKylem(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.BATTLE}, "{2}{R}{W}");
this.subtype.add(SubType.SIEGE);
this.setStartingDefense(5);
this.secondSideCardClazz = mage.cards.v.ValorsReachTagTeam.class;
// (As a Siege enters, choose an opponent to protect it. You and others can attack it. When it's defeated, exile it, then cast it transformed.)
this.addAbility(new SiegeAbility());
// When Invasion of Kylem enters the battlefield, up to two target creatures each get +2/+0 and gain vigilance and haste until end of turn.
Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(2, 0)
.setText("up to two target creatures each get +2/+0"));
ability.addEffect(new GainAbilityTargetEffect(VigilanceAbility.getInstance())
.setText("and gain vigilance"));
ability.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance())
.setText("and haste until end of turn"));
ability.addTarget(new TargetCreaturePermanent(0, 2));
this.addAbility(ability);
}
private InvasionOfKylem(final InvasionOfKylem card) {
super(card);
}
@Override
public InvasionOfKylem copy() {
return new InvasionOfKylem(this);
}
}

View file

@ -0,0 +1,35 @@
package mage.cards.v;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.game.permanent.token.ValorsReachTagTeamToken;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ValorsReachTagTeam extends CardImpl {
public ValorsReachTagTeam(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "");
this.color.setWhite(true);
this.color.setBlue(true);
this.nightCard = true;
// Create two 3/2 red and white Warrior creature tokens with "Whenever this creature and at least one other creature token attack, put a +1/+1 counter on this creature."
this.getSpellAbility().addEffect(new CreateTokenEffect(new ValorsReachTagTeamToken(), 2));
}
private ValorsReachTagTeam(final ValorsReachTagTeam card) {
super(card);
}
@Override
public ValorsReachTagTeam copy() {
return new ValorsReachTagTeam(this);
}
}

View file

@ -162,6 +162,7 @@ public final class MarchOfTheMachine extends ExpansionSet {
cards.add(new SetCardInfo("Invasion of Kaldheim", 145, Rarity.RARE, mage.cards.i.InvasionOfKaldheim.class));
cards.add(new SetCardInfo("Invasion of Kamigawa", 62, Rarity.UNCOMMON, mage.cards.i.InvasionOfKamigawa.class));
cards.add(new SetCardInfo("Invasion of Karsus", 146, Rarity.RARE, mage.cards.i.InvasionOfKarsus.class));
cards.add(new SetCardInfo("Invasion of Kylem", 235, Rarity.UNCOMMON, mage.cards.i.InvasionOfKylem.class));
cards.add(new SetCardInfo("Invasion of Lorwyn", 236, Rarity.UNCOMMON, mage.cards.i.InvasionOfLorwyn.class));
cards.add(new SetCardInfo("Invasion of Mercadia", 147, Rarity.UNCOMMON, mage.cards.i.InvasionOfMercadia.class));
cards.add(new SetCardInfo("Invasion of Moag", 237, Rarity.UNCOMMON, mage.cards.i.InvasionOfMoag.class));
@ -322,6 +323,7 @@ public final class MarchOfTheMachine extends ExpansionSet {
cards.add(new SetCardInfo("Unseal the Necropolis", 128, Rarity.COMMON, mage.cards.u.UnsealTheNecropolis.class));
cards.add(new SetCardInfo("Urabrask", 169, Rarity.MYTHIC, mage.cards.u.Urabrask.class));
cards.add(new SetCardInfo("Urn of Godfire", 266, Rarity.COMMON, mage.cards.u.UrnOfGodfire.class));
cards.add(new SetCardInfo("Valor's Reach Tag Team", 235, Rarity.UNCOMMON, mage.cards.v.ValorsReachTagTeam.class));
cards.add(new SetCardInfo("Vanquish the Weak", 129, Rarity.COMMON, mage.cards.v.VanquishTheWeak.class));
cards.add(new SetCardInfo("Vengeant Earth", 212, Rarity.COMMON, mage.cards.v.VengeantEarth.class));
cards.add(new SetCardInfo("Vertex Paladin", 242, Rarity.UNCOMMON, mage.cards.v.VertexPaladin.class));

View file

@ -0,0 +1,79 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.PermanentToken;
/**
* @author TheElk801
*/
public final class ValorsReachTagTeamToken extends TokenImpl {
public ValorsReachTagTeamToken() {
super("Warrior Token", "3/2 red and white Warrior creature token with \"Whenever this creature and at least one other creature token attack, put a +1/+1 counter on this creature.\"");
cardType.add(CardType.CREATURE);
subtype.add(SubType.WARRIOR);
color.setWhite(true);
color.setRed(true);
power = new MageInt(3);
toughness = new MageInt(2);
this.addAbility(new ValorsReachTagTeamTokenTriggeredAbility());
}
private ValorsReachTagTeamToken(final ValorsReachTagTeamToken token) {
super(token);
}
public ValorsReachTagTeamToken copy() {
return new ValorsReachTagTeamToken(this);
}
}
class ValorsReachTagTeamTokenTriggeredAbility extends TriggeredAbilityImpl {
ValorsReachTagTeamTokenTriggeredAbility() {
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()));
}
private ValorsReachTagTeamTokenTriggeredAbility(final ValorsReachTagTeamTokenTriggeredAbility ability) {
super(ability);
}
@Override
public ValorsReachTagTeamTokenTriggeredAbility copy() {
return new ValorsReachTagTeamTokenTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DECLARED_ATTACKERS;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return game
.getCombat()
.getAttackers()
.contains(getSourceId())
&& game
.getCombat()
.getAttackers()
.stream()
.filter(uuid -> !getSourceId().equals(uuid))
.map(game::getPermanent)
.anyMatch(PermanentToken.class::isInstance);
}
@Override
public String getRule() {
return "Whenever this creature and at least one other creature token attack, put a +1/+1 counter on this creature.";
}
}