- Adding AttachedToPlayer to ChangeZone Known Origin

This commit is contained in:
Sol
2016-03-29 14:20:46 +00:00
parent ac675f178e
commit e94caba4b0

View File

@@ -506,6 +506,25 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
} }
} }
if (sa.hasParam("AttachedToPlayer")) {
FCollectionView<Player> list = AbilityUtils.getDefinedPlayers(hostCard, sa.getParam("AttachedToPlayer"), sa);
if (!list.isEmpty()) {
Player attachedTo = player.getController().chooseSingleEntityForEffect(list, sa, tgtC + " - Select a player to attach to.");
if (tgtC.isAura()) {
if (tgtC.isEnchanting()) {
// If this Card is already Enchanting something, need
// to unenchant it, then clear out the commands
final GameEntity oldEnchanted = tgtC.getEnchanting();
tgtC.removeEnchanting(oldEnchanted);
}
tgtC.enchantEntity(attachedTo);
}
}
else { // When it should enter the battlefield attached to an illegal player it fails
continue;
}
}
// Auras without Candidates stay in their current // Auras without Candidates stay in their current
// location // location
if (tgtC.isAura()) { if (tgtC.isAura()) {
@@ -867,6 +886,15 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
c.setController(newController, game.getNextTimestamp()); c.setController(newController, game.getNextTimestamp());
} }
if (sa.hasParam("Transformed")) {
if (c.isDoubleFaced()) {
c.changeCardState("Transform", null);
} else {
// If it can't Transform, don't change zones.
continue;
}
}
if (sa.hasParam("AttachedTo")) { if (sa.hasParam("AttachedTo")) {
CardCollection list = AbilityUtils.getDefinedCards(source, sa.getParam("AttachedTo"), sa); CardCollection list = AbilityUtils.getDefinedCards(source, sa.getParam("AttachedTo"), sa);
if (list.isEmpty()) { if (list.isEmpty()) {