[CMR] Implemented Kediss, Emberclaw Familiar

This commit is contained in:
Evan Kranzler 2020-10-29 21:48:13 -04:00
parent 6fdc244085
commit 9cc278a126
2 changed files with 100 additions and 0 deletions

View file

@ -0,0 +1,99 @@
package mage.cards.k;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.PartnerAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.permanent.CommanderPredicate;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class KedissEmberclawFamiliar extends CardImpl {
private static final FilterPermanent filter = new FilterControlledPermanent("commander you control");
static {
filter.add(CommanderPredicate.instance);
}
public KedissEmberclawFamiliar(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.ELEMENTAL);
this.subtype.add(SubType.LIZARD);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Whenever a commander you control deals combat damage to an opponent, it deals that much damage to each other opponent.
this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(
new KedissEmberclawFamiliarEffect(), filter, false,
SetTargetPointer.PLAYER, true, true
));
// Partner
this.addAbility(PartnerAbility.getInstance());
}
private KedissEmberclawFamiliar(final KedissEmberclawFamiliar card) {
super(card);
}
@Override
public KedissEmberclawFamiliar copy() {
return new KedissEmberclawFamiliar(this);
}
}
class KedissEmberclawFamiliarEffect extends OneShotEffect {
KedissEmberclawFamiliarEffect() {
super(Outcome.Benefit);
staticText = "it deals that much damage to each other opponent";
}
private KedissEmberclawFamiliarEffect(final KedissEmberclawFamiliarEffect effect) {
super(effect);
}
@Override
public KedissEmberclawFamiliarEffect copy() {
return new KedissEmberclawFamiliarEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Object obj = getValue("sourceId");
if (!(obj instanceof UUID)) {
return false;
}
UUID sourceId = (UUID) obj;
obj = getValue("damage");
if (!(obj instanceof Integer)) {
return false;
}
int damage = (Integer) obj;
for (UUID playerId : game.getOpponents(source.getControllerId())) {
if (playerId.equals(getTargetPointer().getFirst(game, source))) {
continue;
}
Player player = game.getPlayer(playerId);
if (player == null) {
continue;
}
player.damage(damage, sourceId, game);
}
return true;
}
}

View file

@ -64,6 +64,7 @@ public final class CommanderLegends extends ExpansionSet {
cards.add(new SetCardInfo("Interpret the Signs", 75, Rarity.UNCOMMON, mage.cards.i.InterpretTheSigns.class));
cards.add(new SetCardInfo("Jeweled Lotus", 319, Rarity.MYTHIC, mage.cards.j.JeweledLotus.class));
cards.add(new SetCardInfo("Kamahl, Heart of Krosa", 237, Rarity.MYTHIC, mage.cards.k.KamahlHeartOfKrosa.class));
cards.add(new SetCardInfo("Kediss, Emberclaw Familiar", 188, Rarity.UNCOMMON, mage.cards.k.KedissEmberclawFamiliar.class));
cards.add(new SetCardInfo("Keeper of the Accord", 27, Rarity.RARE, mage.cards.k.KeeperOfTheAccord.class));
cards.add(new SetCardInfo("Kitesail Corsair", 76, Rarity.COMMON, mage.cards.k.KitesailCorsair.class));
cards.add(new SetCardInfo("Kitesail Skirmisher", 77, Rarity.COMMON, mage.cards.k.KitesailSkirmisher.class));