mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Added 5 older cards.
This commit is contained in:
parent
83c2882613
commit
c239cefc7a
7 changed files with 633 additions and 8 deletions
114
Mage.Sets/src/mage/sets/planarchaos/BrainGorgers.java
Normal file
114
Mage.Sets/src/mage/sets/planarchaos/BrainGorgers.java
Normal file
|
@ -0,0 +1,114 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.planarchaos;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CastSourceTriggeredAbility;
|
||||
import mage.abilities.keyword.MadnessAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class BrainGorgers extends CardImpl {
|
||||
|
||||
public BrainGorgers(UUID ownerId) {
|
||||
super(ownerId, 65, "Brain Gorgers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}");
|
||||
this.expansionSetCode = "PLC";
|
||||
this.subtype.add("Zombie");
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// When you cast Brain Gorgers, any player may sacrifice a creature. If a player does, counter Brain Gorgers.
|
||||
this.addAbility(new CastSourceTriggeredAbility(new BrainGorgersCounterSourceEffect()));
|
||||
|
||||
// Madness {1}{B}
|
||||
this.addAbility(new MadnessAbility(this, new ManaCostsImpl<>("{1}{B}")));
|
||||
}
|
||||
|
||||
public BrainGorgers(final BrainGorgers card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BrainGorgers copy() {
|
||||
return new BrainGorgers(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BrainGorgersCounterSourceEffect extends OneShotEffect {
|
||||
|
||||
public BrainGorgersCounterSourceEffect() {
|
||||
super(Outcome.AIDontUseIt);
|
||||
staticText = "any player may sacrifice a creature. If a player does, counter {source}";
|
||||
}
|
||||
|
||||
public BrainGorgersCounterSourceEffect(final BrainGorgersCounterSourceEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BrainGorgersCounterSourceEffect copy() {
|
||||
return new BrainGorgersCounterSourceEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Spell spell = game.getStack().getSpell(source.getSourceId());
|
||||
if (spell != null) {
|
||||
SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent());
|
||||
for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) {
|
||||
cost.clearPaid();
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (cost.canPay(source, source.getSourceId(), player.getId(), game)
|
||||
&& player.chooseUse(outcome, "Sacrifice a creature to counter " + spell.getIdName() + "?", source, game)) {
|
||||
if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) {
|
||||
game.informPlayers(player.getLogName() + " sacrifices a creature to counter " + spell.getIdName() + ".");
|
||||
game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
110
Mage.Sets/src/mage/sets/planarchaos/DashHopes.java
Normal file
110
Mage.Sets/src/mage/sets/planarchaos/DashHopes.java
Normal file
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.planarchaos;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.common.PayLifeCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CastSourceTriggeredAbility;
|
||||
import mage.abilities.effects.common.CounterTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetSpell;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class DashHopes extends CardImpl {
|
||||
|
||||
public DashHopes(UUID ownerId) {
|
||||
super(ownerId, 68, "Dash Hopes", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}{B}");
|
||||
this.expansionSetCode = "PLC";
|
||||
|
||||
// When you cast Dash Hopes, any player may pay 5 life. If a player does, counter Dash Hopes.
|
||||
this.addAbility(new CastSourceTriggeredAbility(new DashHopesCounterSourceEffect()));
|
||||
|
||||
// Counter target spell.
|
||||
this.getSpellAbility().addEffect(new CounterTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetSpell());
|
||||
}
|
||||
|
||||
public DashHopes(final DashHopes card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DashHopes copy() {
|
||||
return new DashHopes(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DashHopesCounterSourceEffect extends OneShotEffect {
|
||||
|
||||
public DashHopesCounterSourceEffect() {
|
||||
super(Outcome.AIDontUseIt);
|
||||
staticText = "any player may pay 5 life. If a player does, counter {source}";
|
||||
}
|
||||
|
||||
public DashHopesCounterSourceEffect(final DashHopesCounterSourceEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DashHopesCounterSourceEffect copy() {
|
||||
return new DashHopesCounterSourceEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Spell spell = game.getStack().getSpell(source.getSourceId());
|
||||
if (spell != null) {
|
||||
PayLifeCost cost = new PayLifeCost(5);
|
||||
for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
cost.clearPaid();
|
||||
if (cost.canPay(source, source.getSourceId(), player.getId(), game)
|
||||
&& player.chooseUse(outcome, "Pay 5 life to counter " + spell.getIdName() + "?", source, game)) {
|
||||
if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) {
|
||||
game.informPlayers(player.getLogName() + " pays 5 life to counter " + spell.getIdName() + ".");
|
||||
game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -95,19 +95,22 @@ class CounterSourceEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
|
||||
|
||||
StackObject spell = null;
|
||||
for(StackObject objet : game.getStack()){
|
||||
if(objet instanceof Spell && objet.getSourceId().equals(source.getSourceId())){
|
||||
for (StackObject objet : game.getStack()) {
|
||||
if (objet instanceof Spell && objet.getSourceId().equals(source.getSourceId())) {
|
||||
spell = objet;
|
||||
}
|
||||
}
|
||||
if(spell != null){
|
||||
for(UUID uuid : game.getPlayerList()){
|
||||
if (spell != null) {
|
||||
DiscardTargetCost cost = new DiscardTargetCost(new TargetCardInHand(3, 3, new FilterCard()));
|
||||
for (UUID uuid : game.getPlayerList()) {
|
||||
Player player = game.getPlayer(uuid);
|
||||
if(player.chooseUse(Outcome.Detriment, "Discard three cards to counter " + spell.getName() + "?", source, game)){
|
||||
DiscardTargetCost cost = new DiscardTargetCost(new TargetCardInHand(3, 3, new FilterCard()));
|
||||
if(cost.pay(source, game, source.getSourceId(), uuid, false)){
|
||||
cost.clearPaid();
|
||||
if (cost.canPay(source, source.getSourceId(), player.getId(), game)
|
||||
&& player.chooseUse(Outcome.Detriment, "Discard three cards to counter " + spell.getName() + "?", source, game)) {
|
||||
|
||||
if (cost.pay(source, game, source.getSourceId(), uuid, false)) {
|
||||
game.informPlayers(player.getLogName() + " discards 3 cards to counter " + spell.getName() + ".");
|
||||
game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
return true;
|
||||
|
|
104
Mage.Sets/src/mage/sets/planarchaos/TemporalExtortion.java
Normal file
104
Mage.Sets/src/mage/sets/planarchaos/TemporalExtortion.java
Normal file
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.planarchaos;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CastSourceTriggeredAbility;
|
||||
import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class TemporalExtortion extends CardImpl {
|
||||
|
||||
public TemporalExtortion(UUID ownerId) {
|
||||
super(ownerId, 81, "Temporal Extortion", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{B}{B}{B}{B}");
|
||||
this.expansionSetCode = "PLC";
|
||||
|
||||
// When you cast Temporal Extortion, any player may pay half his or her life, rounded up. If a player does, counter Temporal Extortion.
|
||||
this.addAbility(new CastSourceTriggeredAbility(new TemporalExtortionCounterSourceEffect()));
|
||||
|
||||
// Take an extra turn after this one.
|
||||
this.getSpellAbility().addEffect(new AddExtraTurnControllerEffect());
|
||||
}
|
||||
|
||||
public TemporalExtortion(final TemporalExtortion card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TemporalExtortion copy() {
|
||||
return new TemporalExtortion(this);
|
||||
}
|
||||
}
|
||||
|
||||
class TemporalExtortionCounterSourceEffect extends OneShotEffect {
|
||||
|
||||
public TemporalExtortionCounterSourceEffect() {
|
||||
super(Outcome.AIDontUseIt);
|
||||
staticText = "any player may pay half his or her life, rounded up. If a player does, counter {source}";
|
||||
}
|
||||
|
||||
public TemporalExtortionCounterSourceEffect(final TemporalExtortionCounterSourceEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TemporalExtortionCounterSourceEffect copy() {
|
||||
return new TemporalExtortionCounterSourceEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Spell spell = game.getStack().getSpell(source.getSourceId());
|
||||
if (spell != null) {
|
||||
for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player.chooseUse(outcome, "Pay half your life, rounded up to counter " + spell.getIdName() + "?", source, game)) {
|
||||
Integer amount = (int) Math.ceil(player.getLife() / 2f);
|
||||
player.loseLife(amount, game);
|
||||
game.informPlayers(player.getLogName() + " pays half his or her life, rounded up to counter " + spell.getIdName() + ".");
|
||||
game.getStack().counter(spell.getId(), source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
122
Mage.Sets/src/mage/sets/prophecy/AvatarOfMight.java
Normal file
122
Mage.Sets/src/mage/sets/prophecy/AvatarOfMight.java
Normal file
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
* 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.prophecy;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.CostModificationType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class AvatarOfMight extends CardImpl {
|
||||
|
||||
public AvatarOfMight(UUID ownerId) {
|
||||
super(ownerId, 109, "Avatar of Might", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{G}{G}");
|
||||
this.expansionSetCode = "PCY";
|
||||
this.subtype.add("Avatar");
|
||||
this.power = new MageInt(8);
|
||||
this.toughness = new MageInt(8);
|
||||
|
||||
// If an opponent controls at least four more creatures than you, Avatar of Might costs {6} less to cast.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.STACK, new AvatarOfMightCostReductionEffect()));
|
||||
|
||||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
}
|
||||
|
||||
public AvatarOfMight(final AvatarOfMight card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AvatarOfMight copy() {
|
||||
return new AvatarOfMight(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AvatarOfMightCostReductionEffect extends CostModificationEffectImpl {
|
||||
|
||||
AvatarOfMightCostReductionEffect() {
|
||||
super(Duration.Custom, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||
staticText = "If an opponent controls at least four more creatures than you, {this} will costs {6} less to cast";
|
||||
}
|
||||
|
||||
AvatarOfMightCostReductionEffect(final AvatarOfMightCostReductionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
SpellAbility spellAbility = (SpellAbility) abilityToModify;
|
||||
Mana mana = spellAbility.getManaCostsToPay().getMana();
|
||||
if (mana.getColorless() > 0) {
|
||||
int newCount = mana.getColorless() - 6;
|
||||
if (newCount < 0) {
|
||||
newCount = 0;
|
||||
}
|
||||
mana.setColorless(newCount);
|
||||
spellAbility.getManaCostsToPay().load(mana.toString());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
int creatures = game.getBattlefield().countAll(new FilterCreaturePermanent(), source.getControllerId(), game);
|
||||
for (UUID playerId : game.getOpponents(source.getControllerId())) {
|
||||
Player opponent = game.getPlayer(playerId);
|
||||
if (opponent != null && game.getBattlefield().countAll(new FilterCreaturePermanent(), opponent.getId(), game) >= creatures + 4) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AvatarOfMightCostReductionEffect copy() {
|
||||
return new AvatarOfMightCostReductionEffect(this);
|
||||
}
|
||||
}
|
120
Mage.Sets/src/mage/sets/prophecy/AvatarOfWill.java
Normal file
120
Mage.Sets/src/mage/sets/prophecy/AvatarOfWill.java
Normal file
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
* 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.prophecy;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.CostModificationType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class AvatarOfWill extends CardImpl {
|
||||
|
||||
public AvatarOfWill(UUID ownerId) {
|
||||
super(ownerId, 30, "Avatar of Will", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{U}{U}");
|
||||
this.expansionSetCode = "PCY";
|
||||
this.subtype.add("Avatar");
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
// If an opponent has no cards in hand, Avatar of Will costs {6} less to cast.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.STACK, new AvatarOfWillCostReductionEffect()));
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
}
|
||||
|
||||
public AvatarOfWill(final AvatarOfWill card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AvatarOfWill copy() {
|
||||
return new AvatarOfWill(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AvatarOfWillCostReductionEffect extends CostModificationEffectImpl {
|
||||
|
||||
AvatarOfWillCostReductionEffect() {
|
||||
super(Duration.Custom, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||
staticText = "If an opponent has no cards in hand, {this} will costs {6} less to cast";
|
||||
}
|
||||
|
||||
AvatarOfWillCostReductionEffect(final AvatarOfWillCostReductionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
SpellAbility spellAbility = (SpellAbility) abilityToModify;
|
||||
Mana mana = spellAbility.getManaCostsToPay().getMana();
|
||||
if (mana.getColorless() > 0) {
|
||||
int newCount = mana.getColorless() - 6;
|
||||
if (newCount < 0) {
|
||||
newCount = 0;
|
||||
}
|
||||
mana.setColorless(newCount);
|
||||
spellAbility.getManaCostsToPay().load(mana.toString());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
for (UUID playerId : game.getOpponents(source.getControllerId())) {
|
||||
Player opponent = game.getPlayer(playerId);
|
||||
if (opponent != null && opponent.getHand().isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AvatarOfWillCostReductionEffect copy() {
|
||||
return new AvatarOfWillCostReductionEffect(this);
|
||||
}
|
||||
}
|
52
Mage.Sets/src/mage/sets/tenthedition/AvatarOfMight.java
Normal file
52
Mage.Sets/src/mage/sets/tenthedition/AvatarOfMight.java
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.tenthedition;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class AvatarOfMight extends mage.sets.prophecy.AvatarOfMight {
|
||||
|
||||
public AvatarOfMight(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 251;
|
||||
this.expansionSetCode = "10E";
|
||||
}
|
||||
|
||||
public AvatarOfMight(final AvatarOfMight card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AvatarOfMight copy() {
|
||||
return new AvatarOfMight(this);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue