forked from External/mage
[MOM] Implement Lithomantic Barrage
This commit is contained in:
parent
fa2e145fb0
commit
ce04ea9b7c
2 changed files with 71 additions and 0 deletions
70
Mage.Sets/src/mage/cards/l/LithomanticBarrage.java
Normal file
70
Mage.Sets/src/mage/cards/l/LithomanticBarrage.java
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
package mage.cards.l;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.CantBeCounteredSourceAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreatureOrPlaneswalker;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class LithomanticBarrage extends CardImpl {
|
||||
|
||||
public LithomanticBarrage(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{R}");
|
||||
|
||||
// This spell can't be countered.
|
||||
this.addAbility(new CantBeCounteredSourceAbility());
|
||||
|
||||
// Lithomantic Barrage deals 1 damage to target creature or planeswalker. It deals 5 damage instead if that target is white and/or blue.
|
||||
this.getSpellAbility().addEffect(new LithomanticBarrageEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreatureOrPlaneswalker());
|
||||
}
|
||||
|
||||
private LithomanticBarrage(final LithomanticBarrage card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LithomanticBarrage copy() {
|
||||
return new LithomanticBarrage(this);
|
||||
}
|
||||
}
|
||||
|
||||
class LithomanticBarrageEffect extends OneShotEffect {
|
||||
|
||||
LithomanticBarrageEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "{this} deals 1 damage to target creature or planeswalker. " +
|
||||
"It deals 5 damage instead if that target is white and/or blue";
|
||||
}
|
||||
|
||||
private LithomanticBarrageEffect(final LithomanticBarrageEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LithomanticBarrageEffect copy() {
|
||||
return new LithomanticBarrageEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
if (permanent.getColor(game).isWhite() || permanent.getColor(game).isBlue()) {
|
||||
return permanent.damage(5, source, game) > 0;
|
||||
}
|
||||
return permanent.damage(1, source, game) > 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -69,6 +69,7 @@ public final class MarchOfTheMachine extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Joyful Stormsculptor", 243, Rarity.UNCOMMON, mage.cards.j.JoyfulStormsculptor.class));
|
||||
cards.add(new SetCardInfo("Jungle Hollow", 270, Rarity.COMMON, mage.cards.j.JungleHollow.class));
|
||||
cards.add(new SetCardInfo("Kroxa and Kunoros", 245, Rarity.MYTHIC, mage.cards.k.KroxaAndKunoros.class));
|
||||
cards.add(new SetCardInfo("Lithomantic Barrage", 152, Rarity.UNCOMMON, mage.cards.l.LithomanticBarrage.class));
|
||||
cards.add(new SetCardInfo("Merciless Repurposing", 117, Rarity.UNCOMMON, mage.cards.m.MercilessRepurposing.class));
|
||||
cards.add(new SetCardInfo("Mirrodin Avenged", 118, Rarity.COMMON, mage.cards.m.MirrodinAvenged.class));
|
||||
cards.add(new SetCardInfo("Monastery Mentor", 28, Rarity.MYTHIC, mage.cards.m.MonasteryMentor.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue