Added cards.

Refactored some stuff regarding rule text.
This commit is contained in:
North 2011-06-11 00:28:04 +03:00
parent ec60feadd8
commit b6f4f0082a
29 changed files with 907 additions and 52 deletions

View file

@ -0,0 +1,70 @@
/*
* 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.mirrodinbesieged;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount;
import mage.abilities.effects.common.continious.BoostEquippedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.LivingWeaponAbility;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreatureCard;
/**
*
* @author North
*/
public class Bonehoard extends CardImpl<Bonehoard> {
public Bonehoard(UUID ownerId) {
super(ownerId, 100, "Bonehoard", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}");
this.expansionSetCode = "MBS";
this.subtype.add("Equipment");
this.addAbility(new LivingWeaponAbility());
CardsInAllGraveyardsCount value = new CardsInAllGraveyardsCount(new FilterCreatureCard());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(value, value)));
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(2)));
}
public Bonehoard(final Bonehoard card) {
super(card);
}
@Override
public Bonehoard copy() {
return new Bonehoard(this);
}
}

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.mirrodinbesieged;
import java.util.Set;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DrawCardTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author North
*/
public class PsychosisCrawler extends CardImpl<PsychosisCrawler> {
public PsychosisCrawler(UUID ownerId) {
super(ownerId, 126, "Psychosis Crawler", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}");
this.expansionSetCode = "MBS";
this.subtype.add("Horror");
this.power = new MageInt(0);
this.toughness = new MageInt(0);
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInControllerHandCount(), Constants.Duration.EndOfGame)));
this.addAbility(new DrawCardTriggeredAbility(new LoseLifeOpponentsEffect(), false));
}
public PsychosisCrawler(final PsychosisCrawler card) {
super(card);
}
@Override
public PsychosisCrawler copy() {
return new PsychosisCrawler(this);
}
}
class LoseLifeOpponentsEffect extends OneShotEffect<LoseLifeOpponentsEffect> {
public LoseLifeOpponentsEffect() {
super(Outcome.Damage);
}
public LoseLifeOpponentsEffect(final LoseLifeOpponentsEffect effect) {
super(effect);
}
@Override
public LoseLifeOpponentsEffect copy() {
return new LoseLifeOpponentsEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
boolean applied = false;
Set<UUID> opponents = game.getOpponents(source.getControllerId());
for (UUID opponentUUID : opponents) {
Player player = game.getPlayer(opponentUUID);
if (player != null) {
player.loseLife(1, game);
applied = true;
}
}
return applied;
}
@Override
public String getText(Ability source) {
return "each opponent loses 1 life";
}
}

View file

@ -0,0 +1,129 @@
/*
* 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.mirrodinbesieged;
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.EvasionAbility;
import mage.abilities.effects.RestrictionEffect;
import mage.abilities.keyword.BattleCryAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.ReachAbility;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author North
*/
public class SignalPest extends CardImpl<SignalPest> {
public SignalPest(UUID ownerId) {
super(ownerId, 131, "Signal Pest", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}");
this.expansionSetCode = "MBS";
this.subtype.add("Pest");
this.power = new MageInt(0);
this.toughness = new MageInt(1);
this.addAbility(new BattleCryAbility());
this.addAbility(new SignalPestAbility());
}
public SignalPest(final SignalPest card) {
super(card);
}
@Override
public SignalPest copy() {
return new SignalPest(this);
}
}
class SignalPestAbility extends EvasionAbility<SignalPestAbility> {
private static SignalPestAbility instance;
public static SignalPestAbility getInstance() {
if (instance == null) {
instance = new SignalPestAbility();
}
return instance;
}
public SignalPestAbility() {
this.addEffect(new SignalPestEffect());
}
@Override
public String getRule() {
return "Signal Pest can't be blocked except by creatures with flying or reach";
}
@Override
public SignalPestAbility copy() {
return instance;
}
}
class SignalPestEffect extends RestrictionEffect<SignalPestEffect> {
public SignalPestEffect() {
super(Constants.Duration.WhileOnBattlefield);
}
public SignalPestEffect(final SignalPestEffect effect) {
super(effect);
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getAbilities().containsKey(SignalPestAbility.getInstance().getId())) {
return true;
}
return false;
}
@Override
public boolean canBlock(Permanent attacker, Permanent blocker, Game game) {
if (blocker.getAbilities().contains(FlyingAbility.getInstance()) || blocker.getAbilities().contains(ReachAbility.getInstance())) {
return true;
}
return false;
}
@Override
public SignalPestEffect copy() {
return new SignalPestEffect(this);
}
}

