[SNC] Implemented Case the Joint

This commit is contained in:
Evan Kranzler 2022-04-15 08:54:12 -04:00
parent 5400b9c911
commit a57d76f6a6
2 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,75 @@
package mage.cards.c;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class CaseTheJoint extends CardImpl {
public CaseTheJoint(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}");
// Draw two cards, then look at the top card of each player's library.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2));
this.getSpellAbility().addEffect(new CaseTheJointEffect());
}
private CaseTheJoint(final CaseTheJoint card) {
super(card);
}
@Override
public CaseTheJoint copy() {
return new CaseTheJoint(this);
}
}
class CaseTheJointEffect extends OneShotEffect {
CaseTheJointEffect() {
super(Outcome.Benefit);
staticText = ", then look at the top card of each player's library";
}
private CaseTheJointEffect(final CaseTheJointEffect effect) {
super(effect);
}
@Override
public CaseTheJointEffect copy() {
return new CaseTheJointEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
continue;
}
Card card = player.getLibrary().getFromTop(game);
if (card == null) {
continue;
}
controller.lookAtCards(source, "Top card of " + player.getName() + "'s library", new CardsImpl(card), game);
}
return true;
}
}

View file

@ -51,6 +51,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet {
cards.add(new SetCardInfo("Cabaretti Initiate", 137, Rarity.COMMON, mage.cards.c.CabarettiInitiate.class));
cards.add(new SetCardInfo("Caldaia Strongarm", 138, Rarity.COMMON, mage.cards.c.CaldaiaStrongarm.class));
cards.add(new SetCardInfo("Call In a Professional", 103, Rarity.UNCOMMON, mage.cards.c.CallInAProfessional.class));
cards.add(new SetCardInfo("Case the Joint", 37, Rarity.COMMON, mage.cards.c.CaseTheJoint.class));
cards.add(new SetCardInfo("Celebrity Fencer", 7, Rarity.COMMON, mage.cards.c.CelebrityFencer.class));
cards.add(new SetCardInfo("Celestial Regulator", 174, Rarity.COMMON, mage.cards.c.CelestialRegulator.class));
cards.add(new SetCardInfo("Cemetery Tampering", 69, Rarity.RARE, mage.cards.c.CemeteryTampering.class));