CardScript for Call to the Void and changes to ChooseCardEffect

- Created CardScript for call to the void.
- Added "ControlAndNot" parameter to ChooseCardEffect as suggested by @northmoc on discord (https://discord.com/channels/267367946135928833/994588726254633090/994610830815539370)
- Added and implemented "SecretlyChoose".
- Added RevealTitle.
This commit is contained in:
Xavier
2022-07-10 01:55:52 -04:00
parent 901a7bd670
commit be885d8656
2 changed files with 22 additions and 8 deletions

View File

@@ -187,6 +187,18 @@ public class ChooseCardEffect extends SpellAbilityEffect {
chosenPool.add(choice);
}
chosen.addAll(chosenPool);
} else if (sa.hasParam("ControlAndNot")) {
String title = sa.hasParam("ChoiceTitle") ? sa.getParam("ChoiceTitle") : Localizer.getInstance().getMessage("lblChooseCreature");
// Targeted player (p) chooses N creatures that belongs to them
CardCollection tgtPlayerCtrl = CardLists.filterControlledBy(choices, p);
chosen.addAll(p.getController().chooseCardsForEffect(tgtPlayerCtrl, sa, title + " " + "you control", minAmount, validAmount,
!sa.hasParam("Mandatory"), null));
// Targeted player (p) chooses N creatures that don't belong to them
CardCollection notTgtPlayerCtrl = new CardCollection(choices);
notTgtPlayerCtrl.removeAll(tgtPlayerCtrl);
chosen.addAll(p.getController().chooseCardsForEffect(notTgtPlayerCtrl, sa, title + " " + "you don't control", minAmount, validAmount,
!sa.hasParam("Mandatory"), null));
} else if ((tgt == null) || p.canBeTargetedBy(sa)) {
if (sa.hasParam("AtRandom") && !choices.isEmpty()) {
Aggregates.random(choices, validAmount, chosen);
@@ -217,8 +229,13 @@ public class ChooseCardEffect extends SpellAbilityEffect {
}
}
}
if (sa.hasParam("Reveal")) {
game.getAction().reveal(chosen, p, true, Localizer.getInstance().getMessage("lblChosenCards") + " ");
if (sa.hasParam("Reveal") && !sa.hasParam("SecretlyChoose")) {
game.getAction().reveal(chosen, p, true, sa.hasParam("RevealTitle") ? sa.getParam("RevealTitle") : Localizer.getInstance().getMessage("lblChosenCards") + " ");
}
}
if(sa.hasParam("Reveal") && sa.hasParam("SecretlyChoose")) {
for (final Player p : tgtPlayers) {
game.getAction().reveal(chosen, p, true, sa.hasParam("RevealTitle") ? sa.getParam("RevealTitle") : Localizer.getInstance().getMessage("lblChosenCards") + " ");
}
}
host.setChosenCards(chosen);

View File

@@ -1,9 +1,6 @@
Name:Call to the Void
ManaCost:4 B
Types:Sorcery
A:SP$ RepeatEach | Cost$ 4 B | RepeatPlayers$ Player | RepeatSubAbility$ DBChooseCreatureYouCtrl | SubAbility$ DBRevealChosenToAll
SVar:DBChooseCreatureYouCtrl:DB$ ChooseCard | Defined$ Remembered | Amount$ 1 | Choices$ Creature.RememberedPlayerCtrl | ChoiceTitle$ Secretly choose a creature you control | SubAbility$ DBChooseCreatureYouDontCtrl | RememberChosen$ True | Mandatory$ True
SVar:DBChooseCreatureYouDontCtrl:DB$ ChooseCard | Defined$ Remembered | Amount$ 1 | Choices$ Creature.nonRememberedPlayerCtrl | ChoiceTitle$ Secretly choose a creature you don't control | RememberChosen$ True | Mandatory$ True
SVar:DBRevealChosenToAll:DB$ Reveal | Defined$ CardOwner | RevealDefined$ RememberedCard | RevealToAll$ True | RevealTitle$ OVERRIDE Creatures chosen. They will be destroyed. | Description$ Test | SubAbility$ DBDestroyChosen
A:SP$ ChooseCard | Defined$ Player | Choices$ Creature | SecretlyChoose$ True | Amount$ 1 | ControlAndNot$ True | ChoiceTitle$ Secretly choose a creature | Reveal$ True | RevealTitle$ OVERRIDE Chosen creatures. They will be destroyed. | SubAbility$ DBDestroyChosen | RememberChosen$ True | Mandatory$ True
SVar:DBDestroyChosen:DB$ DestroyAll | ValidCards$ Creature.IsRemembered | SubAbility$ DBCleanUp
SVar:DBCleanUp:DB$ Cleanup | ClearRemembered$ True