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

[ACR] Implement 4x Equipment-related cards #12593

Merged
merged 8 commits into from
Jul 23, 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
64 changes: 64 additions & 0 deletions Mage.Sets/src/mage/cards/a/AssassinGauntlet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package mage.cards.a;

import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DrawDiscardControllerEffect;
import mage.abilities.effects.common.TapAllTargetPlayerControlsEffect;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetOpponent;
import mage.target.targetpointer.SecondTargetPointer;

import java.util.UUID;

/**
*
* @author notgreat
*/
public final class AssassinGauntlet extends CardImpl {

public AssassinGauntlet(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}{U}");

this.subtype.add(SubType.EQUIPMENT);

// When Assassin Gauntlet enters the battlefield, attach it to up to one target creature you control. Tap all creatures target opponent controls.
Ability ability = new EntersBattlefieldTriggeredAbility(new AttachEffect(Outcome.BoostCreature).setText("attach it to up to one target creature you control"));
ability.addTarget(new TargetControlledCreaturePermanent(0, 1));

ability.addEffect(new TapAllTargetPlayerControlsEffect(StaticFilters.FILTER_PERMANENT_CREATURES).setTargetPointer(new SecondTargetPointer()));
ability.addTarget(new TargetOpponent());
this.addAbility(ability);

// Equipped creature gets +1/+1 and has "Whenever this creature deals combat damage to a player, draw a card, then discard a card."
Ability boostAbility = new SimpleStaticAbility(new BoostEquippedEffect(1, 1));
Ability subAbility = new DealsCombatDamageToAPlayerTriggeredAbility(new DrawDiscardControllerEffect());
boostAbility.addEffect(new GainAbilityAttachedEffect(subAbility, AttachmentType.EQUIPMENT)
.setText("and has \""+subAbility.getRule("this creature")+"\"").concatBy(""));
this.addAbility(boostAbility);

// Equip {2}
this.addAbility(new EquipAbility(2));
}

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

@Override
public AssassinGauntlet copy() {
return new AssassinGauntlet(this);
}
}
81 changes: 81 additions & 0 deletions Mage.Sets/src/mage/cards/b/BattlefieldImprovisation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
package mage.cards.b;

import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.Target;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;

import java.util.UUID;

/**
* @author notgreat
*/
public final class BattlefieldImprovisation extends CardImpl {

public BattlefieldImprovisation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}");

// Target creature gets +2/+2 until end of turn. If that creature is attacking, you may attach any number of Equipment you control to it.
this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2));
this.getSpellAbility().addEffect(new BattlefieldImprovisationEquipEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}

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

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

// Based on Armed And Armored
class BattlefieldImprovisationEquipEffect extends OneShotEffect {

BattlefieldImprovisationEquipEffect() {
super(Outcome.Benefit);
staticText = "If that creature is attacking, you may attach any number of Equipment you control to it.";
}

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

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

@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
FilterControlledPermanent equipmentFilter = new FilterControlledPermanent(SubType.EQUIPMENT);
Permanent attacker = game.getPermanent(this.getTargetPointer().getFirst(game, source));
if (attacker != null && attacker.isAttacking()) {
Target target = new TargetPermanent(0, Integer.MAX_VALUE, equipmentFilter, true);
target.withChooseHint("equip to " + attacker.getLogName());
controller.choose(outcome, target, source, game);
for (UUID targetId : target.getTargets()) {
attacker.addAttachment(targetId, source, game);
game.informPlayers(game.getPermanent(targetId).getLogName() + " was attached to " + attacker.getLogName());
}
}
return true;
}
}
8 changes: 3 additions & 5 deletions Mage.Sets/src/mage/cards/b/BlurOfBlades.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

package mage.cards.b;

import java.util.UUID;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetControllerEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
Expand All @@ -11,6 +9,8 @@
import mage.counters.CounterType;
import mage.target.common.TargetCreaturePermanent;

import java.util.UUID;

/**
*
* @author ciaccona007
Expand All @@ -22,9 +22,7 @@ public BlurOfBlades(UUID ownerId, CardSetInfo setInfo) {

// Put a -1/-1 counter on target creature. Blur of Blades deals 2 damage to that creature's controller.
getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.M1M1.createInstance(1)));
Effect effect = new DamageTargetControllerEffect(2);
effect.setText("{this} deals 2 damage to that creature's controller");
getSpellAbility().addEffect(effect);
getSpellAbility().addEffect(new DamageTargetControllerEffect(2));
getSpellAbility().addTarget(new TargetCreaturePermanent());

}
Expand Down
8 changes: 3 additions & 5 deletions Mage.Sets/src/mage/cards/c/Cryoclasm.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

package mage.cards.c;

import java.util.UUID;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetControllerEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
Expand All @@ -13,6 +11,8 @@
import mage.filter.predicate.Predicates;
import mage.target.common.TargetLandPermanent;

import java.util.UUID;

/**
*
* @author dustinconrad
Expand All @@ -30,9 +30,7 @@ public Cryoclasm(UUID ownerId, CardSetInfo setInfo) {

// Destroy target Plains or Island. Cryoclasm deals 3 damage to that land's controller.
this.getSpellAbility().addEffect(new DestroyTargetEffect());
Effect effect = new DamageTargetControllerEffect(3);
effect.setText("{this} deals 3 damage to that land's controller");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addEffect(new DamageTargetControllerEffect(3, "land"));
this.getSpellAbility().addTarget(new TargetLandPermanent(filter));

}
Expand Down
6 changes: 1 addition & 5 deletions Mage.Sets/src/mage/cards/d/Detonate.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

package mage.cards.d;

import mage.abilities.dynamicvalue.common.GetXValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetControllerEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
Expand All @@ -25,9 +23,7 @@ public Detonate(UUID ownerId, CardSetInfo setInfo) {
// Destroy target artifact with converted mana cost X. It can't be regenerated. Detonate deals X damage to that artifact's controller.
this.getSpellAbility().addEffect(new DestroyTargetEffect(true));
this.getSpellAbility().addTarget(new TargetArtifactPermanent(new FilterArtifactPermanent("artifact with mana value X")));
Effect effect = new DamageTargetControllerEffect(GetXValue.instance);
effect.setText("{this} deals X damage to that artifact's controller");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addEffect(new DamageTargetControllerEffect(GetXValue.instance, "artifact"));
this.getSpellAbility().addTarget(new TargetArtifactPermanent());
this.getSpellAbility().setTargetAdjuster(new XManaValueTargetAdjuster());
}
Expand Down
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/d/DistractTheGuards.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public DistractTheGuards(UUID ownerId, CardSetInfo setInfo) {
this.addAbility(new FreerunningAbility("{1}{W}"));

// Create three 1/1 white Human Rogue creature tokens.
this.getSpellAbility().addEffect(new CreateTokenEffect(new HumanRogueToken()));
this.getSpellAbility().addEffect(new CreateTokenEffect(new HumanRogueToken(), 3));
}

private DistractTheGuards(final DistractTheGuards card) {
Expand Down
5 changes: 3 additions & 2 deletions Mage.Sets/src/mage/cards/f/FodderLaunch.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

package mage.cards.f;

import java.util.UUID;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.common.DamageTargetControllerEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
Expand All @@ -13,6 +12,8 @@
import mage.filter.FilterPermanent;
import mage.target.common.TargetCreaturePermanent;

import java.util.UUID;

/**
* @author BursegSardaukar
*/
Expand All @@ -30,7 +31,7 @@ public FodderLaunch(UUID ownerId, CardSetInfo setInfo) {
//Target creature gets -5/-5 until end of turn. Fodder Launch deals 5 damage to that creature's controller.
this.getSpellAbility().addEffect(new BoostTargetEffect(-5, -5, Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new DamageTargetControllerEffect(5).setText("{this} deals 5 damage to that creature's controller"));
this.getSpellAbility().addEffect(new DamageTargetControllerEffect(5));
}

private FodderLaunch(final FodderLaunch card) {
Expand Down
8 changes: 3 additions & 5 deletions Mage.Sets/src/mage/cards/g/GrotagSiegeRunner.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@

package mage.cards.g;

import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetControllerEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.DefenderAbility;
Expand All @@ -20,6 +18,8 @@
import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.target.common.TargetCreaturePermanent;

import java.util.UUID;

/**
*
* @author North
Expand All @@ -43,9 +43,7 @@ public GrotagSiegeRunner(UUID ownerId, CardSetInfo setInfo) {
// {R}, Sacrifice Grotag Siege-Runner: Destroy target creature with defender. Grotag Siege-Runner deals 2 damage to that creature's controller.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl<>("{R}"));
ability.addCost(new SacrificeSourceCost());
Effect effect = new DamageTargetControllerEffect(2);
effect.setText("{this} deals 2 damage to that creature's controller");
ability.addEffect(effect);
ability.addEffect(new DamageTargetControllerEffect(2));
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability);
}
Expand Down
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/h/HemlockVial.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public final class HemlockVial extends CardImpl {

private static final FilterPermanent filter = new FilterPermanent();
private static final FilterPermanent filter = new FilterPermanent("Each equipped creature and Equipment you control");

static {
filter.add(Predicates.or(
Expand Down
8 changes: 3 additions & 5 deletions Mage.Sets/src/mage/cards/m/MeltTerrain.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

package mage.cards.m;

import java.util.UUID;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetControllerEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.target.common.TargetLandPermanent;

import java.util.UUID;

/**
*
* @author Loki
Expand All @@ -22,9 +22,7 @@ public MeltTerrain (UUID ownerId, CardSetInfo setInfo) {

// Destroy target land. Melt Terrain deals 2 damage to that land's controller.
this.getSpellAbility().addEffect(new DestroyTargetEffect());
Effect effect = new DamageTargetControllerEffect(2);
effect.setText("{this} deals 2 damage to that land's controller");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addEffect(new DamageTargetControllerEffect(2, "land"));
this.getSpellAbility().addTarget(new TargetLandPermanent());
}

Expand Down
38 changes: 38 additions & 0 deletions Mage.Sets/src/mage/cards/m/MisthiossFury.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package mage.cards.m;

import mage.abilities.condition.common.YouControlPermanentCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.DamageTargetControllerEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent;

import java.util.UUID;

/**
* @author notgreat
*/
public final class MisthiossFury extends CardImpl {

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

// Misthios's Fury deals 3 damage to target creature. If you control an Equipment, Misthios's Fury also deals 2 damage to that creature's controller.
this.getSpellAbility().addEffect(new DamageTargetEffect(3));
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DamageTargetControllerEffect(2),
new YouControlPermanentCondition(StaticFilters.FILTER_PERMANENT_EQUIPMENT)));
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}

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

@Override
public MisthiossFury copy() {
return new MisthiossFury(this);
}
}
8 changes: 3 additions & 5 deletions Mage.Sets/src/mage/cards/p/PeakEruption.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

package mage.cards.p;

import java.util.UUID;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetControllerEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
Expand All @@ -12,6 +10,8 @@
import mage.filter.common.FilterLandPermanent;
import mage.target.common.TargetLandPermanent;

import java.util.UUID;

/**
*
* @author Plopman
Expand All @@ -29,9 +29,7 @@ public PeakEruption(UUID ownerId, CardSetInfo setInfo) {

// Destroy target Mountain. Peak Eruption deals 3 damage to that land's controller.
this.getSpellAbility().addEffect(new DestroyTargetEffect());
Effect effect = new DamageTargetControllerEffect(3);
effect.setText("{this} deals 3 damage to that land's controller");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addEffect(new DamageTargetControllerEffect(3, "land"));
this.getSpellAbility().addTarget(new TargetLandPermanent(filter));
}

Expand Down
Loading