mirror of
https://github.com/magefree/mage.git
synced 2025-12-30 07:22:03 -08:00
[OTJ] Implement Hell to Pay
This commit is contained in:
parent
816daa77b6
commit
b0c3371f7f
2 changed files with 73 additions and 0 deletions
72
Mage.Sets/src/mage/cards/h/HellToPay.java
Normal file
72
Mage.Sets/src/mage/cards/h/HellToPay.java
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
package mage.cards.h;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
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.game.permanent.token.TreasureToken;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class HellToPay extends CardImpl {
|
||||
|
||||
public HellToPay(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{R}");
|
||||
|
||||
// Hell to Pay deals X damage to target creature. Create a number of tapped Treasure tokens equal to the amount of excess damage dealt to that creature this way.
|
||||
this.getSpellAbility().addEffect(new HellToPayEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
}
|
||||
|
||||
private HellToPay(final HellToPay card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HellToPay copy() {
|
||||
return new HellToPay(this);
|
||||
}
|
||||
}
|
||||
|
||||
class HellToPayEffect extends OneShotEffect {
|
||||
|
||||
HellToPayEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "{this} deals X damage to target creature. Create a number of tapped " +
|
||||
"Treasure tokens equal to the amount of excess damage dealt to that creature this way";
|
||||
}
|
||||
|
||||
private HellToPayEffect(final HellToPayEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HellToPayEffect copy() {
|
||||
return new HellToPayEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
int damage = source.getManaCostsToPay().getX();
|
||||
int lethal = Math.min(permanent.getLethalDamage(source.getSourceId(), game), damage);
|
||||
permanent.damage(lethal, source.getSourceId(), source, game);
|
||||
if (damage > lethal) {
|
||||
new TreasureToken().putOntoBattlefield(
|
||||
damage - lethal, game, source, source.getControllerId(), true, false
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -22,6 +22,7 @@ public final class OutlawsOfThunderJunction extends ExpansionSet {
|
|||
this.hasBoosters = false; // temporary
|
||||
|
||||
cards.add(new SetCardInfo("Forest", 276, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Hell to Pay", 126, Rarity.RARE, mage.cards.h.HellToPay.class));
|
||||
cards.add(new SetCardInfo("Island", 273, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Mountain", 275, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Plains", 272, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue