Skip to content

Commit

Permalink
[OTJ] Implement Quick Draw
Browse files Browse the repository at this point in the history
  • Loading branch information
Susucre committed Apr 4, 2024
1 parent 28f4080 commit 5a457b1
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
84 changes: 84 additions & 0 deletions Mage.Sets/src/mage/cards/q/QuickDraw.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package mage.cards.q;

import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.effects.common.continuous.LoseAbilityAllEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetOpponent;
import mage.target.targetpointer.SecondTargetPointer;

import java.util.UUID;

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

public QuickDraw(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}");

// Target creature you control gets +1/+1 and gains first strike until end of turn. Creatures target opponent controls lose first strike and double strike until end of turn.
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetOpponent());
this.getSpellAbility().addEffect(new BoostTargetEffect(1, 1)
.setText("Target creature you control gets +1/+1"));
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance())
.setText(" and gains first strike until end of turn."));
this.getSpellAbility().addEffect(new QuickDrawEffect().setTargetPointer(new SecondTargetPointer()));
}

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

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

class QuickDrawEffect extends OneShotEffect {

QuickDrawEffect() {
super(Outcome.UnboostCreature);
staticText = "Creatures target opponent controls lose first strike and double strike until end of turn.";
}

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

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

@Override
public boolean apply(Game game, Ability source) {
Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source));
if (opponent == null) {
return false;
}

FilterPermanent filter = new FilterCreaturePermanent();
filter.add(new ControllerIdPredicate(opponent.getId()));
game.addEffect(new LoseAbilityAllEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, filter), source);
game.addEffect(new LoseAbilityAllEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn, filter), source);
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 @@ -201,6 +201,7 @@ private OutlawsOfThunderJunction() {
cards.add(new SetCardInfo("Prairie Dog", 24, Rarity.UNCOMMON, mage.cards.p.PrairieDog.class));
cards.add(new SetCardInfo("Prickly Pair", 137, Rarity.COMMON, mage.cards.p.PricklyPair.class));
cards.add(new SetCardInfo("Prosperity Tycoon", 25, Rarity.UNCOMMON, mage.cards.p.ProsperityTycoon.class));
cards.add(new SetCardInfo("Quick Draw", 138, Rarity.COMMON, mage.cards.q.QuickDraw.class));
cards.add(new SetCardInfo("Quilled Charger", 139, Rarity.COMMON, mage.cards.q.QuilledCharger.class));
cards.add(new SetCardInfo("Railway Brawler", 175, Rarity.MYTHIC, mage.cards.r.RailwayBrawler.class));
cards.add(new SetCardInfo("Rakdos Joins Up", 225, Rarity.RARE, mage.cards.r.RakdosJoinsUp.class));
Expand Down

0 comments on commit 5a457b1

Please sign in to comment.