mirror of
https://github.com/correl/mage.git
synced 2024-12-27 20:06:31 +00:00
[J22] Implement Ingenious Leonin
This commit is contained in:
parent
65ce12bcfd
commit
fb0668500e
2 changed files with 96 additions and 0 deletions
95
Mage.Sets/src/mage/cards/i/IngeniousLeonin.java
Normal file
95
Mage.Sets/src/mage/cards/i/IngeniousLeonin.java
Normal file
|
@ -0,0 +1,95 @@
|
|||
package mage.cards.i;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherPredicate;
|
||||
import mage.filter.predicate.permanent.AttackingPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class IngeniousLeonin extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter
|
||||
= new FilterControlledCreaturePermanent("another target attacking creature you control");
|
||||
|
||||
static {
|
||||
filter.add(AnotherPredicate.instance);
|
||||
filter.add(AttackingPredicate.instance);
|
||||
}
|
||||
|
||||
public IngeniousLeonin(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}");
|
||||
|
||||
this.subtype.add(SubType.CAT);
|
||||
this.subtype.add(SubType.SOLDIER);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// {3}{W}: Put a +1/+1 counter on another target attacking creature you control. If that creature is a Cat, it gains first strike until end of turn.
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
new AddCountersTargetEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl<>("{3}{W}")
|
||||
);
|
||||
ability.addEffect(new IngeniousLeoninEffect());
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
}
|
||||
|
||||
private IngeniousLeonin(final IngeniousLeonin card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IngeniousLeonin copy() {
|
||||
return new IngeniousLeonin(this);
|
||||
}
|
||||
}
|
||||
|
||||
class IngeniousLeoninEffect extends OneShotEffect {
|
||||
|
||||
IngeniousLeoninEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "If that creature is a Cat, it gains first strike until end of turn";
|
||||
}
|
||||
|
||||
private IngeniousLeoninEffect(final IngeniousLeoninEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IngeniousLeoninEffect copy() {
|
||||
return new IngeniousLeoninEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (permanent != null && permanent.hasSubtype(SubType.CAT, game)) {
|
||||
game.addEffect(new GainAbilityTargetEffect(
|
||||
FirstStrikeAbility.getInstance(), Duration.EndOfTurn
|
||||
).setTargetPointer(new FixedTarget(permanent, game)), source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -362,6 +362,7 @@ public final class Jumpstart2022 extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Infantry Veteran", 198, Rarity.COMMON, mage.cards.i.InfantryVeteran.class));
|
||||
cards.add(new SetCardInfo("Infernal Idol", 49, Rarity.COMMON, mage.cards.i.InfernalIdol.class));
|
||||
cards.add(new SetCardInfo("Infiltration Lens", 777, Rarity.UNCOMMON, mage.cards.i.InfiltrationLens.class));
|
||||
cards.add(new SetCardInfo("Ingenious Leonin", 5, Rarity.UNCOMMON, mage.cards.i.IngeniousLeonin.class));
|
||||
cards.add(new SetCardInfo("Inner Demon", 428, Rarity.UNCOMMON, mage.cards.i.InnerDemon.class));
|
||||
cards.add(new SetCardInfo("Inspiring Cleric", 199, Rarity.UNCOMMON, mage.cards.i.InspiringCleric.class));
|
||||
cards.add(new SetCardInfo("Inspiring Overseer", 200, Rarity.COMMON, mage.cards.i.InspiringOverseer.class));
|
||||
|
|
Loading…
Reference in a new issue