mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
[TDM] Implement Temur Battlecrier
This commit is contained in:
parent
5a377017da
commit
508c534884
2 changed files with 108 additions and 3 deletions
104
Mage.Sets/src/mage/cards/t/TemurBattlecrier.java
Normal file
104
Mage.Sets/src/mage/cards/t/TemurBattlecrier.java
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.abilities.hint.ValueHint;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class TemurBattlecrier extends CardImpl {
|
||||
|
||||
public TemurBattlecrier(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}{U}{R}");
|
||||
|
||||
this.subtype.add(SubType.ORC);
|
||||
this.subtype.add(SubType.RANGER);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// During your turn, spells you cast cost {1} less to cast for each creature you control with power 4 or greater.
|
||||
this.addAbility(new SimpleStaticAbility(new TemurBattlecrierEffect()).addHint(TemurBattlecrierEffect.getHint()));
|
||||
}
|
||||
|
||||
private TemurBattlecrier(final TemurBattlecrier card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TemurBattlecrier copy() {
|
||||
return new TemurBattlecrier(this);
|
||||
}
|
||||
}
|
||||
|
||||
class TemurBattlecrierEffect extends CostModificationEffectImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterControlledCreaturePermanent();
|
||||
|
||||
static {
|
||||
filter.add(new PowerPredicate(ComparisonType.MORE_THAN, 3));
|
||||
}
|
||||
|
||||
private static final Hint hint = new ValueHint(
|
||||
"Creatures you control with power 4 or greater", new PermanentsOnBattlefieldCount(filter)
|
||||
);
|
||||
|
||||
public static Hint getHint() {
|
||||
return hint;
|
||||
}
|
||||
|
||||
TemurBattlecrierEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||
staticText = "during your turn, spells you cast cost {1} less to cast " +
|
||||
"for each creature you control with power 4 or greater";
|
||||
}
|
||||
|
||||
private TemurBattlecrierEffect(final TemurBattlecrierEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
Ability spellAbility = abilityToModify;
|
||||
if (spellAbility == null) {
|
||||
return false;
|
||||
}
|
||||
int amount = game.getBattlefield().count(filter, source.getControllerId(), source, game);
|
||||
if (amount > 0) {
|
||||
CardUtil.reduceCost(spellAbility, amount);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
if (!(abilityToModify instanceof SpellAbility)
|
||||
|| !abilityToModify.isControlledBy(source.getControllerId())
|
||||
|| !game.isActivePlayer(source.getControllerId())) {
|
||||
return false;
|
||||
}
|
||||
Card spellCard = ((SpellAbility) abilityToModify).getCharacteristics(game);
|
||||
return spellCard != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TemurBattlecrierEffect copy() {
|
||||
return new TemurBattlecrierEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
package mage.sets;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import mage.cards.ExpansionSet;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SetType;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
|
|
@ -209,6 +209,7 @@ public final class TarkirDragonstorm extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Swiftwater Cliffs", 268, Rarity.COMMON, mage.cards.s.SwiftwaterCliffs.class));
|
||||
cards.add(new SetCardInfo("Teeming Dragonstorm", 30, Rarity.UNCOMMON, mage.cards.t.TeemingDragonstorm.class));
|
||||
cards.add(new SetCardInfo("Tempest Hawk", 31, Rarity.COMMON, mage.cards.t.TempestHawk.class));
|
||||
cards.add(new SetCardInfo("Temur Battlecrier", 228, Rarity.RARE, mage.cards.t.TemurBattlecrier.class));
|
||||
cards.add(new SetCardInfo("Temur Devotee", 61, Rarity.COMMON, mage.cards.t.TemurDevotee.class));
|
||||
cards.add(new SetCardInfo("Temur Monument", 248, Rarity.UNCOMMON, mage.cards.t.TemurMonument.class));
|
||||
cards.add(new SetCardInfo("Temur Tawnyback", 229, Rarity.COMMON, mage.cards.t.TemurTawnyback.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue