Implemented Skullknocker Ogre

This commit is contained in:
Evan Kranzler 2019-09-11 13:48:20 -04:00
parent d9a934ac4f
commit d9487e5cb8
2 changed files with 73 additions and 0 deletions

View file

@ -0,0 +1,72 @@
package mage.cards.s;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SkullknockerOgre extends CardImpl {
public SkullknockerOgre(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.subtype.add(SubType.OGRE);
this.power = new MageInt(4);
this.toughness = new MageInt(3);
// Whenever Skullknocker Ogre deals damage to an opponent, that player discards a card at random. If the player does, they draw a card.
this.addAbility(new DealsDamageToOpponentTriggeredAbility(
new SkullknockerOgreEffect(), false, false, true
));
}
private SkullknockerOgre(final SkullknockerOgre card) {
super(card);
}
@Override
public SkullknockerOgre copy() {
return new SkullknockerOgre(this);
}
}
class SkullknockerOgreEffect extends OneShotEffect {
SkullknockerOgreEffect() {
super(Outcome.Benefit);
staticText = "that player discards a card at random. If the player does, they draw a card";
}
private SkullknockerOgreEffect(final SkullknockerOgreEffect effect) {
super(effect);
}
@Override
public SkullknockerOgreEffect copy() {
return new SkullknockerOgreEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if (player == null) {
return false;
}
if (player.discard(1, true, source, game).size() > 0) {
player.drawCards(1, game);
}
return true;
}
}

View file

@ -106,6 +106,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("Silverflame Ritual", 30, Rarity.COMMON, mage.cards.s.SilverflameRitual.class));
cards.add(new SetCardInfo("Silverwing Squadron", 315, Rarity.RARE, mage.cards.s.SilverwingSquadron.class));
cards.add(new SetCardInfo("Skullknocker Ogre", 142, Rarity.UNCOMMON, mage.cards.s.SkullknockerOgre.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));