diff --git a/Mage.Sets/src/mage/cards/d/DefendersOfHumanity.java b/Mage.Sets/src/mage/cards/d/DefendersOfHumanity.java new file mode 100644 index 0000000000..d965848ecb --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DefendersOfHumanity.java @@ -0,0 +1,63 @@ +package mage.cards.d; + +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.CompoundCondition; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.MyTurnCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.GetXValue; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.hint.common.CreaturesYouControlHint; +import mage.abilities.hint.common.MyTurnHint; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.game.permanent.token.AstartesWarriorToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class DefendersOfHumanity extends CardImpl { + + private static final Condition condition = new CompoundCondition( + "you control no creatures and only during your turn", MyTurnCondition.instance, + new PermanentsOnTheBattlefieldCondition( + StaticFilters.FILTER_PERMANENT_CREATURE, + ComparisonType.EQUAL_TO, 0, true + ) + ); + + public DefendersOfHumanity(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{X}{2}{W}"); + + // When Defenders of Humanity enters the battlefield, create X 2/2 white Astartes Warrior creature tokens with vigilance. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new CreateTokenEffect(new AstartesWarriorToken(), ManacostVariableValue.ETB) + )); + + // {X}{2}{W}, Exile Defenders of Humanity: Create X 2/2 white Astartes Warrior creature tokens with vigilance. Activate only if you control no creatures and only during your turn. + this.addAbility(new ActivateIfConditionActivatedAbility( + Zone.BATTLEFIELD, + new CreateTokenEffect( + new AstartesWarriorToken(), GetXValue.instance + ), new ManaCostsImpl<>("{X}{2}{W}"), condition + ).addHint(CreaturesYouControlHint.instance).addHint(MyTurnHint.instance)); + } + + private DefendersOfHumanity(final DefendersOfHumanity card) { + super(card); + } + + @Override + public DefendersOfHumanity copy() { + return new DefendersOfHumanity(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Warhammer40000.java b/Mage.Sets/src/mage/sets/Warhammer40000.java index 8c7f4afa6e..fa70328cd1 100644 --- a/Mage.Sets/src/mage/sets/Warhammer40000.java +++ b/Mage.Sets/src/mage/sets/Warhammer40000.java @@ -81,6 +81,7 @@ public final class Warhammer40000 extends ExpansionSet { cards.add(new SetCardInfo("Death's Presence", 212, Rarity.RARE, mage.cards.d.DeathsPresence.class)); cards.add(new SetCardInfo("Deathleaper, Terror Weapon", 115, Rarity.RARE, mage.cards.d.DeathleaperTerrorWeapon.class)); cards.add(new SetCardInfo("Decree of Pain", 198, Rarity.RARE, mage.cards.d.DecreeOfPain.class)); + cards.add(new SetCardInfo("Defenders of Humanity", 11, Rarity.RARE, mage.cards.d.DefendersOfHumanity.class)); cards.add(new SetCardInfo("Defile", 199, Rarity.UNCOMMON, mage.cards.d.Defile.class)); cards.add(new SetCardInfo("Deny Reality", 223, Rarity.COMMON, mage.cards.d.DenyReality.class)); cards.add(new SetCardInfo("Deploy to the Front", 184, Rarity.RARE, mage.cards.d.DeployToTheFront.class));