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,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;
|
||||||
|
|||||||
Reference in New Issue
Block a user