1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-09 01:01:06 -09:00

Implemented Growth Cycle

This commit is contained in:
Evan Kranzler 2019-06-18 21:50:18 -04:00
parent 82e256eb97
commit 5c4923d2a5
2 changed files with 76 additions and 0 deletions
Mage.Sets/src/mage

View file

@ -0,0 +1,75 @@
package mage.cards.g;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
import java.util.stream.Collectors;
/**
* @author TheElk801
*/
public final class GrowthCycle extends CardImpl {
public GrowthCycle(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
// Target creature gets +3/+3 until end of turn. It gets an additional +2/+2 until end of turn for each card named Growth Cycle in your graveyard.
this.getSpellAbility().addEffect(new BoostTargetEffect(
GrowthCycleValue.instance, GrowthCycleValue.instance,
Duration.EndOfTurn, true
).setText("Target creature gets +3/+3 until end of turn. " +
"It gets an additional +2/+2 until end of turn " +
"for each card named Growth Cycle in your graveyard.")
);
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
private GrowthCycle(final GrowthCycle card) {
super(card);
}
@Override
public GrowthCycle copy() {
return new GrowthCycle(this);
}
}
enum GrowthCycleValue implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
Player player = game.getPlayer(sourceAbility.getControllerId());
if (player == null) {
return 0;
}
return player
.getGraveyard()
.getCards(game)
.stream()
.map(Card::getName)
.filter(s -> s.equals("Growth Cycle"))
.collect(Collectors.reducing(0, e -> 1, Integer::sum));
}
@Override
public GrowthCycleValue copy() {
return instance;
}
@Override
public String getMessage() {
return "";
}
}

View file

@ -52,6 +52,7 @@ public final class CoreSet2020 extends ExpansionSet {
cards.add(new SetCardInfo("Flame Sweep", 139, Rarity.UNCOMMON, mage.cards.f.FlameSweep.class));
cards.add(new SetCardInfo("Flood of Tears", 59, Rarity.RARE, mage.cards.f.FloodOfTears.class));
cards.add(new SetCardInfo("Goblin Ringleader", 141, Rarity.UNCOMMON, mage.cards.g.GoblinRingleader.class));
cards.add(new SetCardInfo("Growth Cycle", 175, Rarity.COMMON, mage.cards.g.GrowthCycle.class));
cards.add(new SetCardInfo("Hanged Executioner", 22, Rarity.RARE, mage.cards.h.HangedExecutioner.class));
cards.add(new SetCardInfo("Infuriate", 145, Rarity.COMMON, mage.cards.i.Infuriate.class));
cards.add(new SetCardInfo("Ironroot Warlord", 209, Rarity.UNCOMMON, mage.cards.i.IronrootWarlord.class));