some cards, start effects moving

This commit is contained in:
Loki 2011-02-07 22:09:47 +02:00
parent f377eee8e0
commit 6d188d76d7
54 changed files with 467 additions and 199 deletions

View file

@ -35,9 +35,10 @@ import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.AddPlusOneCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.counters.CounterType;
/**
*
@ -56,7 +57,7 @@ public class JenaraAsuraofWar extends CardImpl<JenaraAsuraofWar> {
this.power = new MageInt(3);
this.toughness = new MageInt(3);
this.addAbility(FlyingAbility.getInstance());
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddPlusOneCountersSourceEffect(1), new ManaCostsImpl("{1}{W}")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl("{1}{W}")));
}
public JenaraAsuraofWar (final JenaraAsuraofWar card) {

View file

@ -30,13 +30,13 @@ package mage.sets.alarareborn;
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.TriggeredAbilityImpl;
import mage.abilities.effects.common.AddPlusOneCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
@ -69,7 +69,7 @@ public class LorescaleCoatl extends CardImpl<LorescaleCoatl> {
class LorescaleCoatlAbility extends TriggeredAbilityImpl<LorescaleCoatlAbility> {
public LorescaleCoatlAbility() {
super(Zone.BATTLEFIELD, new AddPlusOneCountersSourceEffect(1), true);
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), true);
}
public LorescaleCoatlAbility(final LorescaleCoatlAbility ability) {

View file

@ -34,8 +34,9 @@ import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.AddPlusOneCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
@ -85,7 +86,7 @@ class BloodhallOozeTriggeredAbility1 extends TriggeredAbilityImpl<BloodhallOozeT
}
public BloodhallOozeTriggeredAbility1() {
super(Zone.BATTLEFIELD, new AddPlusOneCountersSourceEffect(1), true);
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), true);
}
public BloodhallOozeTriggeredAbility1(final BloodhallOozeTriggeredAbility1 ability) {
@ -126,7 +127,7 @@ class BloodhallOozeTriggeredAbility2 extends TriggeredAbilityImpl<BloodhallOozeT
}
public BloodhallOozeTriggeredAbility2() {
super(Zone.BATTLEFIELD, new AddPlusOneCountersSourceEffect(1), true);
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), true);
}
public BloodhallOozeTriggeredAbility2(final BloodhallOozeTriggeredAbility2 ability) {

View file

@ -0,0 +1,83 @@
/*
* 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.conflux;
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.BeginningOfControllerUpkeepTriggeredAbility;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetControlledPermanent;
/**
*
* @author Loki
*/
public class Esperzoa extends CardImpl<Esperzoa> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("artifact");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
}
public Esperzoa (UUID ownerId) {
super(ownerId, 25, "Esperzoa", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}{U}");
this.expansionSetCode = "CON";
this.subtype.add("Jellyfish");
this.color.setBlue(true);
this.power = new MageInt(4);
this.toughness = new MageInt(3);
this.addAbility(FlyingAbility.getInstance());
Ability ability = new BeginningOfControllerUpkeepTriggeredAbility(new ReturnToHandTargetEffect(), false);
TargetControlledPermanent t = new TargetControlledPermanent(filter);
t.setRequired(true);
ability.addTarget(t);
this.addAbility(ability);
}
public Esperzoa (final Esperzoa card) {
super(card);
}
@Override
public Esperzoa copy() {
return new Esperzoa(this);
}
}

View file

@ -37,8 +37,9 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.AddPlusOneCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.target.common.TargetControlledCreaturePermanent;
/**
@ -56,7 +57,7 @@ public class ScarlandThrinax extends CardImpl<ScarlandThrinax> {
this.subtype.add("Lizard");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddPlusOneCountersSourceEffect(1), new ManaCostsImpl());
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl());
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));
this.addAbility(ability);
}

View file

@ -0,0 +1,54 @@
/*
* 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.elspethvstezzeret;
import java.util.UUID;
/**
*
* @author Loki
*/
public class ClockworkCondor extends mage.sets.mirrodin.ClockworkCondor {
public ClockworkCondor (UUID ownerId) {
super(ownerId);
this.cardNumber = 50;
this.expansionSetCode = "DDF";
}
public ClockworkCondor (final ClockworkCondor card) {
super(card);
}
@Override
public ClockworkCondor copy() {
return new ClockworkCondor(this);
}
}

