* Some fixes to Ferocious cards (missing LockedInCondition). Some changes to tooltip text generation.

This commit is contained in:
LevelX2 2015-01-25 11:28:56 +01:00
parent a39c4aa4f4
commit bc1757a90f
14 changed files with 65 additions and 200 deletions

View file

@ -35,6 +35,7 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.HasteAbility;
@ -72,10 +73,12 @@ public class ShamanOfTheGreatHunt extends CardImpl {
// Haste
this.addAbility(HasteAbility.getInstance());
// Whenever a creature you control deals combat damage to a player, put a +1/+1 counter on it.
// Whenever a creature you control deals combat damage to a player, put a +1/+1 counter on that creature.
Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance());
effect.setText("put a +1/+1 counter on that creature");
this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(
new AddCountersTargetEffect(CounterType.P1P1.createInstance()),
new FilterControlledCreaturePermanent(), false, SetTargetPointer.PERMANENT, true
effect,
new FilterControlledCreaturePermanent("a creature you control"), false, SetTargetPointer.PERMANENT, true
));
// <i>Ferocious</i> - {2}{G/U}{G/U}: Draw a card for each creature you control with power 4 or greater.

View file

@ -28,6 +28,7 @@
package mage.sets.fatereforged;
import java.util.UUID;
import mage.abilities.condition.LockedInCondition;
import mage.abilities.condition.common.FerociousCondition;
import mage.abilities.decorator.ConditionalContinousEffect;
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
@ -56,7 +57,10 @@ public class TemurBattleRage extends CardImpl {
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
// <i>Ferocious</i> That creature also gains trample until end of turn if you control a creature with power 4 or greater.
this.getSpellAbility().addEffect(new ConditionalContinousEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn), FerociousCondition.getInstance(), rule));
this.getSpellAbility().addEffect(new ConditionalContinousEffect(
new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn),
new LockedInCondition(FerociousCondition.getInstance()),
rule));
}

View file

