Fixed tooltip text of Resistance Fighter, Crimson Hellkite and Maze of Ith.

This commit is contained in:
LevelX2 2014-05-31 11:06:07 +02:00
parent 90d516f15d
commit da3936abfb
4 changed files with 30 additions and 10 deletions

View file

@ -36,6 +36,7 @@ import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.costs.mana.VariableManaCost;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@ -69,13 +70,15 @@ public class CrimsonHellkite extends CardImpl<CrimsonHellkite> {
// Flying
this.addAbility(FlyingAbility.getInstance());
// {X}, {tap}: Crimson Hellkite deals X damage to target creature. Spend only red mana this way.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}"));
Effect effect = new DamageTargetEffect(new ManacostVariableValue());
effect.setText("{this} deals X damage to target creature. Spend only red mana this way");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost());
VariableCost variableCost = ability.getManaCostsToPay().getVariableCosts().get(0);
if (variableCost instanceof VariableManaCost) {
((VariableManaCost) variableCost).setFilter(filterRedMana);
}
ability.addTarget(new TargetCreaturePermanent());
ability.addTarget(new TargetCreaturePermanent(true));
this.addAbility(ability);
}

View file

@ -28,17 +28,17 @@
package mage.sets.thedark;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.PreventDamageByTargetEffect;
import mage.abilities.effects.common.PreventDamageToTargetEffect;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.common.TargetAttackingCreature;
@ -54,9 +54,13 @@ public class MazeOfIth extends CardImpl<MazeOfIth> {
// {tap}: Untap target attacking creature. Prevent all combat damage that would be dealt to and dealt by that creature this turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new TapSourceCost());
ability.addEffect(new PreventDamageByTargetEffect(Duration.EndOfTurn, true));
ability.addEffect(new PreventDamageToTargetEffect(Duration.EndOfTurn, Integer.MAX_VALUE, true));
ability.addTarget(new TargetAttackingCreature());
Effect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn, true);
effect.setText("Prevent all combat damage that would be dealt to");
ability.addEffect(effect);
effect = new PreventDamageToTargetEffect(Duration.EndOfTurn, Integer.MAX_VALUE, true);
effect.setText("and dealt by that creature this turn");
ability.addEffect(effect);
ability.addTarget(new TargetAttackingCreature(true));
this.addAbility(ability);
}

View file

@ -80,12 +80,20 @@ public class PreventDamageByTargetEffect extends PreventionEffectImpl<PreventDam
}
if (amountToPrevent == Integer.MAX_VALUE) {
StringBuilder sb = new StringBuilder();
sb.append("Prevent all damage target ");
sb.append("Prevent all");
if (onlyCombat) {
sb.append("combat ");
}
sb.append(" damage target ");
sb.append(mode.getTargets().get(0).getTargetName()).append(" would deal ").append(duration.toString());
return sb.toString();
} else {
StringBuilder sb = new StringBuilder();
sb.append("Prevent the next ").append(amountToPrevent).append(" damage that ");
sb.append("Prevent the next ").append(amountToPrevent);
if (onlyCombat) {
sb.append("combat ");
}
sb.append(" damage that ");
sb.append(mode.getTargets().get(0).getTargetName()).append(" would deal ").append(duration.toString());
return sb.toString();
}

View file

@ -41,6 +41,11 @@ public class TargetAttackingCreature extends TargetPermanent<TargetAttackingCrea
this(1, 1, new FilterAttackingCreature(), false);
}
public TargetAttackingCreature(boolean required) {
this(1, 1, new FilterAttackingCreature(), false);
this.setRequired(required);
}
public TargetAttackingCreature(int numTargets) {
this(numTargets, numTargets, new FilterAttackingCreature(), false);
}