mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
bug fix: Urza's Avenger, Jodah's Avenger, Multiform Wonder (#11557)
Rework cards to not apply p/t unboost after zcc change
This commit is contained in:
parent
3ec4430946
commit
408a557ba7
3 changed files with 39 additions and 79 deletions
|
|
@ -1,16 +1,13 @@
|
||||||
|
|
||||||
package mage.cards.j;
|
package mage.cards.j;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.ContinuousEffectImpl;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||||
import mage.abilities.keyword.DoubleStrikeAbility;
|
import mage.abilities.keyword.DoubleStrikeAbility;
|
||||||
import mage.abilities.keyword.ProtectionAbility;
|
import mage.abilities.keyword.ProtectionAbility;
|
||||||
|
|
@ -22,9 +19,12 @@ import mage.choices.Choice;
|
||||||
import mage.choices.ChoiceImpl;
|
import mage.choices.ChoiceImpl;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Styxo
|
* @author Styxo
|
||||||
|
|
@ -52,10 +52,9 @@ public final class JodahsAvenger extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class JodahsAvengerEffect extends ContinuousEffectImpl {
|
class JodahsAvengerEffect extends OneShotEffect {
|
||||||
|
|
||||||
private static final Set<String> choices = new LinkedHashSet<>();
|
private static final Set<String> choices = new LinkedHashSet<>();
|
||||||
private Ability gainedAbility;
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
choices.add("Double strike");
|
choices.add("Double strike");
|
||||||
|
|
@ -65,7 +64,7 @@ class JodahsAvengerEffect extends ContinuousEffectImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
public JodahsAvengerEffect() {
|
public JodahsAvengerEffect() {
|
||||||
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.AddAbility);
|
super(Outcome.AddAbility);
|
||||||
this.staticText = "Until end of turn, {this} gets -1/-1 and gains your choice of double strike, protection from red, vigilance, or shadow";
|
this.staticText = "Until end of turn, {this} gets -1/-1 and gains your choice of double strike, protection from red, vigilance, or shadow";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -77,16 +76,15 @@ class JodahsAvengerEffect extends ContinuousEffectImpl {
|
||||||
public JodahsAvengerEffect copy() {
|
public JodahsAvengerEffect copy() {
|
||||||
return new JodahsAvengerEffect(this);
|
return new JodahsAvengerEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Ability source, Game game) {
|
public boolean apply(Game game, Ability source) {
|
||||||
super.init(source, game);
|
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
Choice choice = new ChoiceImpl(true);
|
Choice choice = new ChoiceImpl(true);
|
||||||
choice.setMessage("Choose one");
|
choice.setMessage("Choose one");
|
||||||
choice.setChoices(choices);
|
choice.setChoices(choices);
|
||||||
if (controller.choose(outcome, choice, game)) {
|
if (controller.choose(outcome, choice, game)) {
|
||||||
|
Ability gainedAbility;
|
||||||
switch (choice.getChoice()) {
|
switch (choice.getChoice()) {
|
||||||
case "Double strike":
|
case "Double strike":
|
||||||
gainedAbility = DoubleStrikeAbility.getInstance();
|
gainedAbility = DoubleStrikeAbility.getInstance();
|
||||||
|
|
@ -101,21 +99,11 @@ class JodahsAvengerEffect extends ContinuousEffectImpl {
|
||||||
gainedAbility = ProtectionAbility.from(ObjectColor.RED);
|
gainedAbility = ProtectionAbility.from(ObjectColor.RED);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
game.addEffect(new GainAbilitySourceEffect(gainedAbility, Duration.EndOfTurn), source);
|
||||||
discard();
|
game.addEffect(new BoostSourceEffect(-1, -1, Duration.EndOfTurn), source);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Permanent sourceObject = game.getPermanent(source.getSourceId());
|
|
||||||
if (sourceObject != null) {
|
|
||||||
sourceObject.addPower(-1);
|
|
||||||
sourceObject.addToughness(-1);
|
|
||||||
game.addEffect(new GainAbilitySourceEffect(gainedAbility, Duration.EndOfTurn), source);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,14 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.common.PayEnergyCost;
|
import mage.abilities.costs.common.PayEnergyCost;
|
||||||
import mage.abilities.effects.ContinuousEffectImpl;
|
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||||
import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect;
|
import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect;
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
|
|
@ -24,9 +20,12 @@ import mage.choices.Choice;
|
||||||
import mage.choices.ChoiceImpl;
|
import mage.choices.ChoiceImpl;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
|
|
@ -115,22 +114,14 @@ class MultiformWonderEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MultiformWonder2Effect extends ContinuousEffectImpl {
|
class MultiformWonder2Effect extends OneShotEffect {
|
||||||
|
|
||||||
private int power;
|
|
||||||
private int toughness;
|
|
||||||
|
|
||||||
public MultiformWonder2Effect() {
|
public MultiformWonder2Effect() {
|
||||||
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
|
super(Outcome.BoostCreature);
|
||||||
this.power = 2;
|
|
||||||
this.toughness = -2;
|
|
||||||
this.staticText = "{this} gets +2/-2 or -2/+2 until end of turn";
|
this.staticText = "{this} gets +2/-2 or -2/+2 until end of turn";
|
||||||
}
|
}
|
||||||
|
|
||||||
private MultiformWonder2Effect(final MultiformWonder2Effect effect) {
|
private MultiformWonder2Effect(final MultiformWonder2Effect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
this.power = effect.power;
|
|
||||||
this.toughness = effect.toughness;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -139,26 +130,18 @@ class MultiformWonder2Effect extends ContinuousEffectImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Ability source, Game game) {
|
public boolean apply(Game game, Ability source) {
|
||||||
super.init(source, game);
|
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
if (controller != null && sourceObject != null) {
|
if (controller != null && sourceObject != null) {
|
||||||
|
int power = 2;
|
||||||
|
int toughness = -2;
|
||||||
String message = "Should " + sourceObject.getLogName() + " get -2/+2 instead of +2/-2?";
|
String message = "Should " + sourceObject.getLogName() + " get -2/+2 instead of +2/-2?";
|
||||||
if (controller.chooseUse(Outcome.Neutral, message, source, game)) {
|
if (controller.chooseUse(Outcome.Neutral, message, source, game)) {
|
||||||
this.power *= -1;
|
power *= -1;
|
||||||
this.toughness *= -1;
|
toughness *= -1;
|
||||||
}
|
}
|
||||||
}
|
game.addEffect(new BoostSourceEffect(power, toughness, Duration.EndOfTurn), source);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Permanent sourceObject = game.getPermanent(source.getSourceId());
|
|
||||||
if (sourceObject != null) {
|
|
||||||
sourceObject.addPower(power);
|
|
||||||
sourceObject.addToughness(toughness);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,12 @@
|
||||||
|
|
||||||
package mage.cards.u;
|
package mage.cards.u;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.ContinuousEffectImpl;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||||
import mage.abilities.keyword.BandingAbility;
|
import mage.abilities.keyword.BandingAbility;
|
||||||
import mage.abilities.keyword.FirstStrikeAbility;
|
import mage.abilities.keyword.FirstStrikeAbility;
|
||||||
|
|
@ -21,9 +18,12 @@ import mage.choices.Choice;
|
||||||
import mage.choices.ChoiceImpl;
|
import mage.choices.ChoiceImpl;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Styxo & L_J
|
* @author Styxo & L_J
|
||||||
|
|
@ -51,11 +51,9 @@ public final class UrzasAvenger extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class UrzasAvengerEffect extends ContinuousEffectImpl {
|
class UrzasAvengerEffect extends OneShotEffect {
|
||||||
|
|
||||||
private static final Set<String> choices = new LinkedHashSet<>();
|
private static final Set<String> choices = new LinkedHashSet<>();
|
||||||
private Ability gainedAbility;
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
choices.add("Banding");
|
choices.add("Banding");
|
||||||
choices.add("Flying");
|
choices.add("Flying");
|
||||||
|
|
@ -64,7 +62,7 @@ class UrzasAvengerEffect extends ContinuousEffectImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
public UrzasAvengerEffect() {
|
public UrzasAvengerEffect() {
|
||||||
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.AddAbility);
|
super(Outcome.AddAbility);
|
||||||
this.staticText = "{this} gets -1/-1 and gains your choice of banding, flying, first strike, or trample until end of turn";
|
this.staticText = "{this} gets -1/-1 and gains your choice of banding, flying, first strike, or trample until end of turn";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -76,16 +74,15 @@ class UrzasAvengerEffect extends ContinuousEffectImpl {
|
||||||
public UrzasAvengerEffect copy() {
|
public UrzasAvengerEffect copy() {
|
||||||
return new UrzasAvengerEffect(this);
|
return new UrzasAvengerEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Ability source, Game game) {
|
public boolean apply(Game game, Ability source) {
|
||||||
super.init(source, game);
|
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
Choice choice = new ChoiceImpl(true);
|
Choice choice = new ChoiceImpl(true);
|
||||||
choice.setMessage("Choose one");
|
choice.setMessage("Choose one");
|
||||||
choice.setChoices(choices);
|
choice.setChoices(choices);
|
||||||
if (controller.choose(outcome, choice, game)) {
|
if (controller.choose(outcome, choice, game)) {
|
||||||
|
Ability gainedAbility;
|
||||||
switch (choice.getChoice()) {
|
switch (choice.getChoice()) {
|
||||||
case "Banding":
|
case "Banding":
|
||||||
gainedAbility = BandingAbility.getInstance();
|
gainedAbility = BandingAbility.getInstance();
|
||||||
|
|
@ -100,19 +97,11 @@ class UrzasAvengerEffect extends ContinuousEffectImpl {
|
||||||
gainedAbility = TrampleAbility.getInstance();
|
gainedAbility = TrampleAbility.getInstance();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
game.addEffect(new GainAbilitySourceEffect(gainedAbility, Duration.EndOfTurn), source);
|
||||||
|
game.addEffect(new BoostSourceEffect(-1, -1, Duration.EndOfTurn), source);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Permanent sourceObject = game.getPermanent(source.getSourceId());
|
|
||||||
if (sourceObject != null) {
|
|
||||||
sourceObject.addPower(-1);
|
|
||||||
sourceObject.addToughness(-1);
|
|
||||||
game.addEffect(new GainAbilitySourceEffect(gainedAbility, Duration.EndOfTurn), source);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue