[AFR] Implemented Spoils of the Hunt

This commit is contained in:
Evan Kranzler 2021-07-08 08:08:21 -04:00
parent d3640103b2
commit 0b05162b66
3 changed files with 75 additions and 1 deletions

View file

@ -38,7 +38,7 @@ public final class KalainReclusivePainter extends CardImpl {
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new TreasureToken())));
// Other creatures you control enter the battlefield with an additional +1/+1 counter on them for each mana from a Treasure spent to cast them.
this.addAbility(new SimpleStaticAbility(new KalainReclusivePainterEffect()));
this.addAbility(new SimpleStaticAbility(new KalainReclusivePainterEffect()), new ManaPaidSourceWatcher());
}
private KalainReclusivePainter(final KalainReclusivePainter card) {

View file

@ -0,0 +1,73 @@
package mage.cards.s;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageWithPowerFromOneToAnotherTargetEffect;
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.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetOpponentsCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
import mage.watchers.common.ManaPaidSourceWatcher;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SpoilsOfTheHunt extends CardImpl {
public SpoilsOfTheHunt(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}");
// Target creature you control gets +1/+0 until end of turn for each mana from a Treasure that was spent to cast this spell. Then that creature deals damage equal to its power to target creature an opponent controls.
this.getSpellAbility().addEffect(new SpoilsOfTheHuntEffect());
this.getSpellAbility().addEffect(new DamageWithPowerFromOneToAnotherTargetEffect().setText(
"Then that creature deals damage equal to its power to target creature an opponent controls"
));
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetOpponentsCreaturePermanent());
this.getSpellAbility().addWatcher(new ManaPaidSourceWatcher());
}
private SpoilsOfTheHunt(final SpoilsOfTheHunt card) {
super(card);
}
@Override
public SpoilsOfTheHunt copy() {
return new SpoilsOfTheHunt(this);
}
}
class SpoilsOfTheHuntEffect extends OneShotEffect {
SpoilsOfTheHuntEffect() {
super(Outcome.Benefit);
staticText = "target creature you control gets +1/+0 until end of turn " +
"for each mana from a Treasure that was spent to cast this spell";
}
private SpoilsOfTheHuntEffect(final SpoilsOfTheHuntEffect effect) {
super(effect);
}
@Override
public SpoilsOfTheHuntEffect copy() {
return new SpoilsOfTheHuntEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
int treasurePaid = ManaPaidSourceWatcher.getTreasurePaid(source.getId(), game);
game.addEffect(new BoostTargetEffect(
treasurePaid, 0, Duration.EndOfTurn
).setTargetPointer(new FixedTarget(source.getFirstTarget(), game)), source);
return true;
}
}

View file

@ -196,6 +196,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet {
cards.add(new SetCardInfo("Sphere of Annihilation", 121, Rarity.RARE, mage.cards.s.SphereOfAnnihilation.class));
cards.add(new SetCardInfo("Spike Pit Trap", 251, Rarity.COMMON, mage.cards.s.SpikePitTrap.class));
cards.add(new SetCardInfo("Split the Party", 76, Rarity.UNCOMMON, mage.cards.s.SplitTheParty.class));
cards.add(new SetCardInfo("Spoils of the Hunt", 205, Rarity.COMMON, mage.cards.s.SpoilsOfTheHunt.class));
cards.add(new SetCardInfo("Steadfast Paladin", 38, Rarity.COMMON, mage.cards.s.SteadfastPaladin.class));
cards.add(new SetCardInfo("Sudden Insight", 77, Rarity.UNCOMMON, mage.cards.s.SuddenInsight.class));
cards.add(new SetCardInfo("Swamp", 270, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));