mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- Adding AttachedToPlayer to ChangeZone Known Origin
This commit is contained in:
@@ -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
|
||||
// location
|
||||
if (tgtC.isAura()) {
|
||||
@@ -867,6 +886,15 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
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")) {
|
||||
CardCollection list = AbilityUtils.getDefinedCards(source, sa.getParam("AttachedTo"), sa);
|
||||
if (list.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user