@ -30,6 +30,7 @@ package mage.sets.fatereforged;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.LockedInCondition;
import mage.abilities.condition.common.FerociousCondition;
import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect;
import mage.abilities.effects.ContinuousRuleModifiyingEffect;
@ -57,9 +58,9 @@ public class WildSlash extends CardImpl {
// <i>Ferocious</i> If you control a creature with power 4 or greater, damage can't be prevented this turn.
ContinuousRuleModifiyingEffect effect = new DamageCantBePreventedEffect();
effect.setText("<i>Ferocious</i> &mdash; If you control a creature with power 4 or greater, damage can't be prevented this turn");
this.addAbility(new SimpleStaticAbility(Zone.ALL, new ConditionalContinuousRuleModifyingEffect(effect,
FerociousCondition.getInstance())));
effect.setText("<i>Ferocious</i> &mdash; If you control a creature with power 4 or greater, damage can't be prevented this turn.<br>");
this.getSpellAbility().addEffect(new ConditionalContinuousRuleModifyingEffect(effect,
new LockedInCondition(FerociousCondition.getInstance())));
// Wild Slash deals 2 damage to target creature or player.
this.getSpellAbility().addEffect(new DamageTargetEffect(2));

View file

@ -28,8 +28,9 @@
package mage.sets.khansoftarkir;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.condition.LockedInCondition;
import mage.abilities.condition.common.FerociousCondition;
import mage.abilities.decorator.ConditionalRestrictionEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageAllEffect;
import mage.abilities.effects.common.combat.CantBlockAllEffect;
@ -40,7 +41,6 @@ import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
/**
*
@ -63,8 +63,11 @@ public class BarrageOfBoulders extends CardImpl {
// Barrage of Boulders deals 1 damage to each creature you don't control.
this.getSpellAbility().addEffect(new DamageAllEffect(1, filter));
// Ferocious - If you control a creature with power 4 or greater, creatures can't block this turn
Effect effect = new BarrageOfBouldersCantBlockAllEffect(new FilterCreaturePermanent("creatures"), Duration.EndOfTurn);
effect.setText("<br/><br/><i>Ferocious</i> - If you control a creature with power 4 or greater, creatures can't block this turn");
Effect effect = new ConditionalRestrictionEffect(
Duration.EndOfTurn,
new CantBlockAllEffect(new FilterCreaturePermanent("creatures"), Duration.EndOfTurn),
new LockedInCondition(FerociousCondition.getInstance()), null);
effect.setText("<br/><i>Ferocious</i> &mdash; If you control a creature with power 4 or greater, creatures can't block this turn");
this.getSpellAbility().addEffect(effect);
}
@ -77,27 +80,3 @@ public class BarrageOfBoulders extends CardImpl {
return new BarrageOfBoulders(this);
}
}
class BarrageOfBouldersCantBlockAllEffect extends CantBlockAllEffect {
public BarrageOfBouldersCantBlockAllEffect(FilterCreaturePermanent filter, Duration duration) {
super(filter, duration);
}
public BarrageOfBouldersCantBlockAllEffect(final BarrageOfBouldersCantBlockAllEffect effect) {
super(effect);
}
@Override
public void init(Ability source, Game game) {
if (!FerociousCondition.getInstance().apply(game, source)) {
discard();
}
}
@Override
public BarrageOfBouldersCantBlockAllEffect copy() {
return new BarrageOfBouldersCantBlockAllEffect(this);
}
}

View file

@ -28,17 +28,14 @@
package mage.sets.khansoftarkir;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.condition.common.FerociousCondition;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.dynamicvalue.IntPlusDynamicValue;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.game.Game;
import mage.target.common.TargetCreatureOrPlayer;
/**
@ -51,11 +48,14 @@ public class CratersClaws extends CardImpl {
super(ownerId, 106, "Crater's Claws", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{R}");
this.expansionSetCode = "KTK";
this.color.setRed(true);
// Crater's Claws deals X damage to target creature or player.
// <i>Ferocious</i> - Crater's Claws deals X plus 2 damage to that creature or player instead if you control a creature with power 4 or greater.
this.getSpellAbility().addEffect(new CratersClawsDamageTargetEffect(new ManacostVariableValue()));
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new DamageTargetEffect(new IntPlusDynamicValue(2, new ManacostVariableValue())),
new DamageTargetEffect(new ManacostVariableValue()),
FerociousCondition.getInstance(),
"{this} deals X damage to target creature or player." +
"<br><i>Ferocious</i> &mdash; {this} deals X plus 2 damage to that creature or player instead if you control a creature with power 4 or greater"));
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
}
@ -68,35 +68,3 @@ public class CratersClaws extends CardImpl {
return new CratersClaws(this);
}
}
class CratersClawsDamageTargetEffect extends DamageTargetEffect {
public CratersClawsDamageTargetEffect(DynamicValue amount) {
super(amount, false);
}
public CratersClawsDamageTargetEffect(final CratersClawsDamageTargetEffect effect) {
super(effect);
}
@Override
public CratersClawsDamageTargetEffect copy() {
return new CratersClawsDamageTargetEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
if (FerociousCondition.getInstance().apply(game, source)) {
amount = new IntPlusDynamicValue(2, new ManacostVariableValue());
}
return super.apply(game, source);
}
@Override
public String getText(Mode mode) {
return "{this} deals X damage to target creature or player." +
"<br><br><i>Ferocious</i> - {this} deals X plus 2 damage to that creature or player instead if you control a creature with power 4 or greater";
}
}

View file

@ -28,15 +28,12 @@
package mage.sets.khansoftarkir;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.condition.common.FerociousCondition;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.players.Player;
/**
*
@ -48,11 +45,13 @@ public class FeedTheClan extends CardImpl {
super(ownerId, 132, "Feed the Clan", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}");
this.expansionSetCode = "KTK";
this.color.setGreen(true);
// You gain 5 life.
// Ferocious - You gain 10 life instead if you control a creature with power 4 or greater
this.getSpellAbility().addEffect(new FeedTheClanEffect());
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new GainLifeEffect(10),
new GainLifeEffect(5),
FerociousCondition.getInstance(),
"You gain 5 life. <br><i>Ferocious</i> &mdash; You gain 10 life instead if you control a creature with power 4 or greater"));
}
@ -65,34 +64,3 @@ public class FeedTheClan extends CardImpl {
return new FeedTheClan(this);
}
}
class FeedTheClanEffect extends OneShotEffect {
public FeedTheClanEffect() {
super(Outcome.GainLife);
this.staticText = "You gain 5 life. <br><br><i>Ferocious</i> - You gain 10 life instead if you control a creature with power 4 or greater";
}
public FeedTheClanEffect(final FeedTheClanEffect effect) {
super(effect);
}
@Override
public FeedTheClanEffect copy() {
return new FeedTheClanEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
if (FerociousCondition.getInstance().apply(game, source)) {
controller.gainLife(10, game);
} else {
controller.gainLife(5, game);
}
return true;
}
return false;
}
}

View file

@ -48,15 +48,13 @@ public class ForceAway extends CardImpl {
super(ownerId, 40, "Force Away", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}");
this.expansionSetCode = "KTK";
this.color.setBlue(true);
// Return target creature to its owner's hand.
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
// <i>Ferocious</i> - If you control a creature with power 4 or greater, you may draw a card. If you do, discard a card.
Effect effect = new ConditionalOneShotEffect(new DrawDiscardControllerEffect(1,1, true),
FerociousCondition.getInstance() , "<br/><br/><i>Ferocious</i> - If you control a creature with power 4 or greater, you may draw a card. If you do, discard a card");
FerociousCondition.getInstance() , "<br><i>Ferocious</i> &mdash; If you control a creature with power 4 or greater, you may draw a card. If you do, discard a card");
this.getSpellAbility().addEffect(effect);
}

View file

@ -30,7 +30,9 @@ package mage.sets.khansoftarkir;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.condition.LockedInCondition;
import mage.abilities.condition.common.FerociousCondition;
import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
import mage.abilities.effects.common.TapTargetEffect;
@ -58,8 +60,10 @@ public class IcyBlast extends CardImpl {
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, new FilterCreaturePermanent(), false));
// <i>Ferocious</i> - If you control a creature with power 4 or greater, those creatures don't untap during their controllers' next untap steps.
Effect effect = new IcyBlastSkipNextUntapTargetEffect();
effect.setText("<br/><br/><i>Ferocious</i> - If you control a creature with power 4 or greater, those creatures don't untap during their controllers' next untap steps");
Effect effect = new ConditionalContinuousRuleModifyingEffect(
new DontUntapInControllersNextUntapStepTargetEffect(),
new LockedInCondition(FerociousCondition.getInstance()));
effect.setText("<br/><i>Ferocious</i> &mdash; If you control a creature with power 4 or greater, those creatures don't untap during their controllers' next untap steps");
this.getSpellAbility().addEffect(effect);
}
@ -82,31 +86,3 @@ public class IcyBlast extends CardImpl {
return new IcyBlast(this);
}
}
class IcyBlastSkipNextUntapTargetEffect extends DontUntapInControllersNextUntapStepTargetEffect {
public IcyBlastSkipNextUntapTargetEffect() {
super();
}
public IcyBlastSkipNextUntapTargetEffect(final IcyBlastSkipNextUntapTargetEffect effect) {
super(effect);
}
@Override
public IcyBlastSkipNextUntapTargetEffect copy() {
return new IcyBlastSkipNextUntapTargetEffect(this);
}
@Override
public void init(Ability source, Game game) {
if (!FerociousCondition.getInstance().apply(game, source)) {
discard();
}
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
}

View file

@ -28,25 +28,17 @@
package mage.sets.khansoftarkir;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.LockedInCondition;
import mage.abilities.condition.common.FerociousCondition;
import mage.abilities.decorator.ConditionalContinousEffect;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.combat.MustBeBlockedByAllTargetEffect;
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
import mage.abilities.keyword.IndestructibleAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
/**
@ -62,9 +54,12 @@ public class RoarOfChallenge extends CardImpl {
this.color.setGreen(true);
// All creatures able to block target creature this turn do so.
// <i>Ferocious</i> - That creature gains indestructible until end of turn if you control a creature with power 4 or greater.
this.getSpellAbility().addEffect(new MustBeBlockedByAllTargetEffect(Duration.EndOfTurn));
this.getSpellAbility().addEffect(new RoarOfChallengeEffect());
// <i>Ferocious</i> - That creature gains indestructible until end of turn if you control a creature with power 4 or greater.
this.getSpellAbility().addEffect(new ConditionalContinousEffect(
new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn),
new LockedInCondition(FerociousCondition.getInstance()),
"<br><i>Ferocious</i> &mdash; That creature gains indestructible until end of turn if you control a creature with power 4 or greater."));
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
@ -77,34 +72,3 @@ public class RoarOfChallenge extends CardImpl {
return new RoarOfChallenge(this);
}
}
class RoarOfChallengeEffect extends OneShotEffect {
public RoarOfChallengeEffect() {
super(Outcome.AddAbility);
this.staticText = "<br/><br/><i>Ferocious</i> - That creature gains indestructible until end of turn if you control a creature with power 4 or greater";
}
public RoarOfChallengeEffect(final RoarOfChallengeEffect effect) {
super(effect);
}
@Override
public RoarOfChallengeEffect copy() {
return new RoarOfChallengeEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
if (FerociousCondition.getInstance().apply(game, source)) {
ContinuousEffect effect = new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn);
effect.setTargetPointer(getTargetPointer());
game.addEffect(effect, source);
}
return true;
}
return false;
}
}

View file

@ -63,18 +63,17 @@ public class SavagePunch extends CardImpl {
super(ownerId, 147, "Savage Punch", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{G}");
this.expansionSetCode = "KTK";
this.color.setGreen(true);
// <i>Ferocious</i> - The creature you control gets +2/+2 until end of turn before it fights if you control a creature with power 4 or greater.
Effect effect = new ConditionalContinousEffect(
new BoostTargetEffect(2,2,Duration.EndOfTurn),
new LockedInCondition(FerociousCondition.getInstance()),
"<i>Ferocious</i> - The creature you control gets +2/+2 until end of turn before it fights if you control a creature with power 4 or greater");
"<i>Ferocious</i> &mdash; The creature you control gets +2/+2 until end of turn before it fights if you control a creature with power 4 or greater");
effect.setApplyEffectsAfter();
this.getSpellAbility().addEffect(effect);
// Target creature you control fights target creature you don't control.
effect = new FightTargetsEffect();
effect.setText("<br/><br/>Target creature you control fights target creature you don't control");
effect.setText("<br/>Target creature you control fights target creature you don't control");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
Target target = new TargetCreaturePermanent(filter);

View file

@ -67,8 +67,8 @@ public class SeeTheUnwritten extends CardImpl {
new SeeTheUnwrittenEffect(1),
new SeeTheUnwrittenEffect(2),
new InvertCondition(FerociousCondition.getInstance()),
"Reveal the top eight cards of your library. You may put a creature card from among them onto the battlefield. Put the rest into your graveyard" +
"<br/><br/><i>Ferocious</i> - If you control a creature with power 4 or greater, you may put two creature cards onto the battlefield instead of one" ));
"Reveal the top eight cards of your library. You may put a creature card from among them onto the battlefield. Put the rest into your graveyard." +
"<br/><i>Ferocious</i> &mdash; If you control a creature with power 4 or greater, you may put two creature cards onto the battlefield instead of one" ));
}
public SeeTheUnwritten(final SeeTheUnwritten card) {

View file

@ -57,8 +57,6 @@ public class StubbornDenial extends CardImpl {
super(ownerId, 56, "Stubborn Denial", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{U}");
this.expansionSetCode = "KTK";
this.color.setBlue(true);
// Counter target noncreature spell unless its controller pays {1}.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new CounterUnlessPaysEffect(new GenericManaCost(1)),
@ -68,7 +66,7 @@ public class StubbornDenial extends CardImpl {
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new CounterTargetEffect(),
FerociousCondition.getInstance(),
"<br><br><i>Ferocious</i> - If you control a creature with power 4 or greater, counter that spell instead"));
"<br><i>Ferocious</i> &mdash If you control a creature with power 4 or greater, counter that spell instead"));
this.getSpellAbility().addTarget(new TargetSpell(filter));
}