added Metalcraft

This commit is contained in:
BetaSteward 2010-12-19 16:47:43 -05:00
parent 0ce1f50734
commit b607536435
5 changed files with 326 additions and 0 deletions

View file

@ -0,0 +1,87 @@
/*
* 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.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.TapSourceCost;
import mage.abilities.effects.common.PreventDamageTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.common.TargetCreatureOrPlayer;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author Martin Sagastume msr986@gmail.com
*/
public class AbunaAcolyte extends CardImpl<AbunaAcolyte> {
final static FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact creature");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(ComparisonScope.All);
}
public AbunaAcolyte(UUID ownerId) {
super(ownerId, 1, "Abuna Acolyte", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}");
this.expansionSetCode = "SOM";
this.subtype.add("Cat");
this.subtype.add("Cleric");
this.color.setWhite(true);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
Ability ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageTargetEffect(Duration.EndOfTurn, 1), new TapSourceCost());
ability1.addTarget(new TargetCreatureOrPlayer());
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageTargetEffect(Duration.EndOfTurn, 2), new TapSourceCost());
ability2.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability1);
this.addAbility(ability2);
}
public AbunaAcolyte(final AbunaAcolyte card) {
super(card);
}
@Override
public AbunaAcolyte copy() {
return new AbunaAcolyte(this);
}
}

View file

@ -0,0 +1,84 @@
/*
* 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.scarsofmirrodin;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.common.MetalcraftActivatedAbility;
import mage.abilities.costs.common.MetalcraftCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.ManaEffect;
import mage.abilities.mana.BlackManaAbility;
import mage.abilities.mana.BlueManaAbility;
import mage.abilities.mana.GreenManaAbility;
import mage.abilities.mana.RedManaAbility;
import mage.abilities.mana.WhiteManaAbility;
import mage.cards.CardImpl;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class MoxOpal extends CardImpl<MoxOpal> {
public MoxOpal(UUID ownerId) {
super(ownerId, 179, "Mox Opal", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT}, "{0}");
this.supertype.add("Legendary");
this.expansionSetCode = "SOM";
Ability ability1 = new WhiteManaAbility();
ability1.addCost(new MetalcraftCost());
this.addAbility(ability1);
Ability ability2 = new RedManaAbility();
ability2.addCost(new MetalcraftCost());
this.addAbility(ability2);
Ability ability3 = new BlueManaAbility();
ability3.addCost(new MetalcraftCost());
this.addAbility(ability3);
Ability ability4 = new BlackManaAbility();
ability4.addCost(new MetalcraftCost());
this.addAbility(ability4);
Ability ability5 = new GreenManaAbility();
ability5.addCost(new MetalcraftCost());
this.addAbility(ability5);
}
public MoxOpal(final MoxOpal card) {
super(card);
}
@Override
public MoxOpal copy() {
return new MoxOpal(this);
}
}

View file

@ -0,0 +1,74 @@
/*
* 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.common;
import mage.Constants.Zone;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.costs.Cost;
import mage.abilities.costs.Costs;
import mage.abilities.costs.common.MetalcraftCost;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.effects.Effect;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class MetalcraftActivatedAbility extends ActivatedAbilityImpl<MetalcraftActivatedAbility> {
public MetalcraftActivatedAbility(Zone zone, Effect effect, ManaCosts cost) {
super(zone, effect, cost);
this.costs.add(new MetalcraftCost());
}
public MetalcraftActivatedAbility(Zone zone, Effect effect, Costs costs) {
super(zone, effect, costs);
this.costs.add(new MetalcraftCost());
}
public MetalcraftActivatedAbility(Zone zone, Effect effect, Cost cost) {
super(zone, effect, cost);
this.costs.add(new MetalcraftCost());
}
public MetalcraftActivatedAbility(MetalcraftActivatedAbility ability) {
super(ability);
}
@Override
public MetalcraftActivatedAbility copy() {
return new MetalcraftActivatedAbility(this);
}
@Override
public String getRule() {
return "Metalcraft - " + super.getRule();
}
}

View file

@ -0,0 +1,73 @@
/*
* 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.costs.common;
import java.util.UUID;
import mage.Constants.CardType;
import mage.abilities.costs.CostImpl;
import mage.filter.FilterPermanent;
import mage.game.Game;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class MetalcraftCost extends CostImpl<MetalcraftCost> {
private static FilterPermanent filter = new FilterPermanent("artifact");
static {
filter.getCardType().add(CardType.ARTIFACT);
}
public MetalcraftCost() {
this.text = "Activate this ability only if you control three or more artifacts";
}
public MetalcraftCost(final MetalcraftCost cost) {
super(cost);
}
@Override
public MetalcraftCost copy() {
return new MetalcraftCost(this);
}
@Override
public boolean canPay(UUID sourceId, UUID controllerId, Game game) {
return game.getBattlefield().countAll(filter, controllerId) >= 3;
}
@Override
public boolean pay(Game game, UUID sourceId, UUID controllerId, boolean noMana) {
this.paid = true;
return paid;
}
}

View file

@ -89,4 +89,12 @@ public class PreventDamageTargetEffect extends PreventionEffectImpl<PreventDamag
return false;
}
@Override
public String getText(Ability source) {
StringBuilder sb = new StringBuilder();
sb.append("Prevent the next ").append(amount).append(" damage that would be dealt to target ");
sb.append(source.getTargets().get(0).getTargetName()).append(" ").append(duration.toString());
return sb.toString();
}
}