- 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,6 +775,23 @@ public class AbilityFactory_Attach {
Target tgt = aura.getTarget();
if (source.getController().isHuman()){
if (tgt.canTgtPlayer()){
ArrayList<Player> players = new ArrayList<Player>();
// TODO Once Player's are gaining Protection we need to add a check here
players.add(AllZone.getComputerPlayer());
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);
@@ -784,6 +801,7 @@ public class AbilityFactory_Attach {
return true;
}
}
}
else if (AbilityFactory_Attach.attachPreference(af, aura, af.getMapParams(), tgt, true)){
Object o = aura.getTarget().getTargets().get(0);
@@ -791,9 +809,10 @@ public class AbilityFactory_Attach {
source.enchantEntity((Card)o);
return true;
}
else if (o instanceof Player)
; // c.enchantPlayer((Player)o)
else if (o instanceof Player){
source.enchantEntity((Player)o);
return true;
}
}
return false;