Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DSK] Implement Grab the Prize #13049

Merged
merged 5 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions Mage.Sets/src/mage/cards/g/GrabThePrize.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package mage.cards.g;

import java.util.Collection;
import java.util.UUID;

import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.DamagePlayersEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.game.Game;
import mage.util.CardUtil;

/**
* @author Jamaninja
*/
public final class GrabThePrize extends CardImpl {

public GrabThePrize(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}");

// As an additional cost to cast this spell, discard a card.
this.getSpellAbility().addCost(new DiscardCardCost());

// Draw two cards.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2));

// If the discarded card wasn't a land card, {this} deals two damage to each opponent.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Miss comment with full ability text

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this was my first card. Should I include the comment in a commit the next time I upload a card?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can edit and add commit to your version, it will be available in that PR too.

new DamagePlayersEffect(2, TargetController.OPPONENT),
GrabThePrizeCondition.instance,
"If the discarded card wasn't a land card, {this} deals two damage to each opponent."));
}

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

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

enum GrabThePrizeCondition implements Condition {
instance;

@Override
public boolean apply(Game game, Ability source) {
return CardUtil.castStream(source.getCosts().stream(), DiscardCardCost.class)
.map(DiscardCardCost::getCards)
.flatMap(Collection::stream)
.anyMatch(card -> !card.isLand(game));
}
}
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ private DuskmournHouseOfHorror() {
cards.add(new SetCardInfo("Glimmerburst", 62, Rarity.COMMON, mage.cards.g.Glimmerburst.class));
cards.add(new SetCardInfo("Glimmerlight", 249, Rarity.COMMON, mage.cards.g.Glimmerlight.class));
cards.add(new SetCardInfo("Gloomlake Verge", 260, Rarity.RARE, mage.cards.g.GloomlakeVerge.class));
cards.add(new SetCardInfo("Grab the Prize", 138, Rarity.COMMON, mage.cards.g.GrabThePrize.class));
cards.add(new SetCardInfo("Grasping Longneck", 180, Rarity.COMMON, mage.cards.g.GraspingLongneck.class));
cards.add(new SetCardInfo("Gremlin Tamer", 215, Rarity.UNCOMMON, mage.cards.g.GremlinTamer.class));
cards.add(new SetCardInfo("Grievous Wound", 102, Rarity.RARE, mage.cards.g.GrievousWound.class));
Expand Down
Loading