[40K] Implement Marneus Calgar (#9629)

This commit is contained in:
PurpleCrowbar 2022-10-08 18:51:56 +01:00 committed by GitHub
parent f2d42b2836
commit 2e5e69749e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 96 additions and 0 deletions

View file

@ -0,0 +1,95 @@
package mage.cards.m;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeGroupEvent;
import mage.game.permanent.PermanentImpl;
import mage.game.permanent.token.AstartesWarriorToken;
import java.util.Objects;
import java.util.UUID;
/**
* @author PurpleCrowbar
*/
public final class MarneusCalgar extends CardImpl {
public MarneusCalgar(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{U}{B}");
addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.ASTARTES, SubType.WARRIOR);
this.power = new MageInt(3);
this.toughness = new MageInt(5);
// Double strike
this.addAbility(DoubleStrikeAbility.getInstance());
// Master Tactician Whenever one or more tokens enter the battlefield under your control, draw a card.
this.addAbility(new MarneusCalgarTriggeredAbility());
// Chapter Master {6}: Create two 2/2 white Astartes Warrior creature tokens with vigilance.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new CreateTokenEffect(new AstartesWarriorToken(), 2),
new ManaCostsImpl<>("{6}")
).withFlavorWord("Chapter Master"));
}
private MarneusCalgar(final MarneusCalgar card) {
super(card);
}
@Override
public MarneusCalgar copy() {
return new MarneusCalgar(this);
}
}
class MarneusCalgarTriggeredAbility extends TriggeredAbilityImpl {
MarneusCalgarTriggeredAbility() {
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), false);
this.withFlavorWord("Master Tactician");
setTriggerPhrase("Whenever one or more tokens enter the battlefield under your control, ");
}
private MarneusCalgarTriggeredAbility(final MarneusCalgarTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ZONE_CHANGE_GROUP;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeGroupEvent zEvent = (ZoneChangeGroupEvent) event;
return Zone.BATTLEFIELD == zEvent.getToZone()
&& zEvent.getTokens() != null
&& zEvent
.getTokens()
.stream()
.filter(Objects::nonNull)
.map(PermanentImpl::getControllerId)
.anyMatch(this::isControlledBy);
}
@Override
public MarneusCalgarTriggeredAbility copy() {
return new MarneusCalgarTriggeredAbility(this);
}
}

View file

@ -152,6 +152,7 @@ public final class Warhammer40000 extends ExpansionSet {
cards.add(new SetCardInfo("Magnus the Red", 131, Rarity.RARE, mage.cards.m.MagnusTheRed.class));
cards.add(new SetCardInfo("Malanthrope", 132, Rarity.RARE, mage.cards.m.Malanthrope.class));
cards.add(new SetCardInfo("Mandate of Abaddon", 40, Rarity.RARE, mage.cards.m.MandateOfAbaddon.class));
cards.add(new SetCardInfo("Marneus Calgar", 8, Rarity.MYTHIC, mage.cards.m.MarneusCalgar.class));
cards.add(new SetCardInfo("Martial Coup", 189, Rarity.RARE, mage.cards.m.MartialCoup.class));
cards.add(new SetCardInfo("Mask of Memory", 243, Rarity.UNCOMMON, mage.cards.m.MaskOfMemory.class));
cards.add(new SetCardInfo("Mawloc", 133, Rarity.RARE, mage.cards.m.Mawloc.class));