implement [MKM] Delney, Streetwise Lookout

This commit is contained in:
xenohedron 2024-02-04 16:33:20 -05:00
parent 5c7a27b231
commit 035c0254de
2 changed files with 96 additions and 0 deletions

View file

@ -0,0 +1,95 @@
package mage.cards.d;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.PowerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
* @author xenohedron
*/
public final class DelneyStreetwiseLookout extends CardImpl {
private static final FilterCreaturePermanent filterSmall = new FilterCreaturePermanent("creatures you control with power 2 or less");
private static final FilterCreaturePermanent filterBig = new FilterCreaturePermanent("creatures with power 3 or greater");
static {
filterSmall.add(new PowerPredicate(ComparisonType.OR_LESS, 2));
filterSmall.add(TargetController.YOU.getControllerPredicate());
filterBig.add(new PowerPredicate(ComparisonType.OR_GREATER, 3));
}
public DelneyStreetwiseLookout(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.SCOUT);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Creatures you control with power 2 or less can't be blocked by creatures with power 3 or greater.
this.addAbility(new SimpleStaticAbility(new CantBeBlockedByCreaturesAllEffect(
filterSmall, filterBig, Duration.WhileOnBattlefield
)));
// If an ability of a creature you control with power 2 or less triggers, that ability triggers an additional time.
this.addAbility(new SimpleStaticAbility(new DelneyStreetwiseLookoutEffect()));
}
private DelneyStreetwiseLookout(final DelneyStreetwiseLookout card) {
super(card);
}
@Override
public DelneyStreetwiseLookout copy() {
return new DelneyStreetwiseLookout(this);
}
}
class DelneyStreetwiseLookoutEffect extends ReplacementEffectImpl {
DelneyStreetwiseLookoutEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "if an ability of a creature you control with power 2 or less triggers, that ability triggers an additional time";
}
private DelneyStreetwiseLookoutEffect(final DelneyStreetwiseLookoutEffect effect) {
super(effect);
}
@Override
public DelneyStreetwiseLookoutEffect copy() {
return new DelneyStreetwiseLookoutEffect(this);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.NUMBER_OF_TRIGGERS;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent permanent = game.getPermanent(event.getSourceId());
return permanent != null
&& permanent.isCreature(game)
&& permanent.isControlledBy(source.getControllerId())
&& permanent.getPower().getValue() <= 2;
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
event.setAmount(event.getAmount() + 1);
return false;
}
}

View file

@ -81,6 +81,7 @@ public final class MurdersAtKarlovManor extends ExpansionSet {
cards.add(new SetCardInfo("Deadly Complication", 195, Rarity.UNCOMMON, mage.cards.d.DeadlyComplication.class));
cards.add(new SetCardInfo("Deduce", 52, Rarity.COMMON, mage.cards.d.Deduce.class));
cards.add(new SetCardInfo("Defenestrated Phantom", 11, Rarity.COMMON, mage.cards.d.DefenestratedPhantom.class));
cards.add(new SetCardInfo("Delney, Streetwise Lookout", 12, Rarity.MYTHIC, mage.cards.d.DelneyStreetwiseLookout.class));
cards.add(new SetCardInfo("Demand Answers", 122, Rarity.COMMON, mage.cards.d.DemandAnswers.class));
cards.add(new SetCardInfo("Detective's Satchel", 196, Rarity.UNCOMMON, mage.cards.d.DetectivesSatchel.class));
cards.add(new SetCardInfo("Dog Walker", 197, Rarity.COMMON, mage.cards.d.DogWalker.class));