Skip to content

Commit

Permalink
[OTJ] Implement Lazav, Familiar Stranger
Browse files Browse the repository at this point in the history
  • Loading branch information
Susucre committed Apr 3, 2024
1 parent 73287e3 commit 6d31808
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 0 deletions.
107 changes: 107 additions & 0 deletions Mage.Sets/src/mage/cards/l/LazavFamiliarStranger.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
package mage.cards.l;

import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.CommittedCrimeTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentCard;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.common.TargetCardInGraveyard;

import java.util.UUID;

/**
* @author Susucr
*/
public final class LazavFamiliarStranger extends CardImpl {

public LazavFamiliarStranger(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{B}");

this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.SHAPESHIFTER);
this.power = new MageInt(1);
this.toughness = new MageInt(4);

// Whenever you commit a crime, put a +1/+1 counter on Lazav, Familiar Stranger. Then you may exile a card from a graveyard. If a creature card was exiled this way, you may have Lazav become a copy of that card until end of turn. This ability triggers only once each turn.
Ability ability = new CommittedCrimeTriggeredAbility(
new AddCountersSourceEffect(CounterType.P1P1.createInstance())
).setTriggersOnceEachTurn(true);
ability.addEffect(new LazavFamiliarStrangerEffect());
this.addAbility(ability);
}

private LazavFamiliarStranger(final LazavFamiliarStranger card) {
super(card);
}

@Override
public LazavFamiliarStranger copy() {
return new LazavFamiliarStranger(this);
}
}

class LazavFamiliarStrangerEffect extends OneShotEffect {

LazavFamiliarStrangerEffect() {
super(Outcome.PutCreatureInPlay);
staticText = "Then you may exile a card from a graveyard. "
+ "If a creature card was exiled this way, "
+ "you may have {this} become a copy of that card until end of turn.";
}

private LazavFamiliarStrangerEffect(final LazavFamiliarStrangerEffect effect) {
super(effect);
}

@Override
public LazavFamiliarStrangerEffect copy() {
return new LazavFamiliarStrangerEffect(this);
}

@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
TargetCard target = new TargetCardInGraveyard(0, 1);
target.withNotTarget(true);
player.choose(outcome, target, source, game);
Card card = game.getCard(target.getFirstTarget());
if (card == null) {
return false;
}
boolean flag = card.isCreature(game);
player.moveCards(card, Zone.EXILED, source, game);
if (!flag) {
return true;
}
Permanent lazav = game.getPermanent(source.getSourceId());
if (lazav == null) {
return true;
}
if (player.chooseUse(
Outcome.PutCreatureInPlay,
"Do you want " + lazav.getLogName() + " to become a copy of " + card.getLogName() + " until end of turn?",
source, game
)) {
game.copyPermanent(
Duration.EndOfTurn,
new PermanentCard(card, source.getControllerId(), game),
source.getSourceId(), source, null
);
}
return true;
}

}
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ private OutlawsOfThunderJunction() {
cards.add(new SetCardInfo("Lassoed by the Law", 18, Rarity.UNCOMMON, mage.cards.l.LassoedByTheLaw.class));
cards.add(new SetCardInfo("Laughing Jasper Flint", 215, Rarity.RARE, mage.cards.l.LaughingJasperFlint.class));
cards.add(new SetCardInfo("Lavaspur Boots", 243, Rarity.UNCOMMON, mage.cards.l.LavaspurBoots.class));
cards.add(new SetCardInfo("Lazav, Familiar Stranger", 216, Rarity.UNCOMMON, mage.cards.l.LazavFamiliarStranger.class));
cards.add(new SetCardInfo("Lilah, Undefeated Slickshot", 217, Rarity.RARE, mage.cards.l.LilahUndefeatedSlickshot.class));
cards.add(new SetCardInfo("Lively Dirge", 93, Rarity.UNCOMMON, mage.cards.l.LivelyDirge.class));
cards.add(new SetCardInfo("Loan Shark", 55, Rarity.COMMON, mage.cards.l.LoanShark.class));
Expand Down

0 comments on commit 6d31808

Please sign in to comment.