1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-03-22 19:04:26 -09:00

MOM: Added card "Jin-Gitaxias" and its abilities and effects ()

* MOM: Added card "Jin-Gitaxias" and its abilities and effects

* rule text improvement

* remove unused imports

---------

Co-authored-by: Daniel Eberhard <daniel.h.e@gmx.de>
Co-authored-by: Evan Kranzler <theelk801@gmail.com>
This commit is contained in:
Merlingilb 2023-04-14 15:50:09 +02:00 committed by GitHub
parent b120ce0fa9
commit f63efe14b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 221 additions and 2 deletions
Mage.Sets/src/mage
Mage/src/main/java/mage/abilities/common

View file

@ -0,0 +1,67 @@
package mage.cards.j;
import mage.MageInt;
import mage.abilities.Pronoun;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.condition.common.CardsInHandCondition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalActivatedAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.abilities.keyword.WardAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterSpell;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ManaValuePredicate;
import java.util.UUID;
public class JinGitaxias extends CardImpl {
private static final FilterSpell filter = new FilterSpell("a noncreature spell with mana value 3 or greater");
static {
filter.add(Predicates.not(CardType.CREATURE.getPredicate()));
filter.add(new ManaValuePredicate(ComparisonType.MORE_THAN, 2));
}
public JinGitaxias(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{U}");
this.addSuperType(SuperType.LEGENDARY);
this.addSubType(SubType.PHYREXIAN);
this.addSubType(SubType.PRAETOR);
this.power = new MageInt(5);
this.toughness = new MageInt(5);
this.secondSideCardClazz = mage.cards.t.TheGreatSynthesis.class;
//Ward {2}
this.addAbility(new WardAbility(new ManaCostsImpl<>("{2}"), false));
//Whenever you cast a noncreature spell with mana value 3 or greater, draw a card.
this.addAbility(new SpellCastControllerTriggeredAbility(
new DrawCardSourceControllerEffect(1),
filter, false
));
//{3}{U}: Exile Jin-Gitaxias, then return it to the battlefield transformed under its owners control. Activate
//only as a sorcery and only if you have seven or more cards in hand.
this.addAbility(new TransformAbility());
ConditionalActivatedAbility conditionalActivatedAbility =
new ConditionalActivatedAbility(Zone.BATTLEFIELD, new ExileAndReturnTransformedSourceEffect(Pronoun.IT),
new ManaCostsImpl<>("{3}{U}"), new CardsInHandCondition(ComparisonType.MORE_THAN, 6));
conditionalActivatedAbility.setTiming(TimingRule.SORCERY);
this.addAbility(conditionalActivatedAbility);
}
private JinGitaxias(final JinGitaxias card) {
super(card);
}
@Override
public JinGitaxias copy() {
return new JinGitaxias(this);
}
}

View file

@ -0,0 +1,133 @@
package mage.cards.t;
import mage.abilities.Ability;
import mage.abilities.common.SagaAbility;
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.ExileSagaAndReturnTransformedEffect;
import mage.abilities.effects.common.ReturnToHandFromBattlefieldAllEffect;
import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect;
import mage.cards.*;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterNonlandCard;
import mage.filter.predicate.Predicates;
import mage.game.Game;
import mage.players.Player;
import mage.util.CardUtil;
import java.util.UUID;
public class TheGreatSynthesis extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Phyrexian creatures");
static {
filter.add(Predicates.not(SubType.PHYREXIAN.getPredicate()));
}
public TheGreatSynthesis(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "");
this.addSubType(SubType.SAGA);
this.color.setBlue(true);
//(As this Saga enters and after your draw step, add a lore counter.)
SagaAbility sagaAbility = new SagaAbility(this, false);
//I Draw cards equal to the number of cards in your hand. You have no maximum hand size for as long as you
//control The Great Synthesis.
sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_I,
new DrawCardSourceControllerEffect(CardsInControllerHandCount.instance)
.setText("draw cards equal to the number of cards in your hand"),
new MaximumHandSizeControllerEffect(Integer.MAX_VALUE, Duration.WhileOnBattlefield,
MaximumHandSizeControllerEffect.HandSizeModification.SET)
.setText("you have no maximum hand size for as long as you control {this}"));
//II Return all non-Phyrexian creatures to their owners' hands.
sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_II, new ReturnToHandFromBattlefieldAllEffect(filter));
//III You may cast any number of spells from your hand without paying their mana cost. Exile The Great
//Synthesis, then return it to the battlefield <i>(front face up)</i>.
sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_III, new TheGreatSynthesisCastEffect(),
new TheGreatSynthesisExileReturnEffect());
this.addAbility(sagaAbility);
}
private TheGreatSynthesis(final TheGreatSynthesis card) {
super(card);
}
@Override
public TheGreatSynthesis copy() {
return new TheGreatSynthesis(this);
}
}
class TheGreatSynthesisCastEffect extends OneShotEffect {
public TheGreatSynthesisCastEffect() {
super(Outcome.PlayForFree);
this.staticText = "you may cast any number of spells from your hand without paying their mana costs";
}
public TheGreatSynthesisCastEffect(final TheGreatSynthesisCastEffect effect) {
super(effect);
}
@Override
public TheGreatSynthesisCastEffect copy() {
return new TheGreatSynthesisCastEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
Cards cards = controller.getHand();
CardUtil.castMultipleWithAttributeForFree(controller, source, game, cards, StaticFilters.FILTER_CARD);
return true;
}
}
class TheGreatSynthesisExileReturnEffect extends OneShotEffect {
public TheGreatSynthesisExileReturnEffect() {
super(Outcome.PutCreatureInPlay);
staticText = "exile {this}, then return it to the battlefield <i>(front face up)</i>";
}
private TheGreatSynthesisExileReturnEffect(final TheGreatSynthesisExileReturnEffect effect) {
super(effect);
}
@Override
public TheGreatSynthesisExileReturnEffect copy() {
return new TheGreatSynthesisExileReturnEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
if (game.getState().getZone(source.getSourceId()) != Zone.BATTLEFIELD) {
return false;
}
Card card = game.getCard(source.getSourceId());
if (card == null) {
return false;
}
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
if (!player.moveCards(card, Zone.EXILED, source, game)) {
return false;
}
return player.moveCards(card, Zone.BATTLEFIELD, source, game);
}
}

