* Draft - Fixed that first draft direction is shown as left, second as right and third again to left.

This commit is contained in:
LevelX2 2014-11-19 15:12:17 +01:00
parent 04648eb0eb
commit 2e68f6c692
2 changed files with 17 additions and 17 deletions

View file

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

View file

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