LCI: deeproot_pilgrimage.txt and support (TapAllTrigger) (#4043)

* LCI: deeproot_pilgrimage.txt and support (TapAllTrigger)

* refactor Card.tap to boolean

* move tappedAll check out of CostPartWithList
This commit is contained in:
Northmoc
2023-11-14 09:13:25 -05:00
committed by GitHub
parent ea81c03deb
commit 183030f53c
18 changed files with 196 additions and 25 deletions

View File

@@ -4,4 +4,5 @@ Types:Creature Zombie Giant
PT:4/4
A:AB$ ChangeZone | Cost$ tapXType<3/Cleric> | Origin$ Graveyard | Destination$ Hand | ActivationZone$ Graveyard | SpellDescription$ Return CARDNAME from your graveyard to your hand.
AI:RemoveDeck:Random
DeckNeeds:Type$Cleric
Oracle:Tap three untapped Clerics you control: Return Gangrenous Goliath from your graveyard to your hand.

View File

@@ -0,0 +1,9 @@
Name:Deeproot Pilgrimage
ManaCost:1 U
Types:Enchantment
T:Mode$ TapAll | ValidCards$ Merfolk.nonToken+YouCtrl | TriggerZones$ Battlefield | Execute$ TrigToken | TriggerDescription$ Whenever one or more nontoken Merfolk you control become tapped, create a 1/1 blue Merfolk creature token with hexproof.
SVar:TrigToken:DB$ Token | TokenScript$ u_1_1_merfolk_hexproof
DeckHas:Ability$Token & Type$Merfolk
AI:RemoveDeck:Random
DeckNeeds:Type$Merfolk
Oracle:Whenever one or more nontoken Merfolk you control become tapped, create a 1/1 blue Merfolk creature token with hexproof.

View File

@@ -1,7 +1,7 @@
Name:Succumb to the Cold
ManaCost:2 U
Types:Instant
A:SP$ Tap | ValidTgts$ Creature.OppCtrl | SubAbility$ DBCounter | TargetMin$ 1 | TargetMax$ 2 | TgtPrompt$ Select one or two target creatures an opponent controls | SpellDescription$ Tap one or two target creatures an opponent controls. Put a stun counter on each of them. (If a permanent with a stun counter would become untapped, remove one from it instead.)
SVar:DBCounter:DB$ PutCounter | Defined$ Targeted | CounterType$ Stun | CounterNum$ 1
A:SP$ Tap | ValidTgts$ Creature.OppCtrl | SubAbility$ DBCounter | TargetMin$ 1 | TargetMax$ 2 | TgtPrompt$ Select one or two target creatures an opponent controls | SpellDescription$ Tap one or two target creatures an opponent controls.
SVar:DBCounter:DB$ PutCounter | Defined$ Targeted | CounterType$ Stun | CounterNum$ 1 | StackDescription$ REP Put_{p:You} puts | SpellDescription$ Put a stun counter on each of them. (If a permanent with a stun counter would become untapped, remove one from it instead.)
DeckHas:Ability$Counters
Oracle:Tap one or two target creatures an opponent controls. Put a stun counter on each of them. (If a permanent with a stun counter would become untapped, remove one from it instead.)
Oracle:Tap one or two target creatures an opponent controls. Put a stun counter on each of them. (If a permanent with a stun counter would become untapped, remove one from it instead.)

View File

@@ -2,8 +2,10 @@ package forge.player;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import forge.ImageKeys;
import forge.game.ability.AbilityKey;
import forge.game.cost.*;
import com.google.common.collect.Iterables;
@@ -537,13 +539,19 @@ public class HumanPlay {
}
if (ability.getTappedForConvoke() != null) {
game.getTriggerHandler().suppressMode(TriggerType.Taps);
CardCollection tapped = new CardCollection();
for (final Card c : ability.getTappedForConvoke()) {
c.setTapped(false);
if (!manaInputCancelled) {
c.tap(true, ability, ability.getActivatingPlayer());
if (c.tap(true, ability, ability.getActivatingPlayer())) tapped.add(c);
}
}
game.getTriggerHandler().clearSuppression(TriggerType.Taps);
if (!tapped.isEmpty()) {
final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put(AbilityKey.Cards, tapped);
game.getTriggerHandler().runTrigger(TriggerType.TapAll, runParams, false);
}
if (manaInputCancelled) {
ability.clearTappedForConvoke();
}

View File

@@ -19,6 +19,7 @@ import java.util.Map.Entry;
import java.util.stream.Collectors;
import java.util.TreeSet;
import forge.game.trigger.TriggerType;
import forge.trackable.TrackableCollection;
import forge.util.ImageUtil;
import org.apache.commons.lang3.ObjectUtils;
@@ -2628,8 +2629,14 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
inp.setMessage(localizer.getMessage("lblChoosePermanentstoTap"));
inp.showAndWait();
if (!inp.hasCancelled()) {
CardCollection tapped = new CardCollection();
for (final Card c : inp.getSelected()) {
c.tap(true, null, null);
if (c.tap(true, null, null)) tapped.add(c);
}
if (!tapped.isEmpty()) {
final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put(AbilityKey.Cards, tapped);
getGame().getTriggerHandler().runTrigger(TriggerType.TapAll, runParams, false);
}
}
});