mirror of
https://github.com/correl/mage.git
synced 2025-04-10 09:11:04 -09:00
Merge origin/master
This commit is contained in:
commit
f467378968
2 changed files with 47 additions and 9 deletions
Mage.Sets/src/mage
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -10,10 +9,9 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.filter.common.FilterCreatureCard;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.Target;
|
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,13 +21,13 @@ import mage.target.common.TargetCardInYourGraveyard;
|
||||||
public final class MiraculousRecovery extends CardImpl {
|
public final class MiraculousRecovery extends CardImpl {
|
||||||
|
|
||||||
public MiraculousRecovery(UUID ownerId, CardSetInfo setInfo) {
|
public MiraculousRecovery(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{W}");
|
||||||
|
|
||||||
|
|
||||||
// Return target creature card from your graveyard to the battlefield. Put a +1/+1 counter on it.
|
// Return target creature card from your graveyard to the battlefield. Put a +1/+1 counter on it.
|
||||||
this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect());
|
this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect());
|
||||||
Target target = new TargetCardInYourGraveyard(new FilterCreatureCard());
|
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(
|
||||||
this.getSpellAbility().addTarget(target);
|
StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD
|
||||||
|
));
|
||||||
this.getSpellAbility().addEffect(new MiraculousRecoveryEffect());
|
this.getSpellAbility().addEffect(new MiraculousRecoveryEffect());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +62,7 @@ class MiraculousRecoveryEffect extends OneShotEffect {
|
||||||
// targetPointer can't be used because target moved from graveyard to battlefield
|
// targetPointer can't be used because target moved from graveyard to battlefield
|
||||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
permanent.addCounters(CounterType.P1P1.createInstance(), source, game);
|
permanent.addCounters(CounterType.P1P1.createInstance(), source, game);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
package mage.sets;
|
package mage.sets;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import mage.cards.ExpansionSet;
|
import mage.cards.ExpansionSet;
|
||||||
|
import mage.cards.repository.CardCriteria;
|
||||||
|
import mage.cards.repository.CardInfo;
|
||||||
|
import mage.cards.repository.CardRepository;
|
||||||
|
import mage.constants.CardType;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.constants.SetType;
|
import mage.constants.SetType;
|
||||||
|
|
||||||
|
@ -16,11 +22,13 @@ public final class GuildsOfRavnica extends ExpansionSet {
|
||||||
super("Guilds of Ravnica", "GRN", ExpansionSet.buildDate(2018, 10, 5), SetType.EXPANSION);
|
super("Guilds of Ravnica", "GRN", ExpansionSet.buildDate(2018, 10, 5), SetType.EXPANSION);
|
||||||
this.blockName = "Guilds of Ravnica";
|
this.blockName = "Guilds of Ravnica";
|
||||||
this.hasBoosters = true;
|
this.hasBoosters = true;
|
||||||
this.numBoosterLands = 1;
|
this.numBoosterSpecial = 1;
|
||||||
|
this.numBoosterLands = 0;
|
||||||
this.numBoosterCommon = 10;
|
this.numBoosterCommon = 10;
|
||||||
this.numBoosterUncommon = 3;
|
this.numBoosterUncommon = 3;
|
||||||
this.numBoosterRare = 1;
|
this.numBoosterRare = 1;
|
||||||
this.ratioBoosterMythic = 8;
|
this.ratioBoosterMythic = 8;
|
||||||
|
this.maxCardNumberInBooster = 259;
|
||||||
|
|
||||||
cards.add(new SetCardInfo("Affectionate Indrik", 121, Rarity.UNCOMMON, mage.cards.a.AffectionateIndrik.class));
|
cards.add(new SetCardInfo("Affectionate Indrik", 121, Rarity.UNCOMMON, mage.cards.a.AffectionateIndrik.class));
|
||||||
cards.add(new SetCardInfo("Arboretum Elemental", 122, Rarity.UNCOMMON, mage.cards.a.ArboretumElemental.class));
|
cards.add(new SetCardInfo("Arboretum Elemental", 122, Rarity.UNCOMMON, mage.cards.a.ArboretumElemental.class));
|
||||||
|
@ -296,4 +304,36 @@ public final class GuildsOfRavnica extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Wojek Bodyguard", 120, Rarity.COMMON, mage.cards.w.WojekBodyguard.class));
|
cards.add(new SetCardInfo("Wojek Bodyguard", 120, Rarity.COMMON, mage.cards.w.WojekBodyguard.class));
|
||||||
cards.add(new SetCardInfo("Worldsoul Colossus", 215, Rarity.UNCOMMON, mage.cards.w.WorldsoulColossus.class));
|
cards.add(new SetCardInfo("Worldsoul Colossus", 215, Rarity.UNCOMMON, mage.cards.w.WorldsoulColossus.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CardInfo> getCardsByRarity(Rarity rarity) {
|
||||||
|
if (rarity == Rarity.COMMON) {
|
||||||
|
List<CardInfo> savedCardsInfos = savedCards.get(rarity);
|
||||||
|
if (savedCardsInfos == null) {
|
||||||
|
CardCriteria criteria = new CardCriteria();
|
||||||
|
criteria.setCodes(this.code).notTypes(CardType.LAND);
|
||||||
|
criteria.rarities(rarity).doubleFaced(false);
|
||||||
|
savedCardsInfos = CardRepository.instance.findCards(criteria);
|
||||||
|
if (maxCardNumberInBooster != Integer.MAX_VALUE) {
|
||||||
|
savedCardsInfos.removeIf(next -> next.getCardNumberAsInt() > maxCardNumberInBooster);
|
||||||
|
}
|
||||||
|
criteria = new CardCriteria();
|
||||||
|
// Gateway Plaza is a normal common: https://twitter.com/EliShffrn/status/1043156989218414593s
|
||||||
|
criteria.setCodes(this.code).nameExact("Gateway Plaza");
|
||||||
|
savedCardsInfos.addAll(CardRepository.instance.findCards(criteria));
|
||||||
|
savedCards.put(rarity, savedCardsInfos);
|
||||||
|
}
|
||||||
|
// Return a copy of the saved cards information, as not to modify the original.
|
||||||
|
return new ArrayList<>(savedCardsInfos);
|
||||||
|
} else {
|
||||||
|
return super.getCardsByRarity(rarity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CardInfo> getSpecialCommon() {
|
||||||
|
CardCriteria criteria = new CardCriteria();
|
||||||
|
criteria.rarities(Rarity.COMMON).setCodes(this.code).name("Guildgate");
|
||||||
|
return CardRepository.instance.findCards(criteria);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue