Merge pull request #2524 from Northmoc/defined+target

Allow Defined and Targets to coexist on one effect
This commit is contained in:
Anthony Calosa
2023-02-22 05:08:34 +08:00
committed by GitHub
6 changed files with 11 additions and 9 deletions

View File

@@ -209,6 +209,12 @@ public abstract class SpellAbilityEffect {
private static CardCollection getCards(final boolean definedFirst, final String definedParam, final SpellAbility sa) {
final boolean useTargets = sa.usesTargeting() && (!definedFirst || !sa.hasParam(definedParam));
if (sa.hasParam("ThisDefinedAndTgts")) {
CardCollection cards =
AbilityUtils.getDefinedCards(sa.getHostCard(), sa.getParam("ThisDefinedAndTgts"), sa);
cards.addAll(sa.getTargets().getTargetCards());
return cards;
}
return useTargets ? new CardCollection(sa.getTargets().getTargetCards())
: AbilityUtils.getDefinedCards(sa.getHostCard(), sa.getParam(definedParam), sa);
}

View File

@@ -330,7 +330,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
tgts = sa.knownDetermineDefined(sa.getParam("Defined"));
}
sbTargets.append(" ").append(sa.getParamOrDefault("DefinedDesc", StringUtils.join(tgts, ", ")));
sbTargets.append(" ").append(sa.getParamOrDefault("DefinedDesc", Lang.joinHomogenous(tgts)));
final String targetname = sbTargets.toString();

View File

@@ -2,7 +2,6 @@ Name:Coastal Wizard
ManaCost:2 U U
Types:Creature Human Wizard
PT:1/1
A:AB$ ChangeZone | Cost$ T | ValidCard$ Card.Self | Origin$ Battlefield | Destination$ Hand | SubAbility$ DBChangeZone | PlayerTurn$ True | ActivationPhases$ Upkeep->BeginCombat | ActivationFirstCombat$ True | SpellDescription$ Return CARDNAME and another target creature to their owners' hands. Activate only during your turn, before attackers are declared.
SVar:DBChangeZone:DB$ ChangeZone | ValidTgts$ Creature | TgtPrompt$ Select target creature | Origin$ Battlefield | Destination$ Hand
A:AB$ ChangeZone | Cost$ T | ThisDefinedAndTgts$ Self | ValidTgts$ Creature.Other | TgtPrompt$ Select another target creature | Origin$ Battlefield | Destination$ Hand | PlayerTurn$ True | ActivationPhases$ Upkeep->BeginCombat | ActivationFirstCombat$ True | SpellDescription$ Return CARDNAME and another target creature to their owners' hands. Activate only during your turn, before attackers are declared.
AI:RemoveDeck:All
Oracle:{T}: Return Coastal Wizard and another target creature to their owners' hands. Activate only during your turn, before attackers are declared.

View File

@@ -2,7 +2,6 @@ Name:Lady Sun
ManaCost:1 U U
Types:Legendary Creature Human Advisor
PT:1/1
A:AB$ ChangeZone | Cost$ T | ValidCard$ Card.Self | Origin$ Battlefield | Destination$ Hand | SubAbility$ DBChangeZone | PlayerTurn$ True | ActivationPhases$ Upkeep->BeginCombat | ActivationFirstCombat$ True | SpellDescription$ Return CARDNAME and another target creature to their owners' hands. Activate only during your turn, before attackers are declared.
SVar:DBChangeZone:DB$ ChangeZone | ValidTgts$ Creature | TgtPrompt$ Select target creature | Origin$ Battlefield | Destination$ Hand
A:AB$ ChangeZone | Cost$ T | ThisDefinedAndTgts$ Self | ValidTgts$ Creature.Other | TgtPrompt$ Select another target creature | Origin$ Battlefield | Destination$ Hand | PlayerTurn$ True | ActivationPhases$ Upkeep->BeginCombat | ActivationFirstCombat$ True | SpellDescription$ Return CARDNAME and another target creature to their owners' hands. Activate only during your turn, before attackers are declared.
AI:RemoveDeck:All
Oracle:{T}: Return Lady Sun and another target creature to their owners' hands. Activate only during your turn, before attackers are declared.

View File

@@ -2,7 +2,6 @@ Name:Snow Hound
ManaCost:2 W
Types:Creature Dog
PT:1/1
A:AB$ ChangeZone | Cost$ 1 T | ValidTgts$ Creature.Blue+YouCtrl,Creature.Green+YouCtrl | TgtPrompt$ Select target blue or green creature you control | Origin$ Battlefield | Destination$ Hand | SubAbility$ Return | SpellDescription$ Return CARDNAME and target green or blue creature you control to their owner's hand.
SVar:Return:DB$ ChangeZone | Origin$ Battlefield | Destination$ Hand
A:AB$ ChangeZone | Cost$ 1 T | ThisDefinedAndTgts$ Self | ValidTgts$ Creature.Blue+YouCtrl,Creature.Green+YouCtrl | TgtPrompt$ Select target blue or green creature you control | Origin$ Battlefield | Destination$ Hand | SpellDescription$ Return CARDNAME and target green or blue creature you control to their owner's hand.
AI:RemoveDeck:Random
Oracle:{1}, {T}: Return Snow Hound and target green or blue creature you control to their owner's hand.

View File

@@ -2,7 +2,6 @@ Name:Wizard Mentor
ManaCost:2 U
Types:Creature Human Wizard
PT:2/2
A:AB$ ChangeZone | Cost$ T | Origin$ Battlefield | Destination$ Hand | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature. | SubAbility$ DBChangeZone | SpellDescription$ Return CARDNAME and target creature you control to owner's hand.
SVar:DBChangeZone:DB$ ChangeZone | Origin$ Battlefield | Destination$ Hand
A:AB$ ChangeZone | Cost$ T | ThisDefinedAndTgts$ Self | Origin$ Battlefield | Destination$ Hand | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | SpellDescription$ Return CARDNAME and target creature you control to their owner's hand.
AI:RemoveDeck:All
Oracle:{T}: Return Wizard Mentor and target creature you control to their owner's hand.