mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
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:
@@ -187,6 +187,18 @@ public class ChooseCardEffect extends SpellAbilityEffect {
|
|||||||
chosenPool.add(choice);
|
chosenPool.add(choice);
|
||||||
}
|
}
|
||||||
chosen.addAll(chosenPool);
|
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)) {
|
} else if ((tgt == null) || p.canBeTargetedBy(sa)) {
|
||||||
if (sa.hasParam("AtRandom") && !choices.isEmpty()) {
|
if (sa.hasParam("AtRandom") && !choices.isEmpty()) {
|
||||||
Aggregates.random(choices, validAmount, chosen);
|
Aggregates.random(choices, validAmount, chosen);
|
||||||
@@ -217,8 +229,13 @@ public class ChooseCardEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sa.hasParam("Reveal")) {
|
if (sa.hasParam("Reveal") && !sa.hasParam("SecretlyChoose")) {
|
||||||
game.getAction().reveal(chosen, p, true, Localizer.getInstance().getMessage("lblChosenCards") + " ");
|
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);
|
host.setChosenCards(chosen);
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
Name:Call to the Void
|
Name:Call to the Void
|
||||||
ManaCost:4 B
|
ManaCost:4 B
|
||||||
Types:Sorcery
|
Types:Sorcery
|
||||||
A:SP$ RepeatEach | Cost$ 4 B | RepeatPlayers$ Player | RepeatSubAbility$ DBChooseCreatureYouCtrl | SubAbility$ DBRevealChosenToAll
|
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: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
|
|
||||||
SVar:DBDestroyChosen:DB$ DestroyAll | ValidCards$ Creature.IsRemembered | SubAbility$ DBCleanUp
|
SVar:DBDestroyChosen:DB$ DestroyAll | ValidCards$ Creature.IsRemembered | SubAbility$ DBCleanUp
|
||||||
SVar:DBCleanUp:DB$ Cleanup | ClearRemembered$ True
|
SVar:DBCleanUp:DB$ Cleanup | ClearRemembered$ True
|
||||||
|
|||||||
Reference in New Issue
Block a user