Merge origin/master

This commit is contained in:
LevelX2 2014-11-20 07:38:54 +01:00
commit 6dd1cace26
5 changed files with 349 additions and 17 deletions

View file

@ -133,7 +133,7 @@ public class DraftPanel extends javax.swing.JPanel {
int left = draftView.getPlayers().size() - right;
int height = left * 18;
lblTableImage.setSize(new Dimension(lblTableImage.getWidth(), height));
Image tableImage = ImageHelper.getImageFromResources(draftView.getBoosterNum() == 2 ? "/draft/table_right.png":"/draft/table_left.png");
Image tableImage = ImageHelper.getImageFromResources(draftView.getBoosterNum() == 2 ? "/draft/table_left.png":"/draft/table_right.png");
BufferedImage resizedTable = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(tableImage, BufferedImage.TYPE_INT_ARGB), lblTableImage.getWidth());
lblTableImage.setIcon(new ImageIcon(resizedTable));
@ -150,11 +150,11 @@ public class DraftPanel extends javax.swing.JPanel {
int right = players / 2;
int left = players - right;
if (index <= left) {
// left side up (8 - 1)
tablePosition = (9 - index) - (8- left);
// left side down (1 - 8)
tablePosition = index;
} else {
// right side down (9-18)
tablePosition = 8 + (index - left);
// right side up (16 - 9)
tablePosition = 9 + right - (index - left);
}
switch(tablePosition) {
case 1:

View file

@ -36,6 +36,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.postresolve.ExileSpellEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
@ -100,30 +101,29 @@ class SpelltwineEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player you = game.getPlayer(source.getControllerId());
Player controller = game.getPlayer(source.getControllerId());
Card cardOne = game.getCard(source.getTargets().get(0).getFirstTarget());
Card cardTwo = game.getCard(source.getTargets().get(1).getFirstTarget());
if (you != null) {
if (controller != null) {
if (cardOne != null) {
cardOne.moveToExile(null, null, source.getSourceId(), game);
controller.moveCardToExileWithInfo(cardOne, null, "", source.getSourceId(), game, Zone.GRAVEYARD);
}
if (cardTwo != null) {
cardTwo.moveToExile(null, null, source.getSourceId(), game);
controller.moveCardToExileWithInfo(cardTwo, null, "", source.getSourceId(), game, Zone.GRAVEYARD);
}
boolean castCardOne = true;
if (cardOne != null && you.chooseUse(Outcome.Neutral, "Cast the copy of " + cardOne.getName() + " first?", game)) {
Card copyOne = game.copyCard(cardOne, source, you.getId());
you.cast(copyOne.getSpellAbility(), game, true);
if (cardOne != null && controller.chooseUse(Outcome.Neutral, "Cast the copy of " + cardOne.getName() + " first?", game)) {
Card copyOne = game.copyCard(cardOne, source, controller.getId());
controller.cast(copyOne.getSpellAbility(), game, true);
castCardOne = false;
}
if (cardTwo != null) {
Card copyTwo = game.copyCard(cardTwo, source, you.getId());
you.cast(copyTwo.getSpellAbility(), game, true);
Card copyTwo = game.copyCard(cardTwo, source, controller.getId());
controller.cast(copyTwo.getSpellAbility(), game, true);
}
if (cardOne != null && castCardOne) {
Card copyOne = game.copyCard(cardOne, source, you.getId());
you.cast(copyOne.getSpellAbility(), game, true);
Card copyOne = game.copyCard(cardOne, source, controller.getId());
controller.cast(copyOne.getSpellAbility(), game, true);
}
return true;
}

View file

@ -0,0 +1,80 @@
/*
* 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.shadowmoor;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.UntapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author jeffwadsworth
*/
public class SilkbindFaerie extends CardImpl {
public SilkbindFaerie(UUID ownerId) {
super(ownerId, 148, "Silkbind Faerie", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W/U}");
this.expansionSetCode = "SHM";
this.subtype.add("Faerie");
this.subtype.add("Rogue");
this.color.setWhite(true);
this.color.setBlue(true);
this.power = new MageInt(1);
this.toughness = new MageInt(3);
// Flying
this.addAbility(FlyingAbility.getInstance());
// {1}{WU}, {untap}: Tap target creature.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{1}{W/U}"));
ability.addCost(new UntapSourceCost());
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
public SilkbindFaerie(final SilkbindFaerie card) {
super(card);
}
@Override
public SilkbindFaerie copy() {
return new SilkbindFaerie(this);
}
}

View file

@ -0,0 +1,140 @@
/*
* 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.shadowmoor;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamageEvent;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.players.Player;
/**
*
* @author jeffwadsworth
*/
public class SwansOfBrynArgoll extends CardImpl {
public SwansOfBrynArgoll(UUID ownerId) {
super(ownerId, 151, "Swans of Bryn Argoll", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W/U}{W/U}");
this.expansionSetCode = "SHM";
this.subtype.add("Bird");
this.subtype.add("Spirit");
this.color.setBlue(true);
this.color.setWhite(true);
this.power = new MageInt(4);
this.toughness = new MageInt(3);
// Flying
this.addAbility(FlyingAbility.getInstance());
// If a source would deal damage to Swans of Bryn Argoll, prevent that damage. The source's controller draws cards equal to the damage prevented this way.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SwansOfBrynArgollEffect()));
}
public SwansOfBrynArgoll(final SwansOfBrynArgoll card) {
super(card);
}
@Override
public SwansOfBrynArgoll copy() {
return new SwansOfBrynArgoll(this);
}
}
class SwansOfBrynArgollEffect extends ReplacementEffectImpl {
SwansOfBrynArgollEffect() {
super(Duration.WhileOnBattlefield, Outcome.PreventDamage);
staticText = "If a source would deal damage to {this}, prevent that damage. The source's controller draws cards equal to the damage prevented this way";
}
SwansOfBrynArgollEffect(final SwansOfBrynArgollEffect effect) {
super(effect);
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Boolean passed = false;
DamageEvent damageEvent = (DamageEvent) event;
Card sourceOfDamage = game.getCard(event.getSourceId());
if (sourceOfDamage != null) {
Spell spell = game.getStack().getSpell(sourceOfDamage.getId());
Permanent permanent = game.getPermanentOrLKIBattlefield(sourceOfDamage.getId());
if (spell != null) {
Player controllerOfSpell = game.getPlayer(spell.getControllerId());
controllerOfSpell.drawCards(damageEvent.getAmount(), game);
passed = true;
}
if (permanent != null) {
Player controllerOfPermanent = game.getPlayer(permanent.getControllerId());
controllerOfPermanent.drawCards(damageEvent.getAmount(), game);
passed = true;
}
if (!passed) {
Player owner = game.getPlayer(sourceOfDamage.getOwnerId());
if (owner != null) {
owner.drawCards(damageEvent.getAmount(), game);
}
}
}
return true;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return event.getType() == EventType.DAMAGE_CREATURE
&& event.getTargetId().equals(source.getSourceId());
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public SwansOfBrynArgollEffect copy() {
return new SwansOfBrynArgollEffect(this);
}
}

View file

@ -0,0 +1,112 @@
/*
* 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.shadowmoor;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author jeffwadsworth
*/
public class ThoughtweftGambit extends CardImpl {
public ThoughtweftGambit(UUID ownerId) {
super(ownerId, 154, "Thoughtweft Gambit", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{4}{W/U}{W/U}");
this.expansionSetCode = "SHM";
this.color.setBlue(true);
this.color.setWhite(true);
// Tap all creatures your opponents control and untap all creatures you control.
this.getSpellAbility().addEffect(new ThoughtweftGambitEffect());
}
public ThoughtweftGambit(final ThoughtweftGambit card) {
super(card);
}
@Override
public ThoughtweftGambit copy() {
return new ThoughtweftGambit(this);
}
}
class ThoughtweftGambitEffect extends OneShotEffect {
private static FilterCreaturePermanent filter = new FilterCreaturePermanent();
public ThoughtweftGambitEffect() {
super(Outcome.Benefit);
staticText = "Tap all creatures your opponents control and untap all creatures you control";
}
public ThoughtweftGambitEffect(final ThoughtweftGambitEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Boolean passed = false;
Set<UUID> opponents = game.getOpponents(source.getControllerId());
Player controller = game.getPlayer(source.getControllerId());
if (opponents != null) {
for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) {
if (opponents.contains(creature.getControllerId())) {
creature.tap(game);
}
}
passed = true;
}
if (controller != null) {
for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) {
if (controller.getId() == creature.getControllerId()) {
creature.untap(game);
}
}
passed = true;
}
return passed;
}
@Override
public ThoughtweftGambitEffect copy() {
return new ThoughtweftGambitEffect(this);
}
}