[AFR] Implemented Choose Your Weapon

This commit is contained in:
Evan Kranzler 2021-06-30 09:08:32 -04:00
parent 74bb1f895c
commit 93ea276e83
2 changed files with 90 additions and 0 deletions

View file

@ -0,0 +1,89 @@
package mage.cards.c;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ChooseYourWeapon extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("creature with flying");
static {
filter.add(new AbilityPredicate(FlyingAbility.class));
}
public ChooseYourWeapon(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}");
// Choose one
// Two-Weapon Fighting Double target creature's power and toughness until end of turn.
this.getSpellAbility().addEffect(new ChooseYourWeaponEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().withFirstModeFlavorWord("Two-Weapon Fighting");
// Archery This spell deals 5 damage to target creature with flying.
Mode mode = new Mode(new DamageTargetEffect(5, "this spell"));
mode.addTarget(new TargetPermanent(filter));
this.getSpellAbility().addMode(mode.withFlavorWord("Archery"));
}
private ChooseYourWeapon(final ChooseYourWeapon card) {
super(card);
}
@Override
public ChooseYourWeapon copy() {
return new ChooseYourWeapon(this);
}
}
class ChooseYourWeaponEffect extends OneShotEffect {
ChooseYourWeaponEffect() {
super(Outcome.Benefit);
staticText = "double target creature's power and toughness until end of turn";
}
private ChooseYourWeaponEffect(final ChooseYourWeaponEffect effect) {
super(effect);
}
@Override
public ChooseYourWeaponEffect copy() {
return new ChooseYourWeaponEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
game.addEffect(new BoostTargetEffect(
permanent.getPower().getValue(),
permanent.getToughness().getValue(),
Duration.EndOfTurn
), source);
return true;
}
}

View file

@ -33,6 +33,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet {
cards.add(new SetCardInfo("Cave of the Frost Dragon", 253, Rarity.RARE, mage.cards.c.CaveOfTheFrostDragon.class));
cards.add(new SetCardInfo("Celestial Unicorn", 5, Rarity.COMMON, mage.cards.c.CelestialUnicorn.class));
cards.add(new SetCardInfo("Charmed Sleep", 50, Rarity.COMMON, mage.cards.c.CharmedSleep.class));
cards.add(new SetCardInfo("Choose Your Weapon", 175, Rarity.UNCOMMON, mage.cards.c.ChooseYourWeapon.class));
cards.add(new SetCardInfo("Circle of Dreams Druid", 176, Rarity.RARE, mage.cards.c.CircleOfDreamsDruid.class));
cards.add(new SetCardInfo("Cloister Gargoyle", 7, Rarity.UNCOMMON, mage.cards.c.CloisterGargoyle.class));
cards.add(new SetCardInfo("Dawnbringer Cleric", 9, Rarity.COMMON, mage.cards.d.DawnbringerCleric.class));