mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
[TDC] Implement Tip the Scales
This commit is contained in:
parent
ac6c8d39ed
commit
9e6987ab56
2 changed files with 85 additions and 0 deletions
84
Mage.Sets/src/mage/cards/t/TipTheScales.java
Normal file
84
Mage.Sets/src/mage/cards/t/TipTheScales.java
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetSacrifice;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class TipTheScales extends CardImpl {
|
||||
|
||||
public TipTheScales(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}");
|
||||
|
||||
// Sacrifice a creature. When you do, all creatures get -X/-X until end of turn, where X is the sacrificed creature's toughness.
|
||||
this.getSpellAbility().addEffect(new TipTheScalesEffect());
|
||||
}
|
||||
|
||||
private TipTheScales(final TipTheScales card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TipTheScales copy() {
|
||||
return new TipTheScales(this);
|
||||
}
|
||||
}
|
||||
|
||||
class TipTheScalesEffect extends OneShotEffect {
|
||||
|
||||
TipTheScalesEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "sacrifice a creature. When you do, all creatures get " +
|
||||
"-X/-X until end of turn, where X is the sacrificed creature's toughness";
|
||||
}
|
||||
|
||||
private TipTheScalesEffect(final TipTheScalesEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TipTheScalesEffect copy() {
|
||||
return new TipTheScalesEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
TargetPermanent target = new TargetSacrifice(StaticFilters.FILTER_CONTROLLED_CREATURE);
|
||||
if (!target.canChoose(source.getControllerId(), source, game)) {
|
||||
return false;
|
||||
}
|
||||
player.choose(Outcome.Sacrifice, target, source, game);
|
||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
int value = permanent.getToughness().getValue();
|
||||
if (!permanent.sacrifice(source, game) || value < 1) {
|
||||
return false;
|
||||
}
|
||||
game.fireReflexiveTriggeredAbility(new ReflexiveTriggeredAbility(
|
||||
new BoostAllEffect(-value, -value, Duration.EndOfTurn), false
|
||||
), source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -326,6 +326,7 @@ public final class TarkirDragonstormCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Thunderbreak Regent", 241, Rarity.RARE, mage.cards.t.ThunderbreakRegent.class));
|
||||
cards.add(new SetCardInfo("Time Wipe", 308, Rarity.RARE, mage.cards.t.TimeWipe.class));
|
||||
cards.add(new SetCardInfo("Timeless Witness", 274, Rarity.UNCOMMON, mage.cards.t.TimelessWitness.class));
|
||||
cards.add(new SetCardInfo("Tip the Scales", 29, Rarity.RARE, mage.cards.t.TipTheScales.class));
|
||||
cards.add(new SetCardInfo("Tocasia's Welcome", 135, Rarity.RARE, mage.cards.t.TocasiasWelcome.class));
|
||||
cards.add(new SetCardInfo("Tower Defense", 275, Rarity.UNCOMMON, mage.cards.t.TowerDefense.class));
|
||||
cards.add(new SetCardInfo("Towering Titan", 276, Rarity.MYTHIC, mage.cards.t.ToweringTitan.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue