adding Architect Ramp deck + plus necessary cards (taking a break from coding drafts)

This commit is contained in:
BetaSteward 2011-01-06 23:19:24 -05:00
parent c67122b605
commit 499a6fb0df
17 changed files with 934 additions and 28 deletions

View file

@ -31,6 +31,6 @@ public class BeginningOfControllerUpkeepTriggeredAbility extends TriggeredAbilit
@Override
public String getRule() {
return "At the beginning of your upkeep, " + effects.getText(this);
return "At the beginning of your upkeep, " + effects.getText(this) + ".";
}
}

View file

@ -0,0 +1,100 @@
/*
* Copyright 2011 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.List;
import java.util.UUID;
import mage.Constants.Outcome;
import mage.abilities.costs.CostImpl;
import mage.abilities.costs.VariableCost;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledPermanent;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class TapVariableTargetCost extends CostImpl<TapVariableTargetCost> implements VariableCost {
protected int amountPaid = 0;
protected TargetControlledPermanent target;
public TapVariableTargetCost(TargetControlledPermanent target) {
this.target = target;
this.text = "tap X " + target.getTargetName() + " you control";
}
public TapVariableTargetCost(final TapVariableTargetCost cost) {
super(cost);
this.target = cost.target.copy();
this.amountPaid = cost.amountPaid;
}
@Override
public boolean canPay(UUID sourceId, UUID controllerId, Game game) {
return target.canChoose(controllerId, game);
}
@Override
public boolean pay(Game game, UUID sourceId, UUID controllerId, boolean noMana) {
amountPaid = 0;
while (true) {
target.clearChosen();
if (target.choose(Outcome.Tap, controllerId, game)) {
Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null && permanent.tap(game)) {
amountPaid++;
}
}
else {
break;
}
}
paid = true;
return true;
}
@Override
public void clearPaid() {
paid = false;
amountPaid = 0;
}
@Override
public int getAmount() {
return amountPaid;
}
@Override
public TapVariableTargetCost copy() {
return new TapVariableTargetCost(this);
}
}

View file

@ -58,7 +58,7 @@ public class BoostPowerXSourceEffect extends ContinuousEffectImpl<BoostPowerXSou
@Override
public boolean apply(Game game, Ability source) {
int amount = source.getManaCosts().getVariableCosts().get(0).getAmount();
int amount = source.getCosts().getVariableCosts().get(0).getAmount();
Permanent target = (Permanent) game.getPermanent(source.getSourceId());
if (target != null) {
target.addPower(amount);

View file

@ -56,7 +56,7 @@ public class DamageXTargetEffect extends OneShotEffect<DamageXTargetEffect> {
@Override
public boolean apply(Game game, Ability source) {
int amount = source.getManaCosts().getVariableCosts().get(0).getAmount();
int amount = source.getCosts().getVariableCosts().get(0).getAmount();
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
permanent.damage(amount, source.getId(), game, true, false);

View file

@ -0,0 +1,73 @@
/*
* Copyright 2011 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.game.Game;
import mage.players.Player;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class DrawDiscardControllerEffect extends OneShotEffect<DrawDiscardControllerEffect> {
public DrawDiscardControllerEffect() {
super(Outcome.DrawCard);
}
public DrawDiscardControllerEffect(final DrawDiscardControllerEffect effect) {
super(effect);
}
@Override
public DrawDiscardControllerEffect copy() {
return new DrawDiscardControllerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
player.drawCards(1, game);
player.discard(1, source, game);
return true;
}
return false;
}
@Override
public String getText(Ability source) {
return "Draw a card, then discard a card";
}
}

View file

@ -191,11 +191,15 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
@Override
public Player getPlayer(UUID playerId) {
if (playerId == null)
return null;
return state.getPlayer(playerId);
}
@Override
public MageObject getObject(UUID objectId) {
if (objectId == null)
return null;
MageObject object;
if (state.getBattlefield().containsPermanent(objectId)) {
object = state.getBattlefield().getPermanent(objectId);
@ -217,16 +221,22 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
@Override
public Permanent getPermanent(UUID permanentId) {
if (permanentId == null)
return null;
return state.getPermanent(permanentId);
}
@Override
public Card getCard(UUID cardId) {
if (cardId == null)
return null;
return gameCards.get(cardId);
}
@Override
public Zone getZone(UUID objectId) {
if (objectId == null)
return null;
return state.getZone(objectId);
}

View file

@ -318,6 +318,17 @@ public class Combat implements Serializable, Copyable<Combat> {
return false;
}
public UUID getDefendingPlayer(UUID attackerId) {
UUID defenderId = null;
for (CombatGroup group: groups) {
if (group.getAttackers().contains(attackerId)) {
defenderId = group.getDefenderId();
break;
}
}
return defenderId;
}
private Set<UUID> getPlayerDefenders(Game game) {
Set<UUID> playerDefenders = new HashSet<UUID>();
for (CombatGroup group: groups) {