diff --git a/Mage.Sets/src/mage/cards/g/GoroGoroDiscipleOfRyusei.java b/Mage.Sets/src/mage/cards/g/GoroGoroDiscipleOfRyusei.java new file mode 100644 index 00000000000..7f6283b5865 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GoroGoroDiscipleOfRyusei.java @@ -0,0 +1,74 @@ +package mage.cards.g; + +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.hint.ConditionHint; +import mage.abilities.hint.Hint; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.AttackingPredicate; +import mage.filter.predicate.permanent.ModifiedPredicate; +import mage.game.permanent.token.DragonSpiritToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GoroGoroDiscipleOfRyusei extends CardImpl { + + private static final FilterPermanent filter + = new FilterControlledCreaturePermanent("if you control an attacking modified creature"); + + static { + filter.add(AttackingPredicate.instance); + filter.add(ModifiedPredicate.instance); + } + + private static final Condition condition = new PermanentsOnTheBattlefieldCondition(filter); + private static final Hint hint = new ConditionHint( + condition, "You control and attacking modified creature" + ); + + public GoroGoroDiscipleOfRyusei(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.GOBLIN); + this.subtype.add(SubType.SAMURAI); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {R}: Creatures you control gain haste until end of turn. + this.addAbility(new SimpleActivatedAbility(new GainAbilityAllEffect( + HasteAbility.getInstance(), Duration.EndOfTurn, + StaticFilters.FILTER_CONTROLLED_CREATURES + ), new ManaCostsImpl<>("{R}"))); + + // {3}{R}{R}: Create a 5/5 red Dragon Spirit creature token with flying. Activate only if you control an attacking modified creature. + this.addAbility(new ConditionalActivatedAbility( + Zone.BATTLEFIELD, new CreateTokenEffect(new DragonSpiritToken()), + new ManaCostsImpl<>("{3}{R}{R}"), condition + ).addHint(hint)); + } + + private GoroGoroDiscipleOfRyusei(final GoroGoroDiscipleOfRyusei card) { + super(card); + } + + @Override + public GoroGoroDiscipleOfRyusei copy() { + return new GoroGoroDiscipleOfRyusei(this); + } +} diff --git a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java index ba8ef4f934d..c4bda311f05 100644 --- a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java +++ b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java @@ -23,6 +23,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet { cards.add(new SetCardInfo("Atsushi, the Blazing Sky", 134, Rarity.MYTHIC, mage.cards.a.AtsushiTheBlazingSky.class)); cards.add(new SetCardInfo("Forest", 301, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS)); + cards.add(new SetCardInfo("Goro-Goro, Disciple of Ryusei", 145, Rarity.RARE, mage.cards.g.GoroGoroDiscipleOfRyusei.class)); cards.add(new SetCardInfo("Hidetsugu, Devouring Chaos", 99, Rarity.RARE, mage.cards.h.HidetsuguDevouringChaos.class)); cards.add(new SetCardInfo("Island", 295, Rarity.LAND, mage.cards.basiclands.Island.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Kaito Shizuki", 226, Rarity.MYTHIC, mage.cards.k.KaitoShizuki.class)); diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/CounterAnyPredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/CounterAnyPredicate.java index 228f1dd6285..5c1362ee6c9 100644 --- a/Mage/src/main/java/mage/filter/predicate/permanent/CounterAnyPredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/permanent/CounterAnyPredicate.java @@ -1,6 +1,6 @@ - package mage.filter.predicate.permanent; +import mage.counters.Counter; import mage.filter.predicate.Predicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -13,8 +13,12 @@ public enum CounterAnyPredicate implements Predicate { @Override public boolean apply(Permanent input, Game game) { - return input.getCounters(game).values().stream().anyMatch(counter -> counter.getCount() > 0); - + return input + .getCounters(game) + .values() + .stream() + .mapToInt(Counter::getCount) + .anyMatch(x -> x > 0); } @Override diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/EnchantedPredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/EnchantedPredicate.java index 094fc276300..9e323522d78 100644 --- a/Mage/src/main/java/mage/filter/predicate/permanent/EnchantedPredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/permanent/EnchantedPredicate.java @@ -1,6 +1,6 @@ - package mage.filter.predicate.permanent; +import mage.constants.SubType; import mage.filter.predicate.Predicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -19,7 +19,7 @@ public enum EnchantedPredicate implements Predicate { .stream() .map(game::getPermanent) .filter(Objects::nonNull) - .anyMatch(permanent -> permanent.isEnchantment(game)); + .anyMatch(permanent -> permanent.hasSubtype(SubType.AURA, game)); } @Override diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/ModifiedPredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/ModifiedPredicate.java new file mode 100644 index 00000000000..e0a4d9b739a --- /dev/null +++ b/Mage/src/main/java/mage/filter/predicate/permanent/ModifiedPredicate.java @@ -0,0 +1,39 @@ +package mage.filter.predicate.permanent; + +import mage.constants.SubType; +import mage.counters.Counter; +import mage.filter.predicate.Predicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +import java.util.Objects; + +/** + * @author TheElk801 + */ +public enum ModifiedPredicate implements Predicate { + instance; + + @Override + public boolean apply(Permanent input, Game game) { + return input + .getCounters(game) + .values() + .stream() + .mapToInt(Counter::getCount) + .anyMatch(x -> x > 0) + || input + .getAttachments() + .stream() + .map(game::getPermanent) + .filter(Objects::nonNull) + .anyMatch(permanent -> permanent.hasSubtype(SubType.EQUIPMENT, game) + || (permanent.hasSubtype(SubType.AURA, game) + && permanent.isControlledBy(input.getControllerId()))); + } + + @Override + public String toString() { + return "modified"; + } +} diff --git a/Mage/src/main/java/mage/game/permanent/token/DragonSpiritToken.java b/Mage/src/main/java/mage/game/permanent/token/DragonSpiritToken.java new file mode 100644 index 00000000000..e8dac34bae5 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/DragonSpiritToken.java @@ -0,0 +1,31 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.constants.CardType; +import mage.constants.SubType; + +/** + * @author TheElk801 + */ +public final class DragonSpiritToken extends TokenImpl { + + public DragonSpiritToken() { + super("Dragon Spirit token", "5/5 red Dragon Spirit creature token with flying"); + cardType.add(CardType.CREATURE); + color.setRed(true); + subtype.add(SubType.DRAGON); + subtype.add(SubType.SPIRIT); + power = new MageInt(5); + toughness = new MageInt(5); + addAbility(FlyingAbility.getInstance()); + } + + public DragonSpiritToken(final DragonSpiritToken token) { + super(token); + } + + public DragonSpiritToken copy() { + return new DragonSpiritToken(this); + } +} diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 52bdea85ee7..e11ff62ad4f 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -43509,7 +43509,8 @@ The Modern Age|Kamigawa: Neon Dynasty|66|C|{1}{U}|Enchantment - Saga|||(As this Vector Glider|Kamigawa: Neon Dynasty|66|C||Enchantment Creature - Spirit|2|3|Flying| Hidetsugu, Devouring Chaos|Kamigawa: Neon Dynasty|99|R|{3}{B}|Legendary Creature - Ogre Demon|4|4|{B}, Sacrifice a creature: Scry 2.${2}{R}, {T}: Exile the top card of your library. You may play that card this turn. When you exile a nonland card this way, Hidetsugu, Devouring Chaos deals damage equal to the exiled card's mana value to any target.| Atsushi, the Blazing Sky|Kamigawa: Neon Dynasty|134|M|{2}{R}{R}|Legendary Creature - Dragon Spirit|4|4|Flying, trample$When Atsushi, the Blazing Sky dies, choose one —$• Exile the top two cards of your library. Until the end of your next turn, you may play those cards.$• Create three Treasure tokens.| -The Shattered States Era|Kamigawa: Neon Dynasty|162|C|{4}{R}|Enchantment - Saga|||(As this Saga enters and after your draw step, add a lore counter. Sacrifice after III.)$I — Gain control of target creature until end of turn. It gains haste until end of turn.$II — Creatures you control get +1/+0 until end of turn.$III — Exile this Saga, then return it to the battlefield transformed under your control.| +Goro-Goro, Disciple of Ryusei|Kamigawa: Neon Dynasty|145|R|{1}{R}|Legendary Creature - Goblin Samurai|2|2|{R}: Creatures you control gain haste until end of turn.${3}{R}{R}: Create a 5/5 red Dragon Spirit creature token with flying. Activate only if you control an attacking modified creature.| +The Shattered States Era|Kamigawa: Neon Dynasty|162|C|{4}{R}|Enchantment - Saga|||(As this Saga enters and after your draw step, add a lore counter.)$I — Gain control of target creature until end of turn. It gains haste until end of turn.$II — Creatures you control get +1/+0 until end of turn.$III — Exile this Saga, then return it to the battlefield transformed under your control.| Nameless Conqueror|Kamigawa: Neon Dynasty|162|C||Enchantment Creature - Human Samurai|3|3|Trample, haste| Kaito Shizuki|Kamigawa: Neon Dynasty|226|M|{1}{U}{B}|Legendary Planeswalker - Kaito|3|At the beginning of your end step, if Kaito Shizuki entered the battlefield this turn, he phases out.$+1: Draw a card. Then discard a card unless you attacked this turn.$−2: Create a 1/1 blue Ninja creature token with "This creature can't be blocked."$−7: You get an emblem with "Whenever a creature you control deals combat damage to a player, search your library for a blue or black creature card, put it onto the battlefield, then shuffle."| Satoru Umezawa|Kamigawa: Neon Dynasty|234|R|{1}{U}{B}|Legendary Creature - Human Ninja|2|4|Whenever you activate a ninjutsu ability, look at the top three cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order. This ability triggers only once each turn.$Each creature card in your hand has ninjutsu {2}{U}{B}.|