mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Added support for Attaching to Players on Auras ETB Indirectly.
This commit is contained in:
@@ -775,15 +775,33 @@ 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);
|
||||
|
||||
Object o = GuiUtils.getChoice(source + " - Select a card to attach to.", list.toArray());
|
||||
if (o instanceof Card){
|
||||
source.enchantEntity((Card)o);
|
||||
if (o instanceof Card) {
|
||||
source.enchantEntity((Card) o);
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user