Added Aeon Chronicler.

This commit is contained in:
LevelX2 2014-11-03 17:22:14 +01:00
parent e747326028
commit 320f345b1d
3 changed files with 174 additions and 5 deletions

View file

@ -0,0 +1,109 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.jacevsvraska;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
import mage.abilities.keyword.SuspendAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
/**
*
* @author LevelX2
*/
public class AeonChronicler extends CardImpl {
public AeonChronicler(UUID ownerId) {
super(ownerId, 17, "Aeon Chronicler", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{U}");
this.expansionSetCode = "DDM";
this.subtype.add("Avatar");
this.color.setBlue(true);
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// Aeon Chronicler's power and toughness are each equal to the number of cards in your hand.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInControllerHandCount(), Duration.EndOfGame)));
// Suspend X-{X}{3}{U}. X can't be 0.
this.addAbility(new SuspendAbility(Integer.MAX_VALUE, new ManaCostsImpl("{X}{3}"), this, true));
// Whenever a time counter is removed from Aeon Chronicler while it's exiled, draw a card.
this.addAbility(new AeonChroniclerTriggeredAbility());
}
public AeonChronicler(final AeonChronicler card) {
super(card);
}
@Override
public AeonChronicler copy() {
return new AeonChronicler(this);
}
}
class AeonChroniclerTriggeredAbility extends TriggeredAbilityImpl {
public AeonChroniclerTriggeredAbility() {
super(Zone.EXILED, new DrawCardSourceControllerEffect(1), false);
}
public AeonChroniclerTriggeredAbility(final AeonChroniclerTriggeredAbility ability) {
super(ability);
}
@Override
public AeonChroniclerTriggeredAbility copy() {
return new AeonChroniclerTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return EventType.COUNTER_REMOVED.equals(event.getType()) && event.getData().equals("time") && event.getTargetId().equals(this.getSourceId());
}
@Override
public String getRule() {
return "Whenever a time counter is removed from {this} while it's exiled, " + super.getRule();
}
}

View file

@ -0,0 +1,52 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.planarchaos;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public class AeonChronicler extends mage.sets.jacevsvraska.AeonChronicler {
public AeonChronicler(UUID ownerId) {
super(ownerId);
this.cardNumber = 32;
this.expansionSetCode = "PLC";
}
public AeonChronicler(final AeonChronicler card) {
super(card);
}
@Override
public AeonChronicler copy() {
return new AeonChronicler(this);
}
}

View file

@ -38,6 +38,8 @@ import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.SuspendedCondition;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.costs.mana.VariableManaCost;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.OneShotEffect;
@ -140,12 +142,11 @@ public class SuspendAbility extends ActivatedAbilityImpl {
private String ruleText;
private boolean gainedTemporary;
private boolean shortRule;
/**
* Gives the card the SuspendAbility
*
* @param suspend - amount of time counters
* @param suspend - amount of time counters, if Integer.MAX_VALUE is set there will be {X} costs and X counters added
* @param cost - null is used for temporary gained suspend ability
* @param card - card that has the suspend ability
*/
@ -156,7 +157,12 @@ public class SuspendAbility extends ActivatedAbilityImpl {
public SuspendAbility(int suspend, ManaCost cost, Card card, boolean shortRule) {
super(Zone.HAND, new SuspendExileEffect(suspend), cost);
this.usesStack = false;
this.shortRule = shortRule;
if (suspend == Integer.MAX_VALUE) {
VariableManaCost xCosts = new VariableManaCost();
xCosts.setMinX(1);
this.addManaCost(xCosts);
cost = new ManaCostsImpl("{X}" + cost.getText());
}
StringBuilder sb = new StringBuilder("Suspend ");
if (cost != null) {
sb.append(suspend).append(" - ").append(cost.getText());
@ -164,7 +170,7 @@ public class SuspendAbility extends ActivatedAbilityImpl {
sb.append(" <i>(Rather than cast this card from your hand, pay ")
.append(cost.getText())
.append(" and exile it with ")
.append(suspend == 1 ? "a time counter":suspend + " time counters")
.append((suspend == 1 ? "a time counter": suspend == Integer.MAX_VALUE ? "X time counters": suspend + " time counters"))
.append(" on it.")
.append(" At the beginning of your upkeep, remove a time counter. When the last is removed, cast it without paying its mana cost.")
.append(card.getCardType().contains(CardType.CREATURE)? " If you play it this way and it's a creature, it gains haste until you lose control of it.":"")
@ -185,7 +191,6 @@ public class SuspendAbility extends ActivatedAbilityImpl {
super(ability);
this.ruleText = ability.getRule();
this.gainedTemporary = ability.gainedTemporary;
this.shortRule = ability.shortRule;
}
@Override
@ -249,6 +254,9 @@ class SuspendExileEffect extends OneShotEffect {
game.getState().setValue("SuspendExileId" + source.getControllerId().toString(), exileId);
}
if (card.moveToExile(exileId, new StringBuilder("Suspended cards of ").append(controller.getName()).toString() , source.getSourceId(), game)) {
if (suspend == Integer.MAX_VALUE) {
suspend = source.getManaCostsToPay().getX();
}
card.addCounters(CounterType.TIME.createInstance(suspend), game);
game.informPlayers(new StringBuilder(controller.getName()).append(" suspends (").append(suspend).append(") ").append(card.getName()).toString());
return true;