Implemented Smitten Swordmaster

This commit is contained in:
Evan Kranzler 2019-09-06 21:55:40 -04:00
parent 3b5d6fedc9
commit 7c81889972
2 changed files with 78 additions and 0 deletions

View file

@ -0,0 +1,77 @@
package mage.cards.s;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.AdventureCard;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.game.Game;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SmittenSwordmaster extends AdventureCard {
public SmittenSwordmaster(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, new CardType[]{CardType.SORCERY}, "{1}{B}", "Curry Favor", "{B}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.KNIGHT);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Lifelink
this.addAbility(LifelinkAbility.getInstance());
// Curry Favor
// You gain X life and each opponent loses X life, where X is the number of Knights you control.
this.getAdventureSpellAbility().addEffect(new CurryFavorEffect());
}
private SmittenSwordmaster(final SmittenSwordmaster card) {
super(card);
}
@Override
public SmittenSwordmaster copy() {
return new SmittenSwordmaster(this);
}
}
class CurryFavorEffect extends OneShotEffect {
CurryFavorEffect() {
super(Outcome.Benefit);
staticText = "you gain X life and each opponent loses X life, where X is the number of Knights you control";
}
private CurryFavorEffect(final CurryFavorEffect effect) {
super(effect);
}
@Override
public CurryFavorEffect copy() {
return new CurryFavorEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
int xValue = game.getBattlefield()
.getAllActivePermanents(source.getControllerId())
.stream()
.filter(permanent -> permanent != null && permanent.hasSubtype(SubType.KNIGHT, game))
.mapToInt(p -> 1)
.sum();
new GainLifeEffect(xValue).apply(game, source);
new LoseLifeOpponentsEffect(xValue).apply(game, source);
return true;
}
}

View file

@ -69,6 +69,7 @@ public final class ThroneOfEldraine extends ExpansionSet {
cards.add(new SetCardInfo("Shining Armor", 29, Rarity.COMMON, mage.cards.s.ShiningArmor.class)); cards.add(new SetCardInfo("Shining Armor", 29, Rarity.COMMON, mage.cards.s.ShiningArmor.class));
cards.add(new SetCardInfo("Silverflame Ritual", 30, Rarity.COMMON, mage.cards.s.SilverflameRitual.class)); cards.add(new SetCardInfo("Silverflame Ritual", 30, Rarity.COMMON, mage.cards.s.SilverflameRitual.class));
cards.add(new SetCardInfo("Slaying Fire", 143, Rarity.UNCOMMON, mage.cards.s.SlayingFire.class)); cards.add(new SetCardInfo("Slaying Fire", 143, Rarity.UNCOMMON, mage.cards.s.SlayingFire.class));
cards.add(new SetCardInfo("Smitten Swordmaster", 105, Rarity.COMMON, mage.cards.s.SmittenSwordmaster.class));
cards.add(new SetCardInfo("Steelbane Hydra", 322, Rarity.RARE, mage.cards.s.SteelbaneHydra.class)); cards.add(new SetCardInfo("Steelbane Hydra", 322, Rarity.RARE, mage.cards.s.SteelbaneHydra.class));
cards.add(new SetCardInfo("Steelclaw Lance", 202, Rarity.UNCOMMON, mage.cards.s.SteelclawLance.class)); cards.add(new SetCardInfo("Steelclaw Lance", 202, Rarity.UNCOMMON, mage.cards.s.SteelclawLance.class));
cards.add(new SetCardInfo("Syr Gwyn, Hero of Ashenvale", 330, Rarity.MYTHIC, mage.cards.s.SyrGwynHeroOfAshenvale.class)); cards.add(new SetCardInfo("Syr Gwyn, Hero of Ashenvale", 330, Rarity.MYTHIC, mage.cards.s.SyrGwynHeroOfAshenvale.class));