mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
[STX] Implemented Exponential Growth
This commit is contained in:
parent
49465c69d7
commit
b080d831ce
2 changed files with 75 additions and 0 deletions
74
Mage.Sets/src/mage/cards/e/ExponentialGrowth.java
Normal file
74
Mage.Sets/src/mage/cards/e/ExponentialGrowth.java
Normal file
|
|
@ -0,0 +1,74 @@
|
||||||
|
package mage.cards.e;
|
||||||
|
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public final class ExponentialGrowth extends CardImpl {
|
||||||
|
|
||||||
|
public ExponentialGrowth(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{G}{G}");
|
||||||
|
|
||||||
|
// Until end of turn, double target creature's power X times.
|
||||||
|
this.getSpellAbility().addEffect(new ExponentialGrowthEffect());
|
||||||
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||||
|
}
|
||||||
|
|
||||||
|
private ExponentialGrowth(final ExponentialGrowth card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ExponentialGrowth copy() {
|
||||||
|
return new ExponentialGrowth(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ExponentialGrowthEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
ExponentialGrowthEffect() {
|
||||||
|
super(Outcome.Benefit);
|
||||||
|
staticText = "until end of turn, double target creature's power X times";
|
||||||
|
}
|
||||||
|
|
||||||
|
private ExponentialGrowthEffect(final ExponentialGrowthEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ExponentialGrowthEffect copy() {
|
||||||
|
return new ExponentialGrowthEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||||
|
if (permanent == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
int xValue = source.getManaCostsToPay().getX();
|
||||||
|
int multiplier = 1;
|
||||||
|
for (int i = 0; i < xValue; i++) {
|
||||||
|
multiplier = CardUtil.overflowMultiply(multiplier, 2);
|
||||||
|
}
|
||||||
|
multiplier = CardUtil.overflowDec(multiplier, 1);
|
||||||
|
game.addEffect(new BoostTargetEffect(CardUtil.overflowMultiply(
|
||||||
|
multiplier, permanent.getPower().getValue()
|
||||||
|
), 0, Duration.EndOfTurn), source);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -62,6 +62,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Eureka Moment", 184, Rarity.COMMON, mage.cards.e.EurekaMoment.class));
|
cards.add(new SetCardInfo("Eureka Moment", 184, Rarity.COMMON, mage.cards.e.EurekaMoment.class));
|
||||||
cards.add(new SetCardInfo("Expanded Anatomy", 2, Rarity.COMMON, mage.cards.e.ExpandedAnatomy.class));
|
cards.add(new SetCardInfo("Expanded Anatomy", 2, Rarity.COMMON, mage.cards.e.ExpandedAnatomy.class));
|
||||||
cards.add(new SetCardInfo("Expel", 18, Rarity.COMMON, mage.cards.e.Expel.class));
|
cards.add(new SetCardInfo("Expel", 18, Rarity.COMMON, mage.cards.e.Expel.class));
|
||||||
|
cards.add(new SetCardInfo("Exponential Growth", 130, Rarity.RARE, mage.cards.e.ExponentialGrowth.class));
|
||||||
cards.add(new SetCardInfo("Field Trip", 131, Rarity.COMMON, mage.cards.f.FieldTrip.class));
|
cards.add(new SetCardInfo("Field Trip", 131, Rarity.COMMON, mage.cards.f.FieldTrip.class));
|
||||||
cards.add(new SetCardInfo("Forest", 374, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Forest", 374, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Fortifying Draught", 132, Rarity.UNCOMMON, mage.cards.f.FortifyingDraught.class));
|
cards.add(new SetCardInfo("Fortifying Draught", 132, Rarity.UNCOMMON, mage.cards.f.FortifyingDraught.class));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue