mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
Merge branch 'counterPutChooser' into 'master'
CounterPutEffect: add Choicer Param See merge request core-developers/forge!2709
This commit is contained in:
@@ -148,21 +148,30 @@ public class CountersPutEffect extends SpellAbilityEffect {
|
|||||||
if (sa.hasParam("Bolster")) {
|
if (sa.hasParam("Bolster")) {
|
||||||
CardCollection creatsYouCtrl = CardLists.filter(activator.getCardsIn(ZoneType.Battlefield), Presets.CREATURES);
|
CardCollection creatsYouCtrl = CardLists.filter(activator.getCardsIn(ZoneType.Battlefield), Presets.CREATURES);
|
||||||
CardCollection leastToughness = new CardCollection(Aggregates.listWithMin(creatsYouCtrl, CardPredicates.Accessors.fnGetDefense));
|
CardCollection leastToughness = new CardCollection(Aggregates.listWithMin(creatsYouCtrl, CardPredicates.Accessors.fnGetDefense));
|
||||||
tgtCards.addAll(pc.chooseCardsForEffect(leastToughness, sa, Localizer.getInstance().getMessage("lblChooseACreatureWithLeastToughness"), 1, 1, false));
|
tgtCards.addAll(activator.getController().chooseCardsForEffect(leastToughness, sa, Localizer.getInstance().getMessage("lblChooseACreatureWithLeastToughness"), 1, 1, false));
|
||||||
tgtObjects.addAll(tgtCards);
|
tgtObjects.addAll(tgtCards);
|
||||||
} else if (sa.hasParam("Choices")) {
|
} else if (sa.hasParam("Choices")) {
|
||||||
ZoneType choiceZone = ZoneType.Battlefield;
|
ZoneType choiceZone = ZoneType.Battlefield;
|
||||||
if (sa.hasParam("ChoiceZone")) {
|
if (sa.hasParam("ChoiceZone")) {
|
||||||
choiceZone = ZoneType.smartValueOf(sa.getParam("ChoiceZone"));
|
choiceZone = ZoneType.smartValueOf(sa.getParam("ChoiceZone"));
|
||||||
}
|
}
|
||||||
|
Player chooser = activator;
|
||||||
|
if (sa.hasParam("Chooser")) {
|
||||||
|
List<Player> choosers = AbilityUtils.getDefinedPlayers(sa.getHostCard(), sa.getParam("Chooser"), sa);
|
||||||
|
if (choosers.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
chooser = choosers.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
CardCollection choices = new CardCollection(game.getCardsIn(choiceZone));
|
CardCollection choices = new CardCollection(game.getCardsIn(choiceZone));
|
||||||
|
|
||||||
int n = sa.hasParam("ChoiceAmount") ? Integer.parseInt(sa.getParam("ChoiceAmount")) : 1;
|
int n = sa.hasParam("ChoiceAmount") ? Integer.parseInt(sa.getParam("ChoiceAmount")) : 1;
|
||||||
|
|
||||||
choices = CardLists.getValidCards(choices, sa.getParam("Choices"), activator, card);
|
choices = CardLists.getValidCards(choices, sa.getParam("Choices"), activator, card, sa);
|
||||||
|
|
||||||
String title = sa.hasParam("ChoiceTitle") ? sa.getParam("ChoiceTitle") : Localizer.getInstance().getMessage("lblChooseaCard") + " ";
|
String title = sa.hasParam("ChoiceTitle") ? sa.getParam("ChoiceTitle") : Localizer.getInstance().getMessage("lblChooseaCard") + " ";
|
||||||
tgtObjects.addAll(new CardCollection(pc.chooseCardsForEffect(choices, sa, title, n, n, !sa.hasParam("ChoiceOptional"))));
|
tgtObjects.addAll(new CardCollection(chooser.getController().chooseCardsForEffect(choices, sa, title, n, n, sa.hasParam("ChoiceOptional"))));
|
||||||
} else {
|
} else {
|
||||||
tgtObjects.addAll(getDefinedOrTargeted(sa, "Defined"));
|
tgtObjects.addAll(getDefinedOrTargeted(sa, "Defined"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6350,10 +6350,13 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
|
|
||||||
public final void addGoad(Long timestamp, final Player p) {
|
public final void addGoad(Long timestamp, final Player p) {
|
||||||
goad.put(timestamp, p);
|
goad.put(timestamp, p);
|
||||||
|
updateAbilityTextForView();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void removeGoad(Long timestamp) {
|
public final void removeGoad(Long timestamp) {
|
||||||
goad.remove(timestamp);
|
if (goad.remove(timestamp) != null) {
|
||||||
|
updateAbilityTextForView();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean isGoaded() {
|
public final boolean isGoaded() {
|
||||||
|
|||||||
@@ -2,9 +2,8 @@ Name:Eye of Doom
|
|||||||
ManaCost:4
|
ManaCost:4
|
||||||
Types:Artifact
|
Types:Artifact
|
||||||
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigChoose | TriggerDescription$ When CARDNAME enters the battlefield, each player chooses a nonland permanent and puts a doom counter on it.
|
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigChoose | TriggerDescription$ When CARDNAME enters the battlefield, each player chooses a nonland permanent and puts a doom counter on it.
|
||||||
SVar:TrigChoose:DB$ RepeatEach | RepeatPlayers$ Player | RepeatSubAbility$ DBChoose
|
SVar:TrigChoose:DB$ RepeatEach | RepeatPlayers$ Player | RepeatSubAbility$ DBPutCounter
|
||||||
SVar:DBChoose:DB$ ChooseCard | Defined$ Player.IsRemembered | Choices$ Permanent.nonLand | AILogic$ OppPreferred | Mandatory$ True | SubAbility$ DBPutCounter
|
SVar:DBPutCounter:DB$ PutCounter | Chooser$ Remembered | Choices$ Permanent.nonLand | CounterType$ DOOM | CounterNum$ 1
|
||||||
SVar:DBPutCounter:DB$ PutCounter | Defined$ ChosenCard | CounterType$ DOOM | CounterNum$ 1
|
|
||||||
A:AB$ DestroyAll | Cost$ 2 T Sac<1/CARDNAME> | ValidCards$ Permanent.counters_GE1_DOOM | SpellDescription$ Destroy each permanent with a doom counter.
|
A:AB$ DestroyAll | Cost$ 2 T Sac<1/CARDNAME> | ValidCards$ Permanent.counters_GE1_DOOM | SpellDescription$ Destroy each permanent with a doom counter.
|
||||||
AI:RemoveDeck:All
|
AI:RemoveDeck:All
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/eye_of_doom.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/eye_of_doom.jpg
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ ManaCost:2 R
|
|||||||
Types:Creature Insect
|
Types:Creature Insect
|
||||||
PT:2/2
|
PT:2/2
|
||||||
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigRepeat | TriggerDescription$ At the beginning of your end step, each player may put two +1/+1 counters on a creature they control. Goad each creature that had counters put on it this way. (Until your next turn, those creatures attack each combat if able and attack a player other than you if able.)
|
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigRepeat | TriggerDescription$ At the beginning of your end step, each player may put two +1/+1 counters on a creature they control. Goad each creature that had counters put on it this way. (Until your next turn, those creatures attack each combat if able and attack a player other than you if able.)
|
||||||
SVar:TrigRepeat:DB$ RepeatEach | RepeatPlayers$ Player | RepeatSubAbility$ DBChoose | SubAbility$ DBGoad
|
SVar:TrigRepeat:DB$ RepeatEach | RepeatPlayers$ Player | RepeatSubAbility$ DBPutCounter | SubAbility$ DBGoad
|
||||||
SVar:DBChoose:DB$ ChooseCard | Defined$ Player.IsRemembered | Amount$ 1 | MinAmount$ 0 | Choices$ Creature.RememberedPlayerCtrl | SubAbility$ DBPutCounter
|
SVar:DBPutCounter:DB$ PutCounter | Chooser$ Remembered | Choices$ Creature.RememberedPlayerCtrl | ChoiceOptional$ True | CounterType$ P1P1 | CounterNum$ 2 | RememberCards$ True
|
||||||
SVar:DBPutCounter:DB$ PutCounter | Defined$ ChosenCard | CounterType$ P1P1 | CounterNum$ 2 | RememberCards$ True
|
|
||||||
SVar:DBGoad:DB$ Goad | Defined$ Remembered | SubAbility$ DBCleanup
|
SVar:DBGoad:DB$ Goad | Defined$ Remembered | SubAbility$ DBCleanup
|
||||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True | ClearChosenCard$ True
|
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||||
Oracle:At the beginning of your end step, each player may put two +1/+1 counters on a creature they control. Goad each creature that had counters put on it this way. (Until your next turn, those creatures attack each combat if able and attack a player other than you if able.)
|
Oracle:At the beginning of your end step, each player may put two +1/+1 counters on a creature they control. Goad each creature that had counters put on it this way. (Until your next turn, those creatures attack each combat if able and attack a player other than you if able.)
|
||||||
|
|||||||
Reference in New Issue
Block a user