- Added support for Attaching to Players on Auras ETB Indirectly.

This commit is contained in:
Sol
2011-09-21 00:37:12 +00:00
parent 0f6fbfe728
commit ffe83b0af3

View File

@@ -775,14 +775,32 @@ public class AbilityFactory_Attach {
Target tgt = aura.getTarget(); Target tgt = aura.getTarget();
if (source.getController().isHuman()){ if (source.getController().isHuman()){
CardList list = AllZoneUtil.getCardsIn(tgt.getZone()); if (tgt.canTgtPlayer()){
list = list.getValidCards(tgt.getValidTgts(), aura.getActivatingPlayer(), source); ArrayList<Player> players = new ArrayList<Player>();
Object o = GuiUtils.getChoice(source + " - Select a card to attach to.", list.toArray()); // TODO Once Player's are gaining Protection we need to add a check here
if (o instanceof Card){
source.enchantEntity((Card)o); players.add(AllZone.getComputerPlayer());
return true; if (!tgt.canOnlyTgtOpponent()){
} players.add(AllZone.getHumanPlayer());
}
Object o = GuiUtils.getChoice(source + " - Select a player to attach to.", players.toArray());
if (o instanceof Player) {
source.enchantEntity((Player) o);
return true;
}
}
else{
CardList list = AllZoneUtil.getCardsIn(tgt.getZone());
list = list.getValidCards(tgt.getValidTgts(), aura.getActivatingPlayer(), source);
Object o = GuiUtils.getChoice(source + " - Select a card to attach to.", list.toArray());
if (o instanceof Card) {
source.enchantEntity((Card) o);
return true;
}
}
} }
else if (AbilityFactory_Attach.attachPreference(af, aura, af.getMapParams(), tgt, true)){ else if (AbilityFactory_Attach.attachPreference(af, aura, af.getMapParams(), tgt, true)){
@@ -791,9 +809,10 @@ public class AbilityFactory_Attach {
source.enchantEntity((Card)o); source.enchantEntity((Card)o);
return true; return true;
} }
else if (o instanceof Player) else if (o instanceof Player){
; // c.enchantPlayer((Player)o) source.enchantEntity((Player)o);
return true;
}
} }
return false; return false;