View file

@ -0,0 +1,54 @@
/*
* 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.elspethvstezzeret;
import java.util.UUID;
/**
*
* @author Loki
*/
public class Esperzoa extends mage.sets.conflux.Esperzoa {
public Esperzoa (UUID ownerId) {
super(ownerId);
this.cardNumber = 47;
this.expansionSetCode = "DDF";
}
public Esperzoa (final Esperzoa card) {
super(card);
}
@Override
public Esperzoa copy() {
return new Esperzoa(this);
}
}

View file

@ -42,7 +42,7 @@ import mage.abilities.LoyaltyAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.Effects;
import mage.abilities.effects.common.AddPlusOneCountersControlledEffect;
import mage.abilities.effects.common.counter.AddPlusOneCountersControlledEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.GainAbilityControlledEffect;
import mage.abilities.effects.common.GainLifeEffect;

View file

@ -42,9 +42,10 @@ import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.PreventionEffectImpl;
import mage.abilities.effects.common.AddPlusOneCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.counters.common.PlusOneCounter;
import mage.game.Game;
import mage.game.events.GameEvent;
@ -203,7 +204,7 @@ public class ProteanHydra extends CardImpl<ProteanHydra> {
class ProteanHydraDelayedTriggeredAbility extends DelayedTriggeredAbility<ProteanHydraDelayedTriggeredAbility> {
public ProteanHydraDelayedTriggeredAbility() {
super(new AddPlusOneCountersSourceEffect(2));
super(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)));
}
public ProteanHydraDelayedTriggeredAbility(final ProteanHydraDelayedTriggeredAbility ability) {

View file

@ -34,8 +34,9 @@ import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.AddPlusOneCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@ -77,7 +78,7 @@ public class AjanisPridemate extends CardImpl<AjanisPridemate> {
class AjanisPridemateAbility extends TriggeredAbilityImpl<AjanisPridemateAbility> {
public AjanisPridemateAbility() {
super(Zone.BATTLEFIELD, new AddPlusOneCountersSourceEffect(1), true);
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), true);
}
public AjanisPridemateAbility(final AjanisPridemateAbility ability) {

View file

@ -35,7 +35,7 @@ import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.AddPlusOneCountersAttachedEffect;
import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DestroySourceEffect;
import mage.abilities.keyword.EnchantAbility;

View file

@ -35,7 +35,7 @@ import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.AddPlusOneCountersControlledEffect;
import mage.abilities.effects.common.counter.AddPlusOneCountersControlledEffect;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope;
import mage.filter.FilterPermanent;

View file

@ -37,9 +37,10 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.effects.common.AddPlusOneCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.target.common.TargetCreatureOrPlayer;
/**
@ -55,7 +56,7 @@ public class Triskelion extends CardImpl<Triskelion> {
this.power = new MageInt(1);
this.toughness = new MageInt(1);
this.addAbility(new EntersBattlefieldAbility(new AddPlusOneCountersSourceEffect(3), "with three +1/+1 counters on it"));
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), "with three +1/+1 counters on it"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new RemoveCountersSourceCost("+1/+1", 1));
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);

View file

@ -0,0 +1,131 @@
/*
* 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.mirrodin;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.AttacksOrBlocksTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
/**
*
* @author Loki
*/
public class ClockworkCondor extends CardImpl<ClockworkCondor> {
public ClockworkCondor (UUID ownerId) {
super(ownerId, 154, "Clockwork Condor", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}");
this.expansionSetCode = "MRD";
this.subtype.add("Bird");
this.power = new MageInt(0);
this.toughness = new MageInt(0);
this.addAbility(FlyingAbility.getInstance());
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), "Clockwork Condor enters the battlefield with three +1/+1 counters on it"));
this.addAbility(new AttacksOrBlocksTriggeredAbility(new ClockworkCondorEffect(), false));
}
public ClockworkCondor (final ClockworkCondor card) {
super(card);
}
@Override
public ClockworkCondor copy() {
return new ClockworkCondor(this);
}
}
class ClockworkCondorEffect extends OneShotEffect<ClockworkCondorEffect> {
ClockworkCondorEffect() {
super(Constants.Outcome.UnboostCreature);
}
ClockworkCondorEffect(final ClockworkCondorEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent p = game.getPermanent(source.getSourceId());
if (p != null) {
ClockworkDragonDelayedTriggeredAbility delayedAbility = new ClockworkDragonDelayedTriggeredAbility();
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
}
return false;
}
@Override
public ClockworkCondorEffect copy() {
return new ClockworkCondorEffect(this);
}
@Override
public String getText(Ability source) {
return "remove a +1/+1 counter from Clockwork Condor at end of combat";
}
}
class ClockworkCondorDelayedTriggeredAbility extends DelayedTriggeredAbility<ClockworkCondorDelayedTriggeredAbility> {
ClockworkCondorDelayedTriggeredAbility() {
super(new RemoveCounterSourceEffect(CounterType.P1P1.createInstance()));
}
ClockworkCondorDelayedTriggeredAbility(final ClockworkCondorDelayedTriggeredAbility ability) {
super(ability);
}
@Override
public ClockworkCondorDelayedTriggeredAbility copy() {
return new ClockworkCondorDelayedTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.COMBAT_PHASE_POST) {
return true;
}
return false;
}
}

View file

@ -37,13 +37,13 @@ import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.AttacksOrBlocksTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.abilities.effects.common.RemoveCounterSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.counters.CounterType;
@ -65,7 +65,7 @@ public class ClockworkDragon extends CardImpl<ClockworkDragon> {
this.toughness = new MageInt(0);
this.addAbility(FlyingAbility.getInstance());
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(6)), "Clockwork Dragon enters the battlefield with six +1/+1 counters on it"));
this.addAbility(new ClockworkDragonTriggeredAbility());
this.addAbility(new AttacksOrBlocksTriggeredAbility(new ClockworkDragonEffect(), false));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new GenericManaCost(3)));
}
@ -79,36 +79,6 @@ public class ClockworkDragon extends CardImpl<ClockworkDragon> {
}
}
class ClockworkDragonTriggeredAbility extends TriggeredAbilityImpl<ClockworkDragonTriggeredAbility> {
ClockworkDragonTriggeredAbility() {
super(Zone.BATTLEFIELD, new ClockworkDragonEffect());
}
ClockworkDragonTriggeredAbility(final ClockworkDragonTriggeredAbility ability) {
super(ability);
}
@Override
public ClockworkDragonTriggeredAbility copy() {
return new ClockworkDragonTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED || event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
if (event.getSourceId().equals(this.getSourceId())) {
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever Clockwork Dragon attacks or blocks, remove a +1/+1 counter from it at end of combat";
}
}
class ClockworkDragonEffect extends OneShotEffect<ClockworkDragonEffect> {
ClockworkDragonEffect() {
super(Constants.Outcome.UnboostCreature);

View file

@ -32,7 +32,6 @@ import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
@ -42,7 +41,7 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.counters.CounterType;

View file

@ -30,14 +30,13 @@ package mage.sets.scarsofmirrodin;
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.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.effects.common.AddCountersTargetEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.target.common.TargetCreaturePermanent;

View file

@ -32,17 +32,15 @@ import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Abilities;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfControllerUpkeepTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.game.Game;

View file

@ -30,16 +30,14 @@ package mage.sets.scarsofmirrodin;
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.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.game.Game;

View file

@ -32,14 +32,13 @@ import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.counters.CounterType;

View file

@ -31,7 +31,7 @@ package mage.sets.scarsofmirrodin;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.effects.common.AddCountersTargetEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;

View file

@ -35,7 +35,7 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;

View file

@ -30,7 +30,6 @@ package mage.sets.scarsofmirrodin;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
@ -38,10 +37,9 @@ import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.CardImpl;
import mage.counters.Counter;
import mage.counters.CounterType;
import mage.target.TargetPlayer;

View file

@ -34,7 +34,7 @@ import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.PutIntoGraveFromBattlefieldTriggeredAbility;
import mage.abilities.effects.common.AddCountersTargetEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.InfectAbility;
import mage.cards.CardImpl;
import mage.counters.CounterType;

View file

@ -32,17 +32,14 @@ import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Abilities;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.cards.Card;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.game.Game;

View file

@ -31,20 +31,15 @@ package mage.sets.scarsofmirrodin;
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.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AddCountersTargetEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.counters.common.MinusOneCounter;
import mage.target.Target;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**

View file

@ -30,11 +30,9 @@ package mage.sets.scarsofmirrodin;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.abilities.effects.common.ProliferateEffect;
import mage.abilities.effects.common.counter.ProliferateEffect;
import mage.cards.CardImpl;
/**

View file

@ -36,7 +36,7 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.ProliferateEffect;
import mage.abilities.effects.common.counter.ProliferateEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;

View file

@ -30,7 +30,6 @@ package mage.sets.scarsofmirrodin;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
@ -42,9 +41,8 @@ import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.abilities.effects.common.AddCountersTargetEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.target.Target;

View file

@ -38,7 +38,7 @@ import mage.abilities.costs.CostsImpl;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;

View file

@ -31,7 +31,6 @@ package mage.sets.scarsofmirrodin;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -41,8 +40,7 @@ import mage.abilities.costs.CostsImpl;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;

View file

@ -43,8 +43,7 @@ import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.abilities.effects.common.AddCountersTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;

View file

@ -31,7 +31,6 @@ package mage.sets.scarsofmirrodin;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -41,9 +40,8 @@ import mage.abilities.costs.CostsImpl;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;

View file

@ -37,7 +37,7 @@ import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.TapTargetEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;

View file

@ -32,15 +32,13 @@ import java.util.UUID;
import mage.Constants;
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.EntersBattlefieldAbility;
import mage.abilities.common.LandfallAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AddPlusOneCountersControlledEffect;
import mage.abilities.effects.common.counter.AddPlusOneCountersControlledEffect;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope;
import mage.filter.FilterPermanent;

View file

@ -38,7 +38,7 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.GainAbilitySourceEffect;
import mage.abilities.effects.common.ManaEffect;
import mage.abilities.keyword.MultikickerAbility;

View file

@ -37,11 +37,12 @@ import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTappedAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.AddPlusOneCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.BecomesCreatureSourceEOTEffect;
import mage.abilities.mana.GreenManaAbility;
import mage.abilities.mana.RedManaAbility;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.game.permanent.token.Token;
/**
@ -85,6 +86,6 @@ class RagingRavineToken extends Token {
color.setGreen(true);
power = new MageInt(3);
toughness = new MageInt(3);
addAbility(new AttacksTriggeredAbility(new AddPlusOneCountersSourceEffect(1), false));
addAbility(new AttacksTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
}
}

View file

@ -36,11 +36,12 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.AddPlusOneCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.GainAbilitySourceEffect;
import mage.abilities.keyword.KickerAbility;
import mage.abilities.keyword.UnblockableAbility;
import mage.cards.CardImpl;
import mage.counters.CounterType;
/**
*
@ -57,7 +58,7 @@ public class AetherFigment extends CardImpl<AetherFigment> {
this.toughness = new MageInt(1);
this.addAbility(UnblockableAbility.getInstance());
Ability ability1 = new EntersBattlefieldTriggeredAbility(new AddPlusOneCountersSourceEffect(2));
Ability ability1 = new EntersBattlefieldTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)));
KickerAbility ability2 = new KickerAbility(new GainAbilitySourceEffect(ability1, Duration.WhileOnBattlefield), false);
ability2.addManaCost(new GenericManaCost(3));
this.addAbility(ability2);

View file

@ -36,7 +36,7 @@ import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.BoostControlledEffect;
import mage.cards.CardImpl;
import mage.game.Game;

View file

@ -32,7 +32,7 @@ import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.abilities.effects.common.AddCountersTargetEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.effects.common.GainAbilityTargetEffect;
import mage.abilities.effects.common.GainControlTargetEffect;
import mage.abilities.effects.common.UntapTargetEffect;

View file

@ -35,9 +35,10 @@ import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.LandfallAbility;
import mage.abilities.effects.common.AddPlusOneCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.target.TargetPlayer;
/**
@ -56,7 +57,7 @@ public class ObNixilistheFallen extends CardImpl<ObNixilistheFallen> {
this.toughness = new MageInt(3);
Ability ability = new LandfallAbility(new LoseLifeTargetEffect(3), true);
ability.addEffect(new AddPlusOneCountersSourceEffect(3));
ability.addEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)));
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
}

View file

@ -34,8 +34,9 @@ import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.AddPlusOneCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
@ -78,7 +79,7 @@ class ScuteMobAbility extends TriggeredAbilityImpl<ScuteMobAbility> {
private FilterLandPermanent filter = new FilterLandPermanent();
public ScuteMobAbility() {
super(Zone.BATTLEFIELD, new AddPlusOneCountersSourceEffect(4));
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(4)));
}
public ScuteMobAbility(final ScuteMobAbility ability) {

View file

@ -39,7 +39,7 @@ import mage.abilities.costs.Costs;
import mage.abilities.costs.CostsImpl;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;

View file

@ -0,0 +1,37 @@
package mage.abilities.common;
import mage.Constants;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.game.Game;
import mage.game.events.GameEvent;
public class AttacksOrBlocksTriggeredAbility extends TriggeredAbilityImpl<AttacksOrBlocksTriggeredAbility> {
public AttacksOrBlocksTriggeredAbility(Effect effect, boolean optional) {
super(Constants.Zone.BATTLEFIELD, effect, optional);
}
public AttacksOrBlocksTriggeredAbility(final AttacksOrBlocksTriggeredAbility ability) {
super(ability);
}
@Override
public AttacksOrBlocksTriggeredAbility copy() {
return new AttacksOrBlocksTriggeredAbility(this);
}
@Override
public String getRule() {
return "When {this} attacks or blocks, " + super.getRule();
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED || event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
if (event.getSourceId().equals(this.getSourceId())) {
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,35 @@
package mage.abilities.effects.common;
import mage.Constants;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.game.Game;
import mage.game.permanent.Permanent;
public class AddDelayedTrigeredAbilityEffect extends OneShotEffect<AddDelayedTrigeredAbilityEffect> {
private DelayedTriggeredAbility ability;
public AddDelayedTrigeredAbilityEffect(DelayedTriggeredAbility ability) {
super(Constants.Outcome.AddAbility);
this.ability = ability;
}
public AddDelayedTrigeredAbilityEffect(final AddDelayedTrigeredAbilityEffect effect) {
super(effect);
this.ability = effect.ability.copy();
}
@Override
public boolean apply(Game game, Ability source) {
ability.setSourceId(source.getSourceId());
ability.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(ability);
return true;
}
@Override
public AddDelayedTrigeredAbilityEffect copy() {
return new AddDelayedTrigeredAbilityEffect(this);
}
}

View file

@ -1,78 +0,0 @@
/*
* 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.abilities.effects.common;
import mage.Constants.Outcome;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.counters.common.PlusOneCounter;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class AddPlusOneCountersSourceEffect extends OneShotEffect<AddPlusOneCountersSourceEffect> {
private int amount;
public AddPlusOneCountersSourceEffect(int amount) {
super(Outcome.BoostCreature);
this.amount = amount;
}
public AddPlusOneCountersSourceEffect(final AddPlusOneCountersSourceEffect effect) {
super(effect);
this.amount = effect.amount;
}
@Override
public AddPlusOneCountersSourceEffect copy() {
return new AddPlusOneCountersSourceEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
permanent.addCounters(new PlusOneCounter(amount));
}
return true;
}
@Override
public String getText(Ability source) {
if (amount > 1)
return "put " + Integer.toString(amount) + " +1/+1 counters on {this}";
else
return "put a +1/+1 counter on {this}";
}
}

View file

@ -26,7 +26,7 @@
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.effects.common;
package mage.abilities.effects.common.counter;
import mage.Constants.Outcome;
import mage.abilities.Ability;

View file

@ -26,7 +26,7 @@
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.effects.common;
package mage.abilities.effects.common.counter;
import mage.Constants.Outcome;
import mage.abilities.Ability;

View file

@ -26,7 +26,7 @@
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.effects.common;
package mage.abilities.effects.common.counter;
import mage.Constants.Outcome;
import mage.abilities.Ability;

View file

@ -26,7 +26,7 @@
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.effects.common;
package mage.abilities.effects.common.counter;
import mage.Constants.Outcome;
import mage.abilities.Ability;

View file

@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.effects.common;
package mage.abilities.effects.common.counter;
import mage.Constants.Outcome;
import mage.abilities.Ability;

View file

@ -1,4 +1,4 @@
package mage.abilities.effects.common;
package mage.abilities.effects.common.counter;
import mage.Constants;
import mage.abilities.Ability;

View file

@ -32,7 +32,7 @@ import mage.Constants.TimingRule;
import mage.Constants.Zone;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.effects.common.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
/**
*