View file

@ -0,0 +1,68 @@
/*
* 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.newphyrexia;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount;
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterArtifactCard;
/**
*
* @author North
*/
public class SlagFiend extends CardImpl<SlagFiend> {
public SlagFiend(UUID ownerId) {
super(ownerId, 95, "Slag Fiend", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{R}");
this.expansionSetCode = "NPH";
this.subtype.add("Construct");
this.color.setRed(true);
this.power = new MageInt(0);
this.toughness = new MageInt(0);
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInAllGraveyardsCount(new FilterArtifactCard("artifacts")), Constants.Duration.EndOfGame)));
}
public SlagFiend(final SlagFiend card) {
super(card);
}
@Override
public SlagFiend copy() {
return new SlagFiend(this);
}
}

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.riseoftheeldrazi;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyNoRegenTargetEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author North
*/
public class Vendetta extends CardImpl<Vendetta> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature");
static {
filter.setColor(ObjectColor.BLACK);
filter.setNotColor(true);
}
public Vendetta(UUID ownerId) {
super(ownerId, 130, "Vendetta", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}");
this.expansionSetCode = "ROE";
this.color.setBlack(true);
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addEffect(new DestroyNoRegenTargetEffect());
this.getSpellAbility().addEffect(new VendettaEffect());
}
public Vendetta(final Vendetta card) {
super(card);
}
@Override
public Vendetta copy() {
return new Vendetta(this);
}
}
class VendettaEffect extends OneShotEffect<VendettaEffect> {
public VendettaEffect() {
super(Outcome.Damage);
}
public VendettaEffect(final VendettaEffect effect) {
super(effect);
}
@Override
public VendettaEffect copy() {
return new VendettaEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent target = game.getPermanent(source.getFirstTarget());
if (player != null && target != null) {
player.loseLife(target.getToughness().getValue(), game);
return true;
}
return false;
}
@Override
public String getText(Ability source) {
return "You lose life equal to that creature's toughness";
}
}

View file

@ -61,9 +61,7 @@ public class DarksteelJuggernaut extends CardImpl<DarksteelJuggernaut> {
this.power = new MageInt(0);
this.toughness = new MageInt(0);
PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(filter);
SetPowerToughnessSourceEffect effect = new SetPowerToughnessSourceEffect(value, value, Constants.Duration.EndOfGame);
effect.setStaticText("Darksteel Juggernaut's power and toughness are each equal to the number of artifacts you control");
SetPowerToughnessSourceEffect effect = new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Constants.Duration.EndOfGame);
this.addAbility(new SimpleStaticAbility(Constants.Zone.ALL, effect));
this.addAbility(IndestructibleAbility.getInstance());
this.addAbility(new AttacksEachTurnStaticAbility());

View file

@ -0,0 +1,70 @@
/*
* 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.worldwake;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.effects.common.DestroyNoRegenTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonType;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author North
*/
public class Smother extends CardImpl<Smother> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost 3 or less");
static {
filter.setConvertedManaCost(4);
filter.setConvertedManaCostComparison(ComparisonType.LessThan);
}
public Smother(UUID ownerId) {
super(ownerId, 68, "Smother", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{B}");
this.expansionSetCode = "WWK";
this.color.setBlack(true);
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addEffect(new DestroyNoRegenTargetEffect());
}
public Smother(final Smother card) {
super(card);
}
@Override
public Smother copy() {
return new Smother(this);
}
}

View file

@ -0,0 +1,72 @@
/*
* 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.zendikar;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continious.BoostControlledEffect;
import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
import mage.abilities.keyword.HasteAbility;
import mage.abilities.keyword.KickerAbility;
import mage.cards.CardImpl;
/**
*
* @author North
*/
public class GoblinBushwhacker extends CardImpl<GoblinBushwhacker> {
public GoblinBushwhacker(UUID ownerId) {
super(ownerId, 125, "Goblin Bushwhacker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}");
this.expansionSetCode = "ZEN";
this.subtype.add("Goblin");
this.subtype.add("Warrior");
this.color.setRed(true);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
KickerAbility ability = new KickerAbility(new BoostControlledEffect(1, 0, Duration.EndOfTurn), false);
ability.addEffect(new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn));
ability.addCost(new ManaCostsImpl("{R}"));
this.addAbility(ability);
}
public GoblinBushwhacker(final GoblinBushwhacker card) {
super(card);
}
@Override
public GoblinBushwhacker copy() {
return new GoblinBushwhacker(this);
}
}

View file

@ -0,0 +1,96 @@
/*
* 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.zendikar;
import java.util.List;
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.decorator.ConditionalContinousEffect;
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author North
*/
public class KorDuelist extends CardImpl<KorDuelist> {
private static final String ruleText = "As long as Kor Duelist is equipped, it has double strike";
public KorDuelist(UUID ownerId) {
super(ownerId, 19, "Kor Duelist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}");
this.expansionSetCode = "ZEN";
this.subtype.add("Kor");
this.subtype.add("Soldier");
this.color.setWhite(true);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
GainAbilitySourceEffect effect = new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(effect, new SourceIsEquiped(), ruleText)));
}
public KorDuelist(final KorDuelist card) {
super(card);
}
@Override
public KorDuelist copy() {
return new KorDuelist(this);
}
}
class SourceIsEquiped implements Condition {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
List<UUID> attachments = permanent.getAttachments();
for (UUID attachmentUUID : attachments) {
Permanent attachment = game.getPermanent(attachmentUUID);
if (attachment != null) {
if (attachment.getSubtype().contains("Equipment")) {
return true;
}
}
}
}
return false;
}
}

View file

@ -53,7 +53,7 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class VinesOfVastwood extends CardImpl<VinesOfVastwood> {
private static FilterStackObject filter = new FilterStackObject("spells or abilities your opponents control");
private static final FilterStackObject filter = new FilterStackObject("spells or abilities your opponents control");
static {
filter.setTargetController(TargetController.OPPONENT);

View file

@ -3,7 +3,6 @@ package mage;
import java.io.Serializable;
import java.util.List;
import mage.Constants.CardType;
import mage.Constants.Zone;
import mage.abilities.Abilities;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCost;

View file

@ -39,8 +39,6 @@ import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.counters.Counter;
import mage.counters.common.LoyaltyCounter;
import mage.game.Game;
public abstract class MageObjectImpl<T extends MageObjectImpl<T>> implements MageObject {

View file

@ -0,0 +1,62 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.dynamicvalue.common;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import mage.players.PlayerList;
/**
*
* @author North
*/
public class CardsInAllGraveyardsCount implements DynamicValue {
private FilterCard filter;
public CardsInAllGraveyardsCount() {
this(new FilterCard());
}
public CardsInAllGraveyardsCount(FilterCard filter) {
this.filter = filter;
}
private CardsInAllGraveyardsCount(CardsInAllGraveyardsCount dynamicValue) {
this.filter = dynamicValue.filter;
}
@Override
public int calculate(Game game, Ability sourceAbility) {
int amount = 0;
PlayerList playerList = game.getPlayerList();
for (UUID playerUUID : playerList) {
Player player = game.getPlayer(playerUUID);
if (player != null) {
amount += player.getGraveyard().count(filter, game);
}
}
return amount;
}
@Override
public DynamicValue clone() {
return new CardsInAllGraveyardsCount(this);
}
@Override
public String toString() {
return "1";
}
@Override
public String getMessage() {
return filter.getMessage() + " in all graveyards";
}
}

View file

@ -54,6 +54,6 @@ public class CardsInControllerGraveyardCount implements DynamicValue {
@Override
public String getMessage() {
return " for each " + filter.getMessage() + " in your graveyard";
return filter.getMessage() + " in your graveyard";
}
}

View file

@ -22,6 +22,6 @@ public class CardsInControllerHandCount implements DynamicValue {
@Override
public String getMessage() {
return "";
return "card in your hand";
}
}

View file

@ -38,6 +38,6 @@ public class CountersCount implements DynamicValue {
@Override
public String getMessage() {
return "";
return counter.getName() + " on {this}";
}
}

View file

@ -49,6 +49,6 @@ public class PermanentsOnBattlefieldCount implements DynamicValue {
@Override
public String getMessage() {
return " for each " + filter.getMessage();
return filter.getMessage();
}
}

View file

@ -90,7 +90,11 @@ public class CreateTokenEffect extends OneShotEffect<CreateTokenEffect> {
sb.append("put ").append(amount);
}
sb.append(" ").append(token.getDescription()).append(" onto the battlefield");
sb.append(amount.getMessage());
String message = amount.getMessage();
if (message.length() > 0) {
sb.append(" for each ");
}
sb.append(message);
return sb.toString();
}

View file

@ -76,7 +76,14 @@ public class DamageAllEffect extends OneShotEffect<DamageAllEffect> {
@Override
public String getText(Ability source) {
return "{source} deals " + amount.toString() + " damage to each " + filter.getMessage() + amount.getMessage();
StringBuilder sb = new StringBuilder();
sb.append("{source} deals ").append(amount.toString()).append(" damage to each ").append(filter.getMessage());
String message = amount.getMessage();
if (message.length() > 0) {
sb.append(" for each ");
}
sb.append(message);
return sb.toString();
}
}

View file

@ -103,7 +103,11 @@ public class DamageTargetEffect extends OneShotEffect<DamageTargetEffect> {
StringBuilder sb = new StringBuilder();
sb.append("{source} deals ").append(amount).append(" damage to target ");
sb.append(source.getTargets().get(0).getTargetName());
sb.append(amount.getMessage());
String message = amount.getMessage();
if (message.length() > 0) {
sb.append(" for each ");
}
sb.append(message);
if (!preventable)
sb.append(". The damage can't be prevented");
return sb.toString();

View file

@ -83,7 +83,11 @@ public class DiscardTargetEffect extends OneShotEffect<DiscardTargetEffect> {
} catch (Exception e) {
sb.append("s");
}
sb.append(amount.getMessage());
String message = amount.getMessage();
if (message.length() > 0) {
sb.append(" for each ");
}
sb.append(message);
return sb.toString();
}
}

View file

@ -84,7 +84,11 @@ public class DrawCardTargetEffect extends OneShotEffect<DrawCardTargetEffect> {
} catch (Exception e) {
sb.append("s");
}
sb.append(amount.getMessage());
String message = amount.getMessage();
if (message.length() > 0) {
sb.append(" for each ");
}
sb.append(message);
return sb.toString();
}

View file

@ -74,7 +74,14 @@ public class GainLifeEffect extends OneShotEffect<GainLifeEffect> {
@Override
public String getDynamicText(Ability source) {
return "you gain " + life.toString() + " life" + life.getMessage();
StringBuilder sb = new StringBuilder();
sb.append("you gain ").append(life.toString()).append(" life");
String message = life.getMessage();
if (message.length() > 0) {
sb.append(" for each ");
}
sb.append(message);
return sb.toString();
}
}

View file

@ -75,14 +75,19 @@ public class LoseLifeTargetEffect extends OneShotEffect<LoseLifeTargetEffect> {
@Override
public String getText(Ability source) {
StringBuffer result = new StringBuffer();
StringBuilder sb = new StringBuilder();
if (source.getTargets().size() > 0) {
result.append("Target " + source.getTargets().get(0).getTargetName());
sb.append("Target ").append(source.getTargets().get(0).getTargetName());
} else {
result.append("that player");
sb.append("that player");
}
result.append(" loses ").append(amount).append(" life").append(amount.getMessage());
return result.toString();
sb.append(" loses ").append(amount).append(" life");
String message = amount.getMessage();
if (message.length() > 0) {
sb.append(" for each ");
}
sb.append(message);
return sb.toString();
}

View file

@ -91,7 +91,12 @@ public class PutLibraryIntoGraveTargetEffect extends OneShotEffect<PutLibraryInt
sb.append(amount).append(" card ");
else
sb.append(amount).append(" cards ");
sb.append("of his or her library into his or her graveyard").append(amount.getMessage());
sb.append("of his or her library into his or her graveyard");
String message = amount.getMessage();
if (message.length() > 0) {
sb.append(" for each ");
}
sb.append(message);
return sb.toString();
}

View file

@ -93,10 +93,26 @@ public class BoostEquippedEffect extends ContinuousEffectImpl<BoostEquippedEffec
@Override
public String getDynamicText(Ability source) {
StringBuilder sb = new StringBuilder();
sb.append("Equipped creatures gets ").append(power).append("/").append(toughness);
sb.append("Equipped creatures gets ");
String p = power.toString();
if(!p.startsWith("-"))
sb.append("+");
sb.append(p).append("/");
String t = toughness.toString();
if(!t.startsWith("-")){
if(p.startsWith("-"))
sb.append("-");
else
sb.append("+");
}
sb.append(t);
if (duration != Duration.WhileOnBattlefield)
sb.append(" ").append(duration.toString());
sb.append(power.getMessage());
String message = power.getMessage();
if (message.length() > 0) {
sb.append(" for each ");
}
sb.append(message);
return sb.toString();
}

View file

@ -82,10 +82,26 @@ public class BoostSourceEffect extends ContinuousEffectImpl<BoostSourceEffect> {
@Override
public String getDynamicText(Ability source) {
StringBuilder sb = new StringBuilder();
sb.append("{this} gets ").append(power).append("/").append(toughness);
sb.append("{this} gets ");
String p = power.toString();
if(!p.startsWith("-"))
sb.append("+");
sb.append(p).append("/");
String t = toughness.toString();
if(!t.startsWith("-")){
if(p.startsWith("-"))
sb.append("-");
else
sb.append("+");
}
sb.append(t);
if (duration != Duration.WhileOnBattlefield)
sb.append(" ").append(duration.toString());
sb.append(power.getMessage());
String message = power.getMessage();
if (message.length() > 0) {
sb.append(" for each ");
}
sb.append(message);
return sb.toString();
}

View file

@ -83,10 +83,25 @@ public class BoostTargetEffect extends ContinuousEffectImpl<BoostTargetEffect> {
public String getText(Ability source) {
StringBuilder sb = new StringBuilder();
sb.append("Target ").append(source.getTargets().get(0).getTargetName()).append(" gets ");
sb.append(power).append("/").append(toughness);
String p = power.toString();
if(!p.startsWith("-"))
sb.append("+");
sb.append(p).append("/");
String t = toughness.toString();
if(!t.startsWith("-")){
if(p.startsWith("-"))
sb.append("-");
else
sb.append("+");
}
sb.append(t);
if (duration != Duration.WhileOnBattlefield)
sb.append(" ").append(duration.toString());
sb.append(power.getMessage());
String message = power.getMessage();
if (message.length() > 0) {
sb.append(" for each ");
}
sb.append(message);
return sb.toString();
}
}

View file

@ -34,34 +34,26 @@ import mage.Constants.Outcome;
import mage.Constants.SubLayer;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author BetaSteward_at_googlemail.com
* @author BetaSteward_at_googlemail.com, North
*/
public class SetPowerToughnessSourceEffect extends ContinuousEffectImpl<SetPowerToughnessSourceEffect> {
private DynamicValue power;
private DynamicValue toughness;
private DynamicValue amount;
public SetPowerToughnessSourceEffect(DynamicValue power, DynamicValue toughness, Duration duration) {
public SetPowerToughnessSourceEffect(DynamicValue amount, Duration duration) {
super(duration, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature);
this.power = power;
this.toughness = toughness;
this.amount = amount;
}
public SetPowerToughnessSourceEffect(int power, int toughness, Duration duration) {
this(new StaticValue(power), new StaticValue(toughness), duration);
}
public SetPowerToughnessSourceEffect(final SetPowerToughnessSourceEffect effect) {
super(effect);
this.power = effect.power;
this.toughness = effect.toughness;
this.amount = effect.amount;
}
@Override
@ -73,8 +65,9 @@ public class SetPowerToughnessSourceEffect extends ContinuousEffectImpl<SetPower
public boolean apply(Game game, Ability source) {
Permanent target = game.getPermanent(source.getSourceId());
if (target != null) {
target.getPower().setValue(power.calculate(game, source));
target.getToughness().setValue(toughness.calculate(game, source));
int value = amount.calculate(game, source);
target.getPower().setValue(value);
target.getToughness().setValue(value);
return true;
}
return false;
@ -83,13 +76,8 @@ public class SetPowerToughnessSourceEffect extends ContinuousEffectImpl<SetPower
@Override
public String getDynamicText(Ability source) {
StringBuilder sb = new StringBuilder();
sb.append("{this} ").append(" becomes ");
sb.append(power).append("/").append(toughness);
if (duration != Duration.WhileOnBattlefield)
sb.append(" ").append(duration.toString());
sb.append(power.getMessage());
sb.append("{this}'s power and toughness are each equal to the number of ");
sb.append(amount.getMessage());
return sb.toString();
}
}
}