mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
[DMU] Implemented Radha's Firebrand
This commit is contained in:
parent
81975be64e
commit
3929cb25a8
4 changed files with 107 additions and 14 deletions
|
@ -2,10 +2,9 @@ package mage.cards.j;
|
|||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.CostAdjuster;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.costadjusters.DomainAdjuster;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.dynamicvalue.common.DomainValue;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.InfoEffect;
|
||||
import mage.abilities.hint.common.DomainHint;
|
||||
|
@ -13,8 +12,6 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AbilityWord;
|
||||
import mage.constants.CardType;
|
||||
import mage.game.Game;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -32,7 +29,7 @@ public final class JodahsCodex extends CardImpl {
|
|||
);
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addEffect(new InfoEffect("This ability costs {1} less to activate for each basic land type among lands you control."));
|
||||
ability.setCostAdjuster(JodahsCodexAdjuster.instance);
|
||||
ability.setCostAdjuster(DomainAdjuster.instance);
|
||||
ability.setAbilityWord(AbilityWord.DOMAIN);
|
||||
ability.addHint(DomainHint.instance);
|
||||
this.addAbility(ability);
|
||||
|
@ -47,12 +44,3 @@ public final class JodahsCodex extends CardImpl {
|
|||
return new JodahsCodex(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum JodahsCodexAdjuster implements CostAdjuster {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public void adjustCosts(Ability ability, Game game) {
|
||||
CardUtil.reduceCost(ability, DomainValue.REGULAR.calculate(game, ability, null));
|
||||
}
|
||||
}
|
||||
|
|
85
Mage.Sets/src/mage/cards/r/RadhasFirebrand.java
Normal file
85
Mage.Sets/src/mage/cards/r/RadhasFirebrand.java
Normal file
|
@ -0,0 +1,85 @@
|
|||
package mage.cards.r;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.common.LimitedTimesPerTurnActivatedAbility;
|
||||
import mage.abilities.costs.costadjusters.DomainAdjuster;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.InfoEffect;
|
||||
import mage.abilities.effects.common.combat.CantBlockTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.hint.common.DomainHint;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||
import mage.filter.predicate.permanent.DefendingPlayerControlsPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class RadhasFirebrand extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter
|
||||
= new FilterCreaturePermanent("creature defending player controls with power less than {this}'s power");
|
||||
|
||||
static {
|
||||
filter.add(DefendingPlayerControlsPredicate.instance);
|
||||
filter.add(RadhasFirebrandPredicate.instance);
|
||||
}
|
||||
|
||||
public RadhasFirebrand(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
||||
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.WARRIOR);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Whenever Radha's Firebrand attacks, target creature defending player controls with power less than Radha's Firebrand's power can't block this turn.
|
||||
Ability ability = new AttacksTriggeredAbility(new CantBlockTargetEffect(Duration.EndOfTurn));
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Domain -- {5}{R}: Radha's Firebrand gets +2/+2 until end of turn. This ability costs {1} less to activate for each basic land type among lands you control. Activate only once each turn.
|
||||
ability = new LimitedTimesPerTurnActivatedAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new BoostSourceEffect(2, 2, Duration.EndOfTurn),
|
||||
new ManaCostsImpl<>("{5}{R}")
|
||||
);
|
||||
ability.addEffect(new InfoEffect("This ability costs {1} less to activate " +
|
||||
"for each basic land type among lands you control."));
|
||||
ability.addHint(DomainHint.instance);
|
||||
ability.setAbilityWord(AbilityWord.DOMAIN);
|
||||
ability.setCostAdjuster(DomainAdjuster.instance);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private RadhasFirebrand(final RadhasFirebrand card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadhasFirebrand copy() {
|
||||
return new RadhasFirebrand(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum RadhasFirebrandPredicate implements ObjectSourcePlayerPredicate<Permanent> {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
|
||||
Permanent permanent = input.getSource().getSourcePermanentOrLKI(game);
|
||||
return permanent != null && permanent.getPower().getValue() > input.getObject().getPower().getValue();
|
||||
}
|
||||
}
|
|
@ -159,6 +159,7 @@ public final class DominariaUnited extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Plains", 262, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Prayer of Binding", 28, Rarity.UNCOMMON, mage.cards.p.PrayerOfBinding.class));
|
||||
cards.add(new SetCardInfo("Protect the Negotiators", 62, Rarity.UNCOMMON, mage.cards.p.ProtectTheNegotiators.class));
|
||||
cards.add(new SetCardInfo("Radha's Firebrand", 141, Rarity.RARE, mage.cards.r.RadhasFirebrand.class));
|
||||
cards.add(new SetCardInfo("Radiant Grove", 253, Rarity.COMMON, mage.cards.r.RadiantGrove.class));
|
||||
cards.add(new SetCardInfo("Raff, Weatherlight Stalwart", 212, Rarity.UNCOMMON, mage.cards.r.RaffWeatherlightStalwart.class));
|
||||
cards.add(new SetCardInfo("Ragefire Hellkite", 285, Rarity.RARE, mage.cards.r.RagefireHellkite.class));
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package mage.abilities.costs.costadjusters;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.CostAdjuster;
|
||||
import mage.abilities.dynamicvalue.common.DomainValue;
|
||||
import mage.game.Game;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public enum DomainAdjuster implements CostAdjuster {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public void adjustCosts(Ability ability, Game game) {
|
||||
CardUtil.reduceCost(ability, DomainValue.REGULAR.calculate(game, ability, null));
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue