initial changes, creation of branch, detailed in #4799

This commit is contained in:
Evan Kranzler 2018-04-19 11:19:48 -04:00
parent 97b2b2feac
commit 7212b02e53
11 changed files with 44 additions and 33 deletions

View file

@ -41,7 +41,7 @@ import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetCreatureOrPlayer;
import mage.target.common.TargetAnyTarget;
import mage.target.common.TargetCreaturePermanent;
/**
@ -57,14 +57,14 @@ public class AbunaAcolyte extends CardImpl {
}
public AbunaAcolyte(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}");
this.subtype.add(SubType.CAT);
this.subtype.add(SubType.CLERIC);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
Ability ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 1), new TapSourceCost());
ability1.addTarget(new TargetCreatureOrPlayer());
ability1.addTarget(new TargetAnyTarget());
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 2), new TapSourceCost());
ability2.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability1);
@ -80,4 +80,4 @@ public class AbunaAcolyte extends CardImpl {
return new AbunaAcolyte(this);
}
}
}

View file

@ -36,7 +36,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetAnyTarget;
/**
*
@ -45,8 +45,7 @@ import mage.target.common.TargetCreaturePermanent;
public class AbunasChant extends CardImpl {
public AbunasChant(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{W}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{W}");
// Choose one -
this.getSpellAbility().getModes().setMinModes(1);
@ -56,7 +55,7 @@ public class AbunasChant extends CardImpl {
//or prevent the next 5 damage that would be dealt to target creature this turn.
Mode mode = new Mode();
mode.getEffects().add(new PreventDamageToTargetEffect(Duration.EndOfTurn, 5));
mode.getTargets().add(new TargetCreaturePermanent());
mode.getTargets().add(new TargetAnyTarget());
this.getSpellAbility().getModes().addMode(mode);
// Entwine {2}
this.addAbility(new EntwineAbility("{2}"));

View file

@ -33,7 +33,7 @@ import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.target.common.TargetCreatureOrPlayer;
import mage.target.common.TargetAnyTarget;
/**
*
@ -44,7 +44,7 @@ public class LightningBolt extends CardImpl {
public LightningBolt(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}");
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
this.getSpellAbility().addTarget(new TargetAnyTarget());
this.getSpellAbility().addEffect(new DamageTargetEffect(3));
}

View file

@ -41,23 +41,25 @@ import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreatureOrPlayer;
import java.util.UUID;
import mage.target.common.TargetAnyTarget;
/**
*
* @author themattfiles
*/
public class OrcishVandal extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("an artifact");
static {
filter.add(new CardTypePredicate(CardType.ARTIFACT));
}
public OrcishVandal(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
this.subtype.add(SubType.ORC);
this.subtype.add(SubType.WARRIOR);
this.power = new MageInt(1);
@ -65,7 +67,7 @@ public class OrcishVandal extends CardImpl {
// {t}, Sacrifice an artifact: Orcish Vandal deals 2 damage to any target.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new TapSourceCost());
ability.addTarget(new TargetCreatureOrPlayer());
ability.addTarget(new TargetAnyTarget());
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
this.addAbility(ability);
}

View file

@ -41,7 +41,6 @@ import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreatureOrPlayer;
/**
*
@ -50,7 +49,7 @@ import mage.target.common.TargetCreatureOrPlayer;
public class RushingTideZubera extends CardImpl {
public RushingTideZubera(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}{U}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
this.subtype.add(SubType.ZUBERA);
this.subtype.add(SubType.SPIRIT);
@ -58,9 +57,8 @@ public class RushingTideZubera extends CardImpl {
this.toughness = new MageInt(3);
// When Rushing-Tide Zubera dies, if 4 or more damage was dealt to it this turn, draw three cards.
Ability ability = new ConditionalTriggeredAbility(new DiesTriggeredAbility(new DrawCardSourceControllerEffect(3)),new RushingTideZuberaCondition(),
Ability ability = new ConditionalTriggeredAbility(new DiesTriggeredAbility(new DrawCardSourceControllerEffect(3)), new RushingTideZuberaCondition(),
"When {this} dies, if 4 or more damage was dealt to it this turn, draw three cards.");
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
}
@ -75,12 +73,13 @@ public class RushingTideZubera extends CardImpl {
}
class RushingTideZuberaCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent == null) {
permanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
}
}
return permanent.getDamage() > 3;
}
}
}

View file

@ -39,7 +39,7 @@ import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.target.common.TargetCreatureOrPlayer;
import mage.target.common.TargetAnyTarget;
/**
*
@ -48,7 +48,7 @@ import mage.target.common.TargetCreatureOrPlayer;
public class SanctumGuardian extends CardImpl {
public SanctumGuardian(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.CLERIC);
this.power = new MageInt(1);
@ -56,8 +56,8 @@ public class SanctumGuardian extends CardImpl {
// Sacrifice Sanctum Guardian: The next time a source of your choice would deal damage to target creature or player this turn, prevent that damage.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventNextDamageFromChosenSourceToTargetEffect(Duration.EndOfTurn),
new SacrificeSourceCost());
ability.addTarget(new TargetCreatureOrPlayer());
new SacrificeSourceCost());
ability.addTarget(new TargetAnyTarget());
this.addAbility(ability);
}

View file

@ -44,7 +44,7 @@ import mage.constants.Zone;
import mage.filter.FilterObject;
import mage.filter.FilterStackObject;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.common.TargetCreatureOrPlayer;
import mage.target.common.TargetAnyTarget;
/**
*
@ -71,7 +71,7 @@ public class SuqAtaFirewalker extends CardImpl {
//{T}: Suq'Ata Firewalker deals 1 damage to target creature or player.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost());
ability.addTarget(new TargetCreatureOrPlayer());
ability.addTarget(new TargetAnyTarget());
this.addAbility(ability);
}

View file

@ -40,7 +40,8 @@ import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetCreatureOrPlayer;
import mage.target.common.TargetAnyTarget;
/**
*
* @author Will
@ -62,7 +63,7 @@ public class WizardsLightning extends CardImpl {
this.addAbility(ability);
// Wizard's Lightning deals 3 damage to any target.
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
this.getSpellAbility().addTarget(new TargetAnyTarget());
this.getSpellAbility().addEffect(new DamageTargetEffect(3));
}

View file

@ -187,7 +187,12 @@ public class DamageTargetEffect extends OneShotEffect {
if (!targetDescription.isEmpty()) {
sb.append(targetDescription);
} else {
sb.append("target ").append(mode.getTargets().get(0).getTargetName());
String targetName = mode.getTargets().get(0).getTargetName();
if (targetName.contains("any")) {
sb.append(targetName);
} else {
sb.append("target ").append(targetName);
}
}
if (!message.isEmpty()) {
if (message.equals("1")) {

View file

@ -82,11 +82,16 @@ public class PreventDamageToTargetEffect extends PreventionEffectImpl {
}
StringBuilder sb = new StringBuilder();
if (amountToPrevent == Integer.MAX_VALUE) {
sb.append("prevent all damage that would be dealt to target ");
sb.append("prevent all damage that would be dealt to ");
} else {
sb.append("prevent the next ").append(amountToPrevent).append(" damage that would be dealt to target ");
sb.append("prevent the next ").append(amountToPrevent).append(" damage that would be dealt to ");
}
String targetName = mode.getTargets().get(0).getTargetName();
if (targetName.contains("any")) {
sb.append(targetName);
} else {
sb.append("target ").append(targetName);
}
sb.append(mode.getTargets().get(0).getTargetName());
if (!duration.toString().isEmpty()) {
sb.append(' ');
if (duration == Duration.EndOfTurn) {

View file

@ -440,7 +440,7 @@ public abstract class PlayerImpl implements Player, Serializable {
this.canLoseLife = true;
this.topCardRevealed = false;
this.payManaMode = false;
this.setLife(game.getLife(), game, UUID.randomUUID());
this.setLife(game.getLife(), game, (UUID) null);
this.setReachedNextTurnAfterLeaving(false);
this.castSourceIdWithAlternateMana = null;