mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
* Mul Daya Channelers - Fixed a bug that the mana givng ability did not work as mana ability.
This commit is contained in:
parent
b7a22aa283
commit
eeca9a66ca
2 changed files with 70 additions and 14 deletions
|
@ -31,19 +31,24 @@ import java.util.UUID;
|
|||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.Constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.continious.PlayWithTheTopCardRevealedEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.TopLibraryCardTypeCondition;
|
||||
import mage.abilities.decorator.ConditionalGainActivatedAbility;
|
||||
import static mage.abilities.condition.common.TopLibraryCardTypeCondition.CheckType.*;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.common.ManaEffect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
|
||||
import mage.abilities.effects.common.continious.PlayWithTheTopCardRevealedEffect;
|
||||
import mage.abilities.mana.ManaAbility;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.choices.ChoiceColor;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -52,7 +57,6 @@ import mage.choices.ChoiceColor;
|
|||
public class MulDayaChannelers extends CardImpl<MulDayaChannelers> {
|
||||
|
||||
private static final String rule1 = "As long as the top card of your library is a creature card, {this} gets +3/+3";
|
||||
private static final String rule2 = "As long as the top card of your library is a land card, {this} has T: Add two mana of any one color to your mana pool.";
|
||||
|
||||
public MulDayaChannelers(UUID ownerId) {
|
||||
super(ownerId, 198, "Mul Daya Channelers", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{G}");
|
||||
|
@ -69,13 +73,17 @@ public class MulDayaChannelers extends CardImpl<MulDayaChannelers> {
|
|||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayWithTheTopCardRevealedEffect()));
|
||||
|
||||
// As long as the top card of your library is a creature card, Mul Daya Channelers gets +3/+3.
|
||||
ConditionalContinousEffect effect = new ConditionalContinousEffect(new BoostSourceEffect(3, 3, Constants.Duration.WhileOnBattlefield), new TopLibraryCardTypeCondition(CREATURE), rule1);
|
||||
ConditionalContinousEffect effect = new ConditionalContinousEffect(new BoostSourceEffect(3, 3, Constants.Duration.WhileOnBattlefield), new TopLibraryCardTypeCondition(TopLibraryCardTypeCondition.CheckType.CREATURE), rule1);
|
||||
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect));
|
||||
|
||||
// As long as the top card of your library is a land card, Mul Daya Channelers has "T: Add two mana of any one color to your mana pool."
|
||||
ConditionalGainActivatedAbility ability = new ConditionalGainActivatedAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(2), new TapSourceCost(), new TopLibraryCardTypeCondition(LAND), rule2);
|
||||
ability.addChoice(new ChoiceColor());
|
||||
this.addAbility(ability);
|
||||
SimpleManaAbility manaAbility = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(2), new TapSourceCost());
|
||||
manaAbility.addChoice(new ChoiceColor());
|
||||
effect = new ConditionalContinousEffect(new GainAbilitySourceEffect(manaAbility, Constants.Duration.WhileOnBattlefield),
|
||||
new TopLibraryCardTypeCondition(TopLibraryCardTypeCondition.CheckType.LAND),
|
||||
"As long as the top card of your library is a land card, Mul Daya Channelers has \"{T}: Add two mana of any one color to your mana pool.\"");
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||
|
||||
}
|
||||
|
||||
public MulDayaChannelers(final MulDayaChannelers card) {
|
||||
|
@ -86,4 +94,47 @@ public class MulDayaChannelers extends CardImpl<MulDayaChannelers> {
|
|||
public MulDayaChannelers copy() {
|
||||
return new MulDayaChannelers(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class MulDayaChannelersActivateIfConditionManaAbility extends ManaAbility<MulDayaChannelersActivateIfConditionManaAbility> {
|
||||
|
||||
private Condition condition;
|
||||
|
||||
public MulDayaChannelersActivateIfConditionManaAbility(Zone zone, ManaEffect effect, Cost cost, Condition condition) {
|
||||
super(zone, effect, cost);
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
public MulDayaChannelersActivateIfConditionManaAbility(MulDayaChannelersActivateIfConditionManaAbility ability) {
|
||||
super(ability);
|
||||
this.condition = ability.condition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canActivate(UUID playerId, Game game) {
|
||||
if (condition.apply(game, this)) {
|
||||
return super.canActivate(playerId, game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean activate(Game game, boolean noMana) {
|
||||
if (canActivate(this.controllerId, game)) {
|
||||
return super.activate(game, noMana);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "As long as the top card of your library is a land card, {this} has \"{T}: Add two mana of any one color to your mana pool.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public MulDayaChannelersActivateIfConditionManaAbility copy() {
|
||||
return new MulDayaChannelersActivateIfConditionManaAbility(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ import mage.abilities.Ability;
|
|||
import mage.choices.ChoiceColor;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
@ -47,7 +48,11 @@ public class AddManaOfAnyColorEffect extends ManaEffect<AddManaOfAnyColorEffect>
|
|||
public AddManaOfAnyColorEffect(final int amount) {
|
||||
super();
|
||||
this.amount = amount;
|
||||
this.staticText = "add " + amount + " mana of any color to your mana pool";
|
||||
this.staticText = new StringBuilder("add ")
|
||||
.append(CardUtil.numberToText(amount))
|
||||
.append(" mana of any ")
|
||||
.append(amount > 1 ?"one ":"")
|
||||
.append("color to your mana pool").toString();
|
||||
}
|
||||
|
||||
public AddManaOfAnyColorEffect(final AddManaOfAnyColorEffect effect) {
|
||||
|
|
Loading…
Reference in a new issue