add RepeatTargeted param to Effect and card

This commit is contained in:
Northmoc
2020-11-07 10:01:29 -05:00
parent 33463d8734
commit 2bd85c2c74
2 changed files with 14 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package forge.game.ability.effects;
import com.google.common.collect.Lists;
import forge.GameCommand;
import forge.game.Game;
import forge.game.GameObject;
import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect;
import forge.game.card.*;
@@ -114,6 +115,18 @@ public class RepeatEachEffect extends SpellAbilityEffect {
}
}
// for a mixed list of target permanents and players, e.g. Soulfire Eruption
if (sa.hasParam("RepeatTargeted")) {
final List <GameObject> tgts = getTargets(sa);
if (tgts != null) {
for (final Object o : tgts) {
source.addRemembered(o);
AbilityUtils.resolve(repeat);
source.removeRemembered(o);
}
}
}
if (sa.hasParam("RepeatPlayers")) {
final FCollection<Player> repeatPlayers = AbilityUtils.getDefinedPlayers(source, sa.getParam("RepeatPlayers"), sa);
if (sa.hasParam("ClearRememberedBeforeLoop")) {

View File

@@ -1,7 +1,7 @@
Name:Soulfire Eruption
ManaCost:6 R R R
Types:Sorcery
A:SP$ RepeatEach | Cost$ 6 R R R | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Choose any number of target creatures, planeswalkers, and/or players | TargetMin$ 0 | TargetMax$ MaxTgt | References$ MaxTgt,MaxPl,MaxPerm | RepeatSubAbility$ DBDig | DefinedCards$ Targeted | RepeatPlayers$ Targeted | SubAbility$ DBEffect | StackDescription$ SpellDescription | SpellDescription$ Choose any number of target creatures, planeswalkers, and/or players. For each of them, exile the top card of your library, then CARDNAME deals damage equal to that card's converted mana cost to that permanent or player. You may play the exiled cards until the end of your next turn.
A:SP$ RepeatEach | Cost$ 6 R R R | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Choose any number of target creatures, planeswalkers, and/or players | TargetMin$ 0 | TargetMax$ MaxTgt | References$ MaxTgt,MaxPl,MaxPerm | RepeatSubAbility$ DBDig | RepeatTargeted$ True | SubAbility$ DBEffect | StackDescription$ SpellDescription | SpellDescription$ Choose any number of target creatures, planeswalkers, and/or players. For each of them, exile the top card of your library, then CARDNAME deals damage equal to that card's converted mana cost to that permanent or player. You may play the exiled cards until the end of your next turn.
SVar:DBDig:DB$ Dig | Defined$ You | DigNum$ 1 | ChangeNum$ All | DestinationZone$ Exile | ImprintRevealed$ True | Reveal$ True | SubAbility$ DBDealDamage
SVar:DBDealDamage:DB$ DealDamage | Defined$ Remembered | NumDmg$ X | References$ X | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearImprinted$ True