mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
Implemented Thriving Heath
This commit is contained in:
parent
f362ebd4a3
commit
d8370013af
3 changed files with 66 additions and 12 deletions
45
Mage.Sets/src/mage/cards/t/ThrivingHeath.java
Normal file
45
Mage.Sets/src/mage/cards/t/ThrivingHeath.java
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.ChooseColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaChosenColorEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.abilities.mana.WhiteManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class ThrivingHeath extends CardImpl {
|
||||
|
||||
public ThrivingHeath(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
||||
|
||||
// Thriving Heath enters the battlefield tapped.
|
||||
this.addAbility(new EntersBattlefieldTappedAbility());
|
||||
|
||||
// As Thriving Heath enters the battlefield, choose a color other than white.
|
||||
this.addAbility(new AsEntersBattlefieldAbility(new ChooseColorEffect(Outcome.Neutral, "White")));
|
||||
|
||||
// {T}: Add {W} or one mana of the chosen color.
|
||||
this.addAbility(new WhiteManaAbility());
|
||||
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaChosenColorEffect(), new TapSourceCost()));
|
||||
}
|
||||
|
||||
private ThrivingHeath(final ThrivingHeath card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThrivingHeath copy() {
|
||||
return new ThrivingHeath(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -71,6 +71,7 @@ public final class Jumpstart extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Swarm of Bloodflies", 282, Rarity.UNCOMMON, mage.cards.s.SwarmOfBloodflies.class));
|
||||
cards.add(new SetCardInfo("Tempting Witch", 283, Rarity.UNCOMMON, mage.cards.t.TemptingWitch.class));
|
||||
cards.add(new SetCardInfo("Terramorphic Expanse", 78, Rarity.COMMON, mage.cards.t.TerramorphicExpanse.class));
|
||||
cards.add(new SetCardInfo("Thriving Heath", 35, Rarity.COMMON, mage.cards.t.ThrivingHeath.class));
|
||||
cards.add(new SetCardInfo("Wailing Ghoul", 286, Rarity.COMMON, mage.cards.w.WailingGhoul.class));
|
||||
cards.add(new SetCardInfo("Young Pyromancer", 372, Rarity.UNCOMMON, mage.cards.y.YoungPyromancer.class));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,18 +12,25 @@ import mage.players.Player;
|
|||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public class ChooseColorEffect extends OneShotEffect {
|
||||
|
||||
private final String exceptColor;
|
||||
|
||||
public ChooseColorEffect(Outcome outcome) {
|
||||
this(outcome, null);
|
||||
}
|
||||
|
||||
public ChooseColorEffect(Outcome outcome, String exceptColor) {
|
||||
super(outcome);
|
||||
staticText = "choose a color";
|
||||
this.exceptColor = exceptColor;
|
||||
staticText = "choose a color" + (exceptColor != null ? " other than " + exceptColor.toLowerCase() : "");
|
||||
}
|
||||
|
||||
public ChooseColorEffect(final ChooseColorEffect effect) {
|
||||
super(effect);
|
||||
this.exceptColor = effect.exceptColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -34,17 +41,18 @@ public class ChooseColorEffect extends OneShotEffect {
|
|||
mageObject = game.getObject(source.getSourceId());
|
||||
}
|
||||
ChoiceColor choice = new ChoiceColor();
|
||||
if (controller != null && mageObject != null && controller.choose(outcome, choice, game)) {
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayers(mageObject.getLogName() + ": " + controller.getLogName() + " has chosen " + choice.getChoice());
|
||||
}
|
||||
game.getState().setValue(mageObject.getId() + "_color", choice.getColor());
|
||||
if (mageObject instanceof Permanent) {
|
||||
((Permanent) mageObject).addInfo("chosen color", CardUtil.addToolTipMarkTags("Chosen color: " + choice.getChoice()), game);
|
||||
}
|
||||
return true;
|
||||
if (exceptColor != null) {
|
||||
choice.removeColorFromChoices(exceptColor);
|
||||
}
|
||||
return false;
|
||||
if (controller == null || mageObject == null || !controller.choose(outcome, choice, game)) {
|
||||
return false;
|
||||
}
|
||||
game.informPlayers(mageObject.getLogName() + ": " + controller.getLogName() + " has chosen " + choice.getChoice());
|
||||
game.getState().setValue(mageObject.getId() + "_color", choice.getColor());
|
||||
if (mageObject instanceof Permanent) {
|
||||
((Permanent) mageObject).addInfo("chosen color", CardUtil.addToolTipMarkTags("Chosen color: " + choice.getChoice()), game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue