mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Added multitarget arrows (Fireball).
This commit is contained in:
parent
b0e4549959
commit
875614b96c
3 changed files with 39 additions and 30 deletions
|
@ -365,8 +365,9 @@ public class Card extends javax.swing.JPanel implements MouseMotionListener, Mou
|
||||||
popupShowing = true;
|
popupShowing = true;
|
||||||
|
|
||||||
// Draw Arrows for targets
|
// Draw Arrows for targets
|
||||||
UUID uuid = card.getFirstTarget();
|
List<UUID> targets = card.getTargets();
|
||||||
if (uuid != null) {
|
if (targets != null) {
|
||||||
|
for (UUID uuid : targets) {
|
||||||
System.out.println("Getting play area panel for uuid: " + uuid);
|
System.out.println("Getting play area panel for uuid: " + uuid);
|
||||||
|
|
||||||
PlayAreaPanel p = session.getGame().getPlayers().get(uuid);
|
PlayAreaPanel p = session.getGame().getPlayers().get(uuid);
|
||||||
|
@ -387,6 +388,7 @@ public class Card extends javax.swing.JPanel implements MouseMotionListener, Mou
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mouseExited(MouseEvent arg0) {
|
public void mouseExited(MouseEvent arg0) {
|
||||||
|
|
|
@ -36,13 +36,13 @@ import java.util.UUID;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.Constants.CardType;
|
import mage.Constants.CardType;
|
||||||
import mage.Constants.Rarity;
|
import mage.Constants.Rarity;
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.game.permanent.PermanentToken;
|
import mage.game.permanent.PermanentToken;
|
||||||
import mage.game.permanent.token.Token;
|
import mage.game.permanent.token.Token;
|
||||||
import mage.game.stack.Spell;
|
import mage.game.stack.Spell;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
|
import mage.target.Targets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -65,7 +65,7 @@ public class CardView implements Serializable {
|
||||||
protected Rarity rarity;
|
protected Rarity rarity;
|
||||||
protected String expansionSetCode;
|
protected String expansionSetCode;
|
||||||
|
|
||||||
public UUID firstTarget; //TODO: there may be several targets
|
public List<UUID> targets;
|
||||||
|
|
||||||
public CardView(Card card) {
|
public CardView(Card card) {
|
||||||
this.id = card.getId();
|
this.id = card.getId();
|
||||||
|
@ -99,10 +99,15 @@ public class CardView implements Serializable {
|
||||||
if (card instanceof Spell) {
|
if (card instanceof Spell) {
|
||||||
Spell<?> spell = (Spell<?>)card;
|
Spell<?> spell = (Spell<?>)card;
|
||||||
if (spell.getSpellAbility().getTargets().size() > 0) {
|
if (spell.getSpellAbility().getTargets().size() > 0) {
|
||||||
Target target = spell.getSpellAbility().getTargets().get(0);
|
Targets targets = spell.getSpellAbility().getTargets();
|
||||||
|
for (Target target : targets) {
|
||||||
if (target.isChosen()) {
|
if (target.isChosen()) {
|
||||||
firstTarget = target.getFirstTarget();
|
for (UUID targetUUID : target.getTargets()) {
|
||||||
System.out.println("First target: " + firstTarget);
|
if (this.targets == null) this.targets = new ArrayList<UUID>();
|
||||||
|
this.targets.add(targetUUID);
|
||||||
|
System.out.println("Added target: " + targetUUID);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -199,7 +204,12 @@ public class CardView implements Serializable {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID getFirstTarget() {
|
/**
|
||||||
return firstTarget;
|
* Returns UUIDs for targets.
|
||||||
|
* Can be null if there is no target selected.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<UUID> getTargets() {
|
||||||
|
return targets;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,9 +6,6 @@
|
||||||
# nickname - Player's name you connect to the game with
|
# nickname - Player's name you connect to the game with
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
hand:player:mage.sets.magic2010.LightningBolt:1
|
hand:player:Fireball:2
|
||||||
hand:player:mage.sets.magic2011.Fireball:2
|
battlefield:player:Mountain:6
|
||||||
battlefield:player:mage.sets.magic2011.BrindleBoar:2
|
battlefield:computer:Brindle Boar:2
|
||||||
graveyard:player:mage.sets.magic2011.BrindleBoar:1
|
|
||||||
hand:player:mage.sets.magic2011.DoomBlade:1
|
|
||||||
battlefield:player:mage.cards.basiclands.Swamp:2
|
|
||||||
|
|
Loading…
Reference in a new issue