mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
[J22] Implement Alandra, Sky Dreamer and refactor of DrawSecondCardTriggeredAbility (#10092)
DrawSecondCardTriggeredAbility refactored into DrawCardTriggeredAbility DynamicValue support for DrawCardTriggeredAbility DynamicValue support for BoostAllOfChosenSubtypeEffect Co-authored-by: drago <drago@192.168.1.72>
This commit is contained in:
parent
e1c7139425
commit
0ebaeb20c7
24 changed files with 172 additions and 73 deletions
91
Mage.Sets/src/mage/cards/a/AlandraSkyDreamer.java
Normal file
91
Mage.Sets/src/mage/cards/a/AlandraSkyDreamer.java
Normal file
|
@ -0,0 +1,91 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.game.permanent.token.DrakeToken;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
|
||||
import mage.abilities.effects.common.continuous.BoostAllOfChosenSubtypeEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
|
||||
/**
|
||||
* @author amoscatelli
|
||||
*/
|
||||
public final class AlandraSkyDreamer extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("drakes you control");
|
||||
|
||||
static {
|
||||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
filter.add(SubType.DRAKE.getPredicate());
|
||||
}
|
||||
|
||||
public AlandraSkyDreamer(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
|
||||
addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.MERFOLK);
|
||||
this.subtype.add(SubType.WIZARD);
|
||||
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Whenever you draw your second card earch turn, create a 2/2 blue Drake creature token with flying.
|
||||
this.addAbility(
|
||||
new DrawCardTriggeredAbility(
|
||||
new CreateTokenEffect(
|
||||
new DrakeToken()
|
||||
),
|
||||
false,
|
||||
2
|
||||
)
|
||||
);
|
||||
|
||||
// Whenever you draw your fifth card each turn, Drakes you control each get +X/+X until end of turn, where X is the number of cards in your hand.
|
||||
this.addAbility(
|
||||
new DrawCardTriggeredAbility(
|
||||
new BoostAllOfChosenSubtypeEffect(
|
||||
CardsInControllerHandCount.instance,
|
||||
CardsInControllerHandCount.instance,
|
||||
Duration.EndOfTurn,
|
||||
filter,
|
||||
true
|
||||
),
|
||||
false,
|
||||
5
|
||||
)
|
||||
);
|
||||
|
||||
// Whenever you draw your fifth card each turn, Alandra, Sky Dreamer get +X/+X until end of turn, where X is the number of cards in your hand.
|
||||
this.addAbility(
|
||||
new DrawCardTriggeredAbility(
|
||||
new BoostSourceEffect(
|
||||
CardsInControllerHandCount.instance,
|
||||
CardsInControllerHandCount.instance,
|
||||
Duration.EndOfTurn
|
||||
),
|
||||
false,
|
||||
5
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
private AlandraSkyDreamer(final AlandraSkyDreamer card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AlandraSkyDreamer copy() {
|
||||
return new AlandraSkyDreamer(this);
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@ package mage.cards.b;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
|
@ -27,9 +27,9 @@ public final class BloodhazeWolverine extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// Whenever you draw your second card each turn, Bloodhaze Wolverine gets +1/+1 and gains first strike until end of turn.
|
||||
Ability ability = new DrawSecondCardTriggeredAbility(new BoostSourceEffect(
|
||||
Ability ability = new DrawCardTriggeredAbility(new BoostSourceEffect(
|
||||
1, 1, Duration.EndOfTurn
|
||||
).setText("{this} gets +1/+1"), false);
|
||||
).setText("{this} gets +1/+1"), false, 2);
|
||||
ability.addEffect(new GainAbilitySourceEffect(
|
||||
FirstStrikeAbility.getInstance(), Duration.EndOfTurn
|
||||
).setText("and gains first strike until end of turn"));
|
||||
|
|
|
@ -2,7 +2,7 @@ package mage.cards.d;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect;
|
||||
import mage.abilities.effects.keyword.SurveilEffect;
|
||||
|
@ -31,7 +31,7 @@ public final class DoggedDetective extends CardImpl {
|
|||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SurveilEffect(2)));
|
||||
|
||||
// Whenever an opponent draws their second card each turn, you may return Dogged Detective from your graveyard to your hand.
|
||||
this.addAbility(new DrawSecondCardTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), true, TargetController.OPPONENT));
|
||||
this.addAbility(new DrawCardTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), true, TargetController.OPPONENT, 2));
|
||||
}
|
||||
|
||||
private DoggedDetective(final DoggedDetective card) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.OpponentsCount;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
|
@ -34,8 +34,8 @@ public final class EtherealInvestigator extends CardImpl {
|
|||
this.addAbility(new EntersBattlefieldTriggeredAbility(new InvestigateEffect(OpponentsCount.instance)));
|
||||
|
||||
// Whenever you draw your second card each turn, create a 1/1 white Spirit creature token with flying.
|
||||
this.addAbility(new DrawSecondCardTriggeredAbility(
|
||||
new CreateTokenEffect(new SpiritWhiteToken()), false
|
||||
this.addAbility(new DrawCardTriggeredAbility(
|
||||
new CreateTokenEffect(new SpiritWhiteToken()), false, 2
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package mage.cards.f;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.FlashAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
@ -33,8 +33,8 @@ public final class FaerieVandal extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Whenever you draw your second card each turn, put a +1/+1 counter on Faerie Vandal.
|
||||
this.addAbility(new DrawSecondCardTriggeredAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false
|
||||
this.addAbility(new DrawCardTriggeredAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, 2
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package mage.cards.g;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.common.CyclingDiscardCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
|
@ -40,7 +40,7 @@ public final class GaviNestWarden extends CardImpl {
|
|||
this.addAbility(new SimpleStaticAbility(new CyclingZeroCostEffect()), new GaviNestWardenWatcher());
|
||||
|
||||
// Whenever you draw your second card each turn, create a 2/2 red and white Dinosaur Cat creature token.
|
||||
this.addAbility(new DrawSecondCardTriggeredAbility(new CreateTokenEffect(new DinosaurCatToken()), false));
|
||||
this.addAbility(new DrawCardTriggeredAbility(new CreateTokenEffect(new DinosaurCatToken()), false, 2));
|
||||
}
|
||||
|
||||
private GaviNestWarden(final GaviNestWarden card) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesSourceTriggeredAbility;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||
|
@ -41,7 +41,7 @@ public final class GixianPuppeteer extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// Whenever you draw your second card each turn, each opponent loses 2 life and you gain 2 life.
|
||||
Ability ability = new DrawSecondCardTriggeredAbility(new LoseLifeOpponentsEffect(2), false);
|
||||
Ability ability = new DrawCardTriggeredAbility(new LoseLifeOpponentsEffect(2), false, 2);
|
||||
ability.addEffect(new GainLifeEffect(2).concatBy("and"));
|
||||
this.addAbility(ability);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import mage.MageInt;
|
|||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesSourceTriggeredAbility;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
@ -52,7 +52,7 @@ public final class GurglingAnointer extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Whenever you draw your second card each turn, put a +1/+1 counter on Gurgling Anointer.
|
||||
this.addAbility(new DrawSecondCardTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
|
||||
this.addAbility(new DrawCardTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, 2));
|
||||
|
||||
// When Gurgling Anointer dies, return another target creature card with mana value less than or equal to Gurgling Anointer's power from your graveyard to the battlefield.
|
||||
Ability ability = new DiesSourceTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect());
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package mage.cards.i;
|
||||
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
|
@ -21,7 +21,7 @@ public final class ImprobableAlliance extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}{R}");
|
||||
|
||||
// Whenever you draw your second card each turn, create a 1/1 blue Faerie creature token with flying.
|
||||
this.addAbility(new DrawSecondCardTriggeredAbility(new CreateTokenEffect(new FaerieToken()), false));
|
||||
this.addAbility(new DrawCardTriggeredAbility(new CreateTokenEffect(new FaerieToken()), false, 2));
|
||||
|
||||
// {4}{U}{R}: Draw a card, then discard a card.
|
||||
this.addAbility(new SimpleActivatedAbility(
|
||||
|
|
|
@ -2,7 +2,7 @@ package mage.cards.i;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
@ -26,7 +26,7 @@ public final class IrencragPyromancer extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
// Whenever you draw your second card each turn, Irencrag Pyromancer deals 3 damage to any target.
|
||||
Ability ability = new DrawSecondCardTriggeredAbility(new DamageTargetEffect(3), false);
|
||||
Ability ability = new DrawCardTriggeredAbility(new DamageTargetEffect(3), false, 2);
|
||||
ability.addTarget(new TargetAnyTarget());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package mage.cards.j;
|
|||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.combat.CantBeBlockedAllEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
|
@ -31,8 +31,8 @@ public final class JaceArcaneStrategist extends CardImpl {
|
|||
this.setStartingLoyalty(4);
|
||||
|
||||
// Whenever you draw your second card each turn, put a +1/+1 counter on target creature you control.
|
||||
Ability ability = new DrawSecondCardTriggeredAbility(
|
||||
new AddCountersTargetEffect(CounterType.P1P1.createInstance()), false
|
||||
Ability ability = new DrawCardTriggeredAbility(
|
||||
new AddCountersTargetEffect(CounterType.P1P1.createInstance()), false, 2
|
||||
);
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
|
|
|
@ -2,7 +2,7 @@ package mage.cards.j;
|
|||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package mage.cards.j;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
|
||||
|
@ -33,7 +33,7 @@ public final class JolraelMwonvuliRecluse extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Whenever you draw your second card each turn, create a 2/2 green Cat creature token.
|
||||
this.addAbility(new DrawSecondCardTriggeredAbility(new CreateTokenEffect(new GreenCat2Token()), false));
|
||||
this.addAbility(new DrawCardTriggeredAbility(new CreateTokenEffect(new GreenCat2Token()), false, 2));
|
||||
|
||||
// {4}{G}{G}: Until end of turn, creatures you control have base power and toughness X/X, where X is the number of cards in your hand.
|
||||
this.addAbility(new SimpleActivatedAbility(new SetBasePowerToughnessAllEffect(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package mage.cards.l;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
@ -25,8 +25,8 @@ public final class LatNamAdept extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// Whenever you draw your second card each turn, put a +1/+1 counter on Lat-Nam Adept.
|
||||
this.addAbility(new DrawSecondCardTriggeredAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false
|
||||
this.addAbility(new DrawCardTriggeredAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, 2
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
@ -24,7 +24,7 @@ public final class MadRatter extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Whenever you draw your second card each turn, create two 1/1 black Rat creature tokens.
|
||||
this.addAbility(new DrawSecondCardTriggeredAbility(new CreateTokenEffect(new RatToken(), 2), false));
|
||||
this.addAbility(new DrawCardTriggeredAbility(new CreateTokenEffect(new RatToken(), 2), false, 2));
|
||||
}
|
||||
|
||||
private MadRatter(final MadRatter card) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
|
||||
|
@ -29,9 +29,9 @@ public final class MantleOfTides extends CardImpl {
|
|||
this.addAbility(new SimpleStaticAbility(new BoostEquippedEffect(1, 2)));
|
||||
|
||||
// Whenever you draw your second card each turn, attach Mantle of Tides to target creature you control.
|
||||
Ability ability = new DrawSecondCardTriggeredAbility(new AttachEffect(
|
||||
Ability ability = new DrawCardTriggeredAbility(new AttachEffect(
|
||||
Outcome.Benefit, "attach {this} to target creature you control"
|
||||
), false);
|
||||
), false, 2);
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package mage.cards.m;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesCreatureTriggeredAbility;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.cards.Card;
|
||||
|
@ -41,8 +41,8 @@ public final class MinnWilyIllusionist extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// Whenever you draw your second card each turn, create a 1/1 blue Illusion creature token with "This creature gets +1/+0 for each other Illusion you control."
|
||||
this.addAbility(new DrawSecondCardTriggeredAbility(
|
||||
new CreateTokenEffect(new MinnWilyIllusionistToken()), false
|
||||
this.addAbility(new DrawCardTriggeredAbility(
|
||||
new CreateTokenEffect(new MinnWilyIllusionistToken()), false, 2
|
||||
));
|
||||
|
||||
// Whenever an Illusion you control dies, you may put a permanent card with mana value less than or equal to that creature's power from your hand onto the battlefield.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -25,8 +25,8 @@ public final class MysticSkyfish extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// Whenever you draw your second card each turn, Mystic Skyfish gains flying until end of turn.
|
||||
this.addAbility(new DrawSecondCardTriggeredAbility(
|
||||
new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), false)
|
||||
this.addAbility(new DrawCardTriggeredAbility(
|
||||
new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), false, 2)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -28,7 +28,7 @@ public final class SteelgazeGriffin extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// When you draw your second card each turn, Steelgaze Griffin gets +2/+0 until end of turn.
|
||||
this.addAbility(new DrawSecondCardTriggeredAbility(new BoostSourceEffect(2, 0, Duration.EndOfTurn), false));
|
||||
this.addAbility(new DrawCardTriggeredAbility(new BoostSourceEffect(2, 0, Duration.EndOfTurn), false, 2));
|
||||
}
|
||||
|
||||
private SteelgazeGriffin(final SteelgazeGriffin card) {
|
||||
|
|
|
@ -2,7 +2,7 @@ package mage.cards.t;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.CastSecondSpellTriggeredAbility;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -30,10 +30,10 @@ public final class TheCouncilOfFour extends CardImpl {
|
|||
this.toughness = new MageInt(8);
|
||||
|
||||
// Whenever a player draws their second card during their turn, you draw a card.
|
||||
this.addAbility(new DrawSecondCardTriggeredAbility(
|
||||
this.addAbility(new DrawCardTriggeredAbility(
|
||||
new DrawCardSourceControllerEffect(1)
|
||||
.setText("you draw a card"),
|
||||
false, TargetController.ACTIVE
|
||||
false, TargetController.ACTIVE, 2
|
||||
));
|
||||
|
||||
// Whenever a player casts their second spell during their turn, you create a 2/2 white Knight creature token.
|
||||
|
|
|
@ -2,7 +2,7 @@ package mage.cards.t;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.DiesSourceTriggeredAbility;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.common.DrawCardTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -28,8 +28,8 @@ public final class ThopterMechanic extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// Whenever you draw your second card each turn, put a +1/+1 counter on Thopter Mechanic.
|
||||
this.addAbility(new DrawSecondCardTriggeredAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false
|
||||
this.addAbility(new DrawCardTriggeredAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, 2
|
||||
));
|
||||
|
||||
// When Thopter Mechanic dies, create a 1/1 colorless Thopter artifact creature token with flying.
|
||||
|
|
|
@ -32,6 +32,7 @@ public final class Jumpstart2022 extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Aftershock", 129, Rarity.COMMON, mage.cards.a.Aftershock.class));
|
||||
cards.add(new SetCardInfo("Ajani's Pridemate", 142, Rarity.UNCOMMON, mage.cards.a.AjanisPridemate.class));
|
||||
cards.add(new SetCardInfo("Ajani, Strength of the Pride", 141, Rarity.MYTHIC, mage.cards.a.AjaniStrengthOfThePride.class));
|
||||
cards.add(new SetCardInfo("Alandra, Sky Dreamer", 9, Rarity.RARE, mage.cards.a.AlandraSkyDreamer.class));
|
||||
cards.add(new SetCardInfo("Alchemist's Vial", 753, Rarity.COMMON, mage.cards.a.AlchemistsVial.class));
|
||||
cards.add(new SetCardInfo("Alley Strangler", 375, Rarity.COMMON, mage.cards.a.AlleyStrangler.class));
|
||||
cards.add(new SetCardInfo("Alseid of Life's Bounty", 143, Rarity.UNCOMMON, mage.cards.a.AlseidOfLifesBounty.class));
|
||||
|
|
|
@ -18,32 +18,36 @@ import java.util.*;
|
|||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class DrawSecondCardTriggeredAbility extends TriggeredAbilityImpl {
|
||||
public class DrawCardTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private static final Hint hint = new ValueHint(
|
||||
"Cards drawn this turn", CardsDrawnThisTurnDynamicValue.instance
|
||||
);
|
||||
private final TargetController targetController;
|
||||
private final DrawCardWatcher drawCardWatcher = new DrawCardWatcher();
|
||||
private final Integer cardNumber;
|
||||
|
||||
public DrawSecondCardTriggeredAbility(Effect effect, boolean optional) {
|
||||
this(effect, optional, TargetController.YOU);
|
||||
public DrawCardTriggeredAbility(Effect effect, boolean optional, Integer cardNumber) {
|
||||
this(effect, optional, TargetController.YOU, cardNumber);
|
||||
}
|
||||
|
||||
public DrawSecondCardTriggeredAbility(Effect effect, boolean optional, TargetController targetController) {
|
||||
this(Zone.BATTLEFIELD, effect, optional, targetController);
|
||||
public DrawCardTriggeredAbility(Effect effect, boolean optional, TargetController targetController, Integer cardNumber) {
|
||||
this(Zone.BATTLEFIELD, effect, optional, targetController, cardNumber);
|
||||
}
|
||||
|
||||
public DrawSecondCardTriggeredAbility(Zone zone, Effect effect, boolean optional, TargetController targetController) {
|
||||
public DrawCardTriggeredAbility(Zone zone, Effect effect, boolean optional, TargetController targetController, Integer cardNumber) {
|
||||
super(zone, effect, optional);
|
||||
this.addWatcher(new DrawSecondCardWatcher());
|
||||
this.addWatcher(this.drawCardWatcher);
|
||||
this.targetController = targetController;
|
||||
this.cardNumber = cardNumber;
|
||||
this.addHint(hint);
|
||||
setTriggerPhrase(generateTriggerPhrase());
|
||||
}
|
||||
|
||||
private DrawSecondCardTriggeredAbility(final DrawSecondCardTriggeredAbility ability) {
|
||||
private DrawCardTriggeredAbility(final DrawCardTriggeredAbility ability) {
|
||||
super(ability);
|
||||
this.targetController = ability.targetController;
|
||||
this.cardNumber = ability.cardNumber;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -73,7 +77,7 @@ public class DrawSecondCardTriggeredAbility extends TriggeredAbilityImpl {
|
|||
default:
|
||||
throw new IllegalArgumentException("TargetController " + targetController + " not supported");
|
||||
}
|
||||
return DrawSecondCardWatcher.checkEvent(event.getPlayerId(), event, game);
|
||||
return drawCardWatcher.checkEvent(event.getPlayerId(), event, cardNumber);
|
||||
}
|
||||
|
||||
public String generateTriggerPhrase() {
|
||||
|
@ -90,17 +94,16 @@ public class DrawSecondCardTriggeredAbility extends TriggeredAbilityImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public DrawSecondCardTriggeredAbility copy() {
|
||||
return new DrawSecondCardTriggeredAbility(this);
|
||||
public DrawCardTriggeredAbility copy() {
|
||||
return new DrawCardTriggeredAbility(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DrawSecondCardWatcher extends Watcher {
|
||||
class DrawCardWatcher extends Watcher {
|
||||
|
||||
private final Set<UUID> drewOnce = new HashSet<>();
|
||||
private final Map<UUID, UUID> secondDrawMap = new HashMap<>();
|
||||
private final Map<UUID, SortedSet<UUID>> drawMap = new HashMap<>();
|
||||
|
||||
DrawSecondCardWatcher() {
|
||||
DrawCardWatcher() {
|
||||
super(WatcherScope.GAME);
|
||||
}
|
||||
|
||||
|
@ -109,21 +112,20 @@ class DrawSecondCardWatcher extends Watcher {
|
|||
if (event.getType() != GameEvent.EventType.DREW_CARD) {
|
||||
return;
|
||||
}
|
||||
if (drewOnce.contains(event.getPlayerId())) {
|
||||
secondDrawMap.putIfAbsent(event.getPlayerId(), event.getId());
|
||||
} else {
|
||||
drewOnce.add(event.getPlayerId());
|
||||
if (!drawMap.containsKey(event.getPlayerId())) {
|
||||
drawMap.putIfAbsent(event.getPlayerId(), new TreeSet<>());
|
||||
}
|
||||
drawMap.get(event.getPlayerId()).add(event.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
super.reset();
|
||||
drewOnce.clear();
|
||||
secondDrawMap.clear();
|
||||
drawMap.clear();
|
||||
}
|
||||
|
||||
static boolean checkEvent(UUID playerId, GameEvent event, Game game) {
|
||||
return event.getId().equals(game.getState().getWatcher(DrawSecondCardWatcher.class).secondDrawMap.getOrDefault(playerId, null));
|
||||
|
||||
public boolean checkEvent(UUID playerId, GameEvent event, Integer cardNumber) {
|
||||
return this.drawMap.containsKey(playerId) && Objects.equals(this.drawMap.get(playerId).size(), cardNumber) && event.getId().equals(this.drawMap.get(playerId).last());
|
||||
}
|
||||
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package mage.abilities.effects.common.continuous;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.common.ChooseCreatureTypeEffect;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
|
@ -23,6 +24,10 @@ public class BoostAllOfChosenSubtypeEffect extends BoostAllEffect {
|
|||
super(power, toughness, duration, filter, excludeSource);
|
||||
}
|
||||
|
||||
public BoostAllOfChosenSubtypeEffect(DynamicValue power, DynamicValue toughness, Duration duration, FilterCreaturePermanent filter, boolean excludeSource) {
|
||||
super(power, toughness, duration, filter, excludeSource);
|
||||
}
|
||||
|
||||
public BoostAllOfChosenSubtypeEffect(final BoostAllOfChosenSubtypeEffect effect) {
|
||||
super(effect);
|
||||
this.subtype = effect.subtype;
|
||||
|
|
Loading…
Reference in a new issue