View file

@ -84,6 +84,9 @@ public final class MarchOfTheMachine extends ExpansionSet {
cards.add(new SetCardInfo("Deeproot Wayfinder", 184, Rarity.RARE, mage.cards.d.DeeprootWayfinder.class));
cards.add(new SetCardInfo("Deluge of the Dead", 115, Rarity.MYTHIC, mage.cards.d.DelugeOfTheDead.class));
cards.add(new SetCardInfo("Dismal Backwater", 269, Rarity.COMMON, mage.cards.d.DismalBackwater.class));
cards.add(new SetCardInfo("Jin-Gitaxias", 65, Rarity.MYTHIC, mage.cards.j.JinGitaxias.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Jin-Gitaxias", 294, Rarity.MYTHIC, mage.cards.j.JinGitaxias.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Jin-Gitaxias", 339, Rarity.MYTHIC, mage.cards.j.JinGitaxias.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Disturbing Conversion", 54, Rarity.COMMON, mage.cards.d.DisturbingConversion.class));
cards.add(new SetCardInfo("Doomskar Warrior", 185, Rarity.RARE, mage.cards.d.DoomskarWarrior.class));
cards.add(new SetCardInfo("Dreg Recycler", 100, Rarity.COMMON, mage.cards.d.DregRecycler.class));
@ -255,6 +258,10 @@ public final class MarchOfTheMachine extends ExpansionSet {
cards.add(new SetCardInfo("Saiba Cryptomancer", 76, Rarity.COMMON, mage.cards.s.SaibaCryptomancer.class));
cards.add(new SetCardInfo("Scorn-Blade Berserker", 124, Rarity.UNCOMMON, mage.cards.s.ScornBladeBerserker.class));
cards.add(new SetCardInfo("Scoured Barrens", 272, Rarity.COMMON, mage.cards.s.ScouredBarrens.class));
cards.add(new SetCardInfo("Swiftwater Cliffs", 273, Rarity.MYTHIC, mage.cards.s.SwiftwaterCliffs.class));
cards.add(new SetCardInfo("The Great Synthesis", 65, Rarity.MYTHIC, mage.cards.t.TheGreatSynthesis.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("The Great Synthesis", 294, Rarity.MYTHIC, mage.cards.t.TheGreatSynthesis.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("The Great Synthesis", 339, Rarity.MYTHIC, mage.cards.t.TheGreatSynthesis.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Scrappy Bruiser", 162, Rarity.UNCOMMON, mage.cards.s.ScrappyBruiser.class));
cards.add(new SetCardInfo("Scrollshift", 34, Rarity.COMMON, mage.cards.s.Scrollshift.class));
cards.add(new SetCardInfo("Sculpted Perfection", 253, Rarity.UNCOMMON, mage.cards.s.SculptedPerfection.class));

View file

@ -37,14 +37,26 @@ public class SagaAbility extends SimpleStaticAbility {
this(card, SagaChapter.CHAPTER_III);
}
public SagaAbility(Card card, boolean showSacText) {
this(card, showSacText, SagaChapter.CHAPTER_III);
}
public SagaAbility(Card card, SagaChapter maxChapter) {
this(card, maxChapter, false);
this(card, card.getSecondCardFace() == null, maxChapter);
}
public SagaAbility(Card card, boolean showSacText, SagaChapter maxChapter) {
this(card, maxChapter, false, showSacText);
}
public SagaAbility(Card card, SagaChapter maxChapter, boolean readAhead) {
this(card, maxChapter, readAhead, card.getSecondCardFace() == null);
}
public SagaAbility(Card card, SagaChapter maxChapter, boolean readAhead, boolean showSacText) {
super(Zone.ALL, null);
this.maxChapter = maxChapter;
this.showSacText = card.getSecondCardFace() == null;
this.showSacText = showSacText;
this.readAhead = readAhead;
this.setRuleVisible(true);
this.setRuleAtTheTop(true);