From 22066aa921685ffa9137dffc1732646f6834be2e Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 15 Jul 2021 08:16:56 -0400 Subject: [PATCH] [AFR] Implemented Paladin Class --- Mage.Sets/src/mage/cards/p/PaladinClass.java | 88 +++++++++++++++++++ .../sets/AdventuresInTheForgottenRealms.java | 1 + 2 files changed, 89 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/p/PaladinClass.java diff --git a/Mage.Sets/src/mage/cards/p/PaladinClass.java b/Mage.Sets/src/mage/cards/p/PaladinClass.java new file mode 100644 index 0000000000..0339e5a6ca --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PaladinClass.java @@ -0,0 +1,88 @@ +package mage.cards.p; + +import mage.abilities.Ability; +import mage.abilities.common.AttacksWithCreaturesTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.MyTurnCondition; +import mage.abilities.decorator.ConditionalCostModificationEffect; +import mage.abilities.dynamicvalue.AdditiveDynamicValue; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.continuous.GainClassAbilitySourceEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; +import mage.abilities.keyword.ClassLevelAbility; +import mage.abilities.keyword.ClassReminderAbility; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.filter.StaticFilters; +import mage.target.common.TargetAttackingCreature; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class PaladinClass extends CardImpl { + + private static final DynamicValue xValue = new AdditiveDynamicValue( + new PermanentsOnBattlefieldCount(StaticFilters.FILTER_ATTACKING_CREATURES), StaticValue.get(-1) + ); + + public PaladinClass(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}"); + + this.subtype.add(SubType.CLASS); + + // (Gain the next level as a sorcery to add its ability.) + this.addAbility(new ClassReminderAbility()); + + // Spells your opponents cast during your turn cost {1} more to cast. + this.addAbility(new SimpleStaticAbility(new ConditionalCostModificationEffect( + new SpellsCostIncreasingAllEffect( + 2, StaticFilters.FILTER_CARD, TargetController.OPPONENT + ), MyTurnCondition.instance, "spells your opponents cast during your turn cost {1} more to cast" + ))); + + // {2}{W}: Level 2 + this.addAbility(new ClassLevelAbility(2, "{2}{W}")); + + // Creatures you control get +1/+1. + this.addAbility(new SimpleStaticAbility(new GainClassAbilitySourceEffect( + new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield), 2 + ))); + + // {4}{W}: Level 3 + this.addAbility(new ClassLevelAbility(3, "{4}{W}")); + + // Whenever you attack, until end of turn, target attacking creature gets +1/+1 for each other attacking creature and gains double strike. + Ability ability = new AttacksWithCreaturesTriggeredAbility( + new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true) + .setText("until end of turn, target attacking creature " + + "gets +1/+1 for each other attacking creature"), + 0 + ); + ability.addEffect(new GainAbilityTargetEffect( + DoubleStrikeAbility.getInstance(), Duration.EndOfTurn + ).setText("and gains double strike")); + ability.addTarget(new TargetAttackingCreature()); + this.addAbility(new SimpleStaticAbility(new GainClassAbilitySourceEffect(ability, 3))); + } + + private PaladinClass(final PaladinClass card) { + super(card); + } + + @Override + public PaladinClass copy() { + return new PaladinClass(this); + } +} diff --git a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java index 1ca62b09d2..0a26afa905 100644 --- a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java +++ b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java @@ -173,6 +173,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet { cards.add(new SetCardInfo("Orcus, Prince of Undeath", 229, Rarity.RARE, mage.cards.o.OrcusPrinceOfUndeath.class)); cards.add(new SetCardInfo("Oswald Fiddlebender", 28, Rarity.RARE, mage.cards.o.OswaldFiddlebender.class)); cards.add(new SetCardInfo("Owlbear", 198, Rarity.COMMON, mage.cards.o.Owlbear.class)); + cards.add(new SetCardInfo("Paladin Class", 29, Rarity.RARE, mage.cards.p.PaladinClass.class)); cards.add(new SetCardInfo("Paladin's Shield", 30, Rarity.COMMON, mage.cards.p.PaladinsShield.class)); cards.add(new SetCardInfo("Plains", 262, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Planar Ally", 31, Rarity.COMMON, mage.cards.p.PlanarAlly.class));