Fix a few broken tooltip texts and kill an unnecessary custom Cost class from Skirksdag High Priest

This commit is contained in:
LoneFox 2015-10-17 15:14:38 +03:00
parent 8b42cf9bfa
commit a847e5619d
5 changed files with 59 additions and 73 deletions

View file

@ -29,9 +29,9 @@ package mage.sets.dissension;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.EnchantedCondition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalContinuousEffect;
@ -50,10 +50,6 @@ import mage.constants.Zone;
*/
public class FlaringFlameKin extends CardImpl {
private static final String rule1 = "As long as {this} is enchanted, it gets +2/+2";
private static final String rule2 = "As long as {this} is enchanted, it has trample";
private static final String rule3 = "As long as {this} is enchanted, it has \"{R}: {this} gets +1/+0 until end of turn.\"";
public FlaringFlameKin(UUID ownerId) {
super(ownerId, 62, "Flaring Flame-Kin", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}");
this.expansionSetCode = "DIS";
@ -63,17 +59,19 @@ public class FlaringFlameKin extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(2);
SimpleActivatedAbility grantedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new BoostSourceEffect(1, 0, Duration.EndOfTurn),
new ManaCostsImpl("{R}"));
Condition enchanted = new EnchantedCondition();
ConditionalContinuousEffect effect1 = new ConditionalContinuousEffect(new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), enchanted, rule1);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect1));
ConditionalContinuousEffect effect2 = new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance()), enchanted, rule2);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect2));
ConditionalContinuousEffect effect3 = new ConditionalContinuousEffect(new GainAbilitySourceEffect(grantedAbility), enchanted, rule3);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect3));
// As long as Flaring Flame-Kin is enchanted, it gets +2/+2, has trample, and has "{R}: Flaring Flame-Kin gets +1/+0 until end of turn."
EnchantedCondition enchanted = new EnchantedCondition();
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), enchanted,
"As long as {this} is enchanted, it gets +2/+2"));
ability.addEffect(new ConditionalContinuousEffect(
new GainAbilitySourceEffect(TrampleAbility.getInstance()), enchanted,
", has trample"));
Ability grantedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"));
ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(grantedAbility),
enchanted, ", and has \"{R}: {this} gets +1/+0 until end of turn.\""));
this.addAbility(ability);
}
public FlaringFlameKin(final FlaringFlameKin card) {

View file

@ -30,20 +30,19 @@ package mage.sets.innistrad;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.CostImpl;
import mage.abilities.condition.common.MorbidCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.common.TapTargetCost;
import mage.abilities.decorator.ConditionalActivatedAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.AbilityWord;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.TappedPredicate;
import mage.game.Game;
import mage.game.permanent.token.DemonToken;
import mage.target.common.TargetControlledCreaturePermanent;
@ -69,9 +68,10 @@ public class SkirsdagHighPriest extends CardImpl {
this.toughness = new MageInt(2);
// Morbid - {tap}, Tap two untapped creatures you control: Put a 5/5 black Demon creature token with flying onto the battlefield. Activate this ability only if a creature died this turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new DemonToken()), new TapSourceCost());
ability.addCost(new TapTargetCost(new TargetControlledCreaturePermanent(2,2,filter, false)));
ability.addCost(new SkirsdagHighPriestCost());
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new DemonToken()),
new TapSourceCost(), MorbidCondition.getInstance());
ability.addCost(new TapTargetCost(new TargetControlledCreaturePermanent(2, 2, filter, false)));
ability.setAbilityWord(AbilityWord.MORBID);
this.addAbility(ability);
}
@ -84,30 +84,3 @@ public class SkirsdagHighPriest extends CardImpl {
return new SkirsdagHighPriest(this);
}
}
class SkirsdagHighPriestCost extends CostImpl {
public SkirsdagHighPriestCost() {
this.text = "Activate this ability only if a creature died this turn";
}
public SkirsdagHighPriestCost(final SkirsdagHighPriestCost cost) {
super(cost);
}
@Override
public SkirsdagHighPriestCost copy() {
return new SkirsdagHighPriestCost(this);
}
@Override
public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) {
return game.getState().getWatchers().get("Morbid").conditionMet();
}
@Override
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
this.paid = true;
return paid;
}
}

View file

@ -28,13 +28,9 @@
package mage.sets.magic2012;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.EnchantedCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
@ -43,6 +39,10 @@ import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
@ -50,11 +50,6 @@ import mage.cards.CardImpl;
*/
public class ThranGolem extends CardImpl {
private static final String rule1 = "As long as {this} is enchanted, it gets +2/+2 ";
private static final String rule2 = "As long as {this} is enchanted, it has flying";
private static final String rule3 = "As long as {this} is enchanted, it has first strike";
private static final String rule4 = "As long as {this} is enchanted, it has flying trample";
public ThranGolem(UUID ownerId) {
super(ownerId, 220, "Thran Golem", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}");
this.expansionSetCode = "M12";
@ -63,15 +58,18 @@ public class ThranGolem extends CardImpl {
this.power = new MageInt(3);
this.toughness = new MageInt(3);
Condition enchanted = new EnchantedCondition();
ConditionalContinuousEffect effect1 = new ConditionalContinuousEffect(new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), enchanted, rule1);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect1));
ConditionalContinuousEffect effect2 = new ConditionalContinuousEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance()), enchanted, rule2);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect2));
ConditionalContinuousEffect effect3 = new ConditionalContinuousEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance()), enchanted, rule3);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect3));
ConditionalContinuousEffect effect4 = new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance()), enchanted, rule4);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect4));
// As long as Thran Golem is enchanted, it gets +2/+2 and has flying, first strike, and trample.
EnchantedCondition enchanted = new EnchantedCondition();
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), enchanted,
"As long as {this} is enchanted, it gets +2/+2"));
ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance()),
enchanted, "and has flying"));
ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance()),
enchanted, ", first strike"));
ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance()),
enchanted, ", and trample."));
this.addAbility(ability);
}
public ThranGolem(final ThranGolem card) {

View file

@ -29,18 +29,23 @@
package mage.sets.magic2012;
import java.util.UUID;
import mage.constants.*;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.RegenerateSourceEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
@ -55,13 +60,20 @@ public class Trollhide extends CardImpl {
this.expansionSetCode = "M12";
this.subtype.add("Aura");
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{1}{G}")), AttachmentType.AURA)));
// Enchanted creature gets +2/+2 and has "{1}{G}: Regenerate this creature."
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield));
Effect effect = new GainAbilityAttachedEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new RegenerateSourceEffect(), new ManaCostsImpl("{1}{G}")), AttachmentType.AURA);
effect.setText("and has \"{1}{G}: Regenerate this creature.\"");
ability.addEffect(effect);
this.addAbility(ability);
}
public Trollhide (final Trollhide card) {

View file

@ -49,4 +49,9 @@ public class MorbidCondition implements Condition {
return watcher.conditionMet();
}
@Override
public String toString() {
return "if a creature died this turn";
}
}