[DMU] Implemented Knight of Dawn's Light

This commit is contained in:
Daniel Bomar 2022-08-26 12:34:29 -05:00
parent c8c7e266a3
commit cff95f9c88
No known key found for this signature in database
GPG key ID: C86C8658F4023918
2 changed files with 90 additions and 0 deletions

View file

@ -0,0 +1,89 @@
package mage.cards.k;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author weirddan455
*/
public final class KnightOfDawnsLight extends CardImpl {
public KnightOfDawnsLight(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.KNIGHT);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// First strike
this.addAbility(FirstStrikeAbility.getInstance());
// If you would gain life, you gain that much life plus 1 instead.
this.addAbility(new SimpleStaticAbility(new KnightOfDawnsLightEffect()));
// {1}{W}: Knight of Dawn's Light gets +1/+1 until end of turn.
this.addAbility(new SimpleActivatedAbility(
new BoostSourceEffect(1, 1, Duration.EndOfTurn),
new ManaCostsImpl<>("{1}{W}")
));
}
private KnightOfDawnsLight(final KnightOfDawnsLight card) {
super(card);
}
@Override
public KnightOfDawnsLight copy() {
return new KnightOfDawnsLight(this);
}
}
class KnightOfDawnsLightEffect extends ReplacementEffectImpl {
public KnightOfDawnsLightEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);
this.staticText = "If you would gain life, you gain that much life plus 1 instead.";
}
private KnightOfDawnsLightEffect(final KnightOfDawnsLightEffect effect) {
super(effect);
}
@Override
public KnightOfDawnsLightEffect copy() {
return new KnightOfDawnsLightEffect(this);
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
event.setAmount(event.getAmount() + 1);
return false;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.GAIN_LIFE;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return source.isControlledBy(event.getPlayerId());
}
}

View file

@ -86,6 +86,7 @@ public final class DominariaUnited extends ExpansionSet {
cards.add(new SetCardInfo("Juniper Order Rootweaver", 22, Rarity.COMMON, mage.cards.j.JuniperOrderRootweaver.class));
cards.add(new SetCardInfo("Karplusan Forest", 250, Rarity.RARE, mage.cards.k.KarplusanForest.class));
cards.add(new SetCardInfo("King Darien XLVIII", 204, Rarity.RARE, mage.cards.k.KingDarienXLVIII.class));
cards.add(new SetCardInfo("Knight of Dawn's Light", 23, Rarity.UNCOMMON, mage.cards.k.KnightOfDawnsLight.class));
cards.add(new SetCardInfo("Lagomos, Hand of Hatred", 205, Rarity.UNCOMMON, mage.cards.l.LagomosHandOfHatred.class));
cards.add(new SetCardInfo("Leaf-Crowned Visionary", 167, Rarity.RARE, mage.cards.l.LeafCrownedVisionary.class));
cards.add(new SetCardInfo("Lightning Strike", 137, Rarity.COMMON, mage.cards.l.LightningStrike.class));