- Fixed a bug in ChooseCardEffect.

This commit is contained in:
Sloth
2013-11-15 09:37:08 +00:00
parent d4bc84c6bd
commit 8d79ed527f
2 changed files with 4 additions and 3 deletions

View File

@@ -3,7 +3,7 @@ ManaCost:4 B B
Types:Enchantment Aura Types:Enchantment Aura
K:Enchant creature or land K:Enchant creature or land
A:SP$ Attach | Cost$ 4 B B | ValidTgts$ Creature,Land | AILogic$ Curse A:SP$ Attach | Cost$ 4 B B | ValidTgts$ Creature,Land | AILogic$ Curse
S:Mode$ Continuous | Affected$ Card.AttachedBy | AddTrigger$ NettlevineTrig | AddSVar$ NettlevineRemember & NettlevineSac & NettlevineChoose & NettlevineAttach | Description$ Enchanted permanent has "At the beginning of your end step, sacrifice this permanent and attach CARDNAME to a creature or land you control." S:Mode$ Continuous | Affected$ Card.AttachedBy | AddTrigger$ NettlevineTrig | AddSVar$ NettlevineRemember & NettlevineSac & NettlevineChoose & NettlevineAttach & NettlevineCleanup | Description$ Enchanted permanent has "At the beginning of your end step, sacrifice this permanent and attach CARDNAME to a creature or land you control."
SVar:NettlevineTrig:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ NettlevineRemember | TriggerDescription$ At the beginning of your end step, sacrifice CARDNAME and attach the aura to a creature or land you control. SVar:NettlevineTrig:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ NettlevineRemember | TriggerDescription$ At the beginning of your end step, sacrifice CARDNAME and attach the aura to a creature or land you control.
SVar:NettlevineRemember:DB$ Pump | ImprintCards$ Valid Card.Enchanted | SubAbility$ NettlevineSac SVar:NettlevineRemember:DB$ Pump | ImprintCards$ Valid Card.Enchanted | SubAbility$ NettlevineSac
SVar:NettlevineSac:DB$ Sacrifice | Defined$ Self | SubAbility$ NettlevineChoose SVar:NettlevineSac:DB$ Sacrifice | Defined$ Self | SubAbility$ NettlevineChoose

View File

@@ -34,7 +34,8 @@ public class ChooseCardEffect extends SpellAbilityEffect {
@Override @Override
public void resolve(SpellAbility sa) { public void resolve(SpellAbility sa) {
final Card host = sa.getSourceCard(); final Card host = sa.getSourceCard();
final Game game = sa.getActivatingPlayer().getGame(); final Player activator = sa.getActivatingPlayer();
final Game game = activator.getGame();
final List<Card> chosen = new ArrayList<Card>(); final List<Card> chosen = new ArrayList<Card>();
final TargetRestrictions tgt = sa.getTargetRestrictions(); final TargetRestrictions tgt = sa.getTargetRestrictions();
@@ -46,7 +47,7 @@ public class ChooseCardEffect extends SpellAbilityEffect {
} }
List<Card> choices = game.getCardsIn(choiceZone); List<Card> choices = game.getCardsIn(choiceZone);
if (sa.hasParam("Choices")) { if (sa.hasParam("Choices")) {
choices = CardLists.getValidCards(choices, sa.getParam("Choices"), host.getController(), host); choices = CardLists.getValidCards(choices, sa.getParam("Choices"), activator, host);
} }
if (sa.hasParam("TargetControls")) { if (sa.hasParam("TargetControls")) {
choices = CardLists.filterControlledBy(choices, tgtPlayers.get(0)); choices = CardLists.filterControlledBy(choices, tgtPlayers.get(0));