This commit is contained in:
igoudt 2018-01-07 22:39:40 +01:00
commit ec5b34be04
6 changed files with 132 additions and 196 deletions

View file

@ -55,17 +55,17 @@ import mage.target.common.TargetControlledPermanent;
*/
public class KumenaTyrantOfOrazca extends CardImpl {
private static final FilterControlledPermanent filterAnother = new FilterControlledPermanent("another untapped Merfolk you control");
private static final FilterControlledPermanent filter = new FilterControlledPermanent("untapped Merfolk you control");
private static final FilterControlledPermanent filterAnotherNotTapped = new FilterControlledPermanent("another untapped Merfolk you control");
private static final FilterControlledPermanent filterNotTapped = new FilterControlledPermanent("untapped Merfolk you control");
private static final FilterControlledPermanent filterAll = new FilterControlledPermanent("Merfolk you control");
static {
filterAnother.add(new AnotherPredicate());
filterAnother.add(new SubtypePredicate(SubType.MERFOLK));
filterAnother.add(Predicates.not(new TappedPredicate()));
filterAnotherNotTapped.add(new AnotherPredicate());
filterAnotherNotTapped.add(new SubtypePredicate(SubType.MERFOLK));
filterAnotherNotTapped.add(Predicates.not(new TappedPredicate()));
filter.add(new SubtypePredicate(SubType.MERFOLK));
filter.add(Predicates.not(new TappedPredicate()));
filterNotTapped.add(new SubtypePredicate(SubType.MERFOLK));
filterNotTapped.add(Predicates.not(new TappedPredicate()));
filterAll.add(new SubtypePredicate(SubType.MERFOLK));
}
@ -82,17 +82,17 @@ public class KumenaTyrantOfOrazca extends CardImpl {
// Tap another untapped Merfolk you control: Kumena, Tyrant of Orzca can't be blocked this turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new CantBeBlockedSourceEffect(Duration.EndOfTurn),
new TapTargetCost(new TargetControlledPermanent(1, 1, filterAnother, true))));
new TapTargetCost(new TargetControlledPermanent(1, 1, filterAnotherNotTapped, true))));
// Tap three untapped Merfolk you control: Draw a card.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new DrawCardSourceControllerEffect(1),
new TapTargetCost(new TargetControlledPermanent(3, 3, filter, true))));
new TapTargetCost(new TargetControlledPermanent(3, 3, filterNotTapped, true))));
// Tap five untapped Merfolk you control: Put a +1/+1 counter on each Merfolk you control.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new AddCountersAllEffect(CounterType.P1P1.createInstance(), filterAll),
new TapTargetCost(new TargetControlledPermanent(5, 5, filterAll, true))));
new TapTargetCost(new TargetControlledPermanent(5, 5, filterNotTapped, true))));
}

View file

@ -91,6 +91,7 @@ class OathswornVampirePlayEffect extends AsThoughEffectImpl {
public OathswornVampirePlayEffect(final OathswornVampirePlayEffect effect) {
super(effect);
this.condition = effect.condition;
}
@Override

View file

@ -58,8 +58,7 @@ import mage.target.targetpointer.FixedTarget;
public class OrderOfSuccession extends CardImpl {
public OrderOfSuccession(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{U}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{U}");
// Choose left or right. Starting with you and proceeding in the chosen direction, each player chooses a creature controlled by the next player in that direction. Each player gains control of the creature he or she chose.
this.getSpellAbility().addEffect(new OrderOfSuccessionEffect());
@ -98,7 +97,7 @@ class OrderOfSuccessionEffect extends OneShotEffect {
Map<UUID, UUID> playerCreature = new HashMap<>(2);
Choice choice = new ChoiceLeftOrRight();
controller.choose(Outcome.Neutral, choice, game);
boolean left = choice.getChoice().equals("Left");
boolean left = choice == null || choice.getChoice().equals("Left"); // to prevent npe
PlayerList playerList = game.getState().getPlayerList().copy();
// set playerlist to controller
while (!playerList.get().equals(source.getControllerId()) && controller.canRespond()) {
@ -108,7 +107,7 @@ class OrderOfSuccessionEffect extends OneShotEffect {
Player nextPlayer;
UUID firstNextPlayer = null;
while (!getNextPlayerInDirection(left, playerList, game).equals(firstNextPlayer) && controller.canRespond()){
while (!getNextPlayerInDirection(left, playerList, game).equals(firstNextPlayer) && controller.canRespond()) {
nextPlayer = game.getPlayer(playerList.get());
if (nextPlayer == null) {
return false;

View file

@ -27,42 +27,16 @@
*/
package mage.cards.r;
import java.io.ObjectStreamException;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.condition.common.RaidCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.costs.mana.VariableManaCost;
import mage.abilities.decorator.ConditionalActivatedAbility;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.EntersBattlefieldEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.*;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.WingmateRocToken;
import mage.players.Player;
import mage.target.Target;
import mage.target.TargetPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetOpponentsCreaturePermanent;
import mage.watchers.common.PlayerAttackedWatcher;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.SecondTargetPointer;
/**
* @author JayDi85
@ -73,9 +47,14 @@ public class RecklessRage extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}");
// Reckless Rage deals 4 damage to target creature you dont control and 2 damage to target creature you control.
this.getSpellAbility().addTarget(new TargetOpponentsCreaturePermanent());
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you dont control");
filter.add(new ControllerPredicate(TargetController.NOT_YOU));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addEffect(new DamageTargetEffect(4).setUseOnlyTargetPointer(true));
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addEffect(RecklessRageEffect.getInstance());
this.getSpellAbility().addEffect(new DamageTargetEffect(2).setUseOnlyTargetPointer(true)
.setText("and 2 damage to target creature you control")
.setTargetPointer(new SecondTargetPointer()));
}
public RecklessRage(final RecklessRage card) {
@ -87,49 +66,3 @@ public class RecklessRage extends CardImpl {
return new RecklessRage(this);
}
}
class RecklessRageEffect extends OneShotEffect {
private static final RecklessRageEffect instance = new RecklessRageEffect();
private Object readResolve() throws ObjectStreamException {
return instance;
}
public static RecklessRageEffect getInstance() {
return instance;
}
private RecklessRageEffect ( ) {
super(Outcome.Damage);
staticText = "{source} deals 4 damage to target creature you dont control and 2 damage to target creature you control.";
}
@Override
public boolean apply(Game game, Ability source) {
boolean completed = false;
int stepNumber = 1;
for ( Target target : source.getTargets() ) {
if (stepNumber > 2) {
System.out.println("ERROR: " + RecklessRage.class.toString() + " got too many targets (need 2, got " + source.getTargets().size() + ")");
break;
}
Permanent permanent = game.getPermanent(target.getFirstTarget());
if(permanent != null){
completed |= (permanent.damage( (stepNumber == 1) ? 2 : 4, source.getSourceId(), game, false, true ) > 0);
}
stepNumber = stepNumber + 1;
}
return completed;
}
@Override
public Effect copy() {
return instance;
}
}

View file

@ -1,100 +1,98 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.effects.common.continuous.LoseAllAbilitiesTargetEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class WarkiteMarauder extends CardImpl {
private final UUID originalId;
public WarkiteMarauder(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.PIRATE);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever Warkite Marauder attacks, target creature defending player controls loses all abilities and has base power and toughness 0/1 until end of turn.
Ability ability = new AttacksTriggeredAbility(new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn)
.setText("target creature defending player controls loses all abilities"), false);
ability.addEffect(new SetPowerToughnessTargetEffect(0, 1, Duration.EndOfTurn)
.setText("and has base power and toughness 0/1 until end of turn"));
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
this.addAbility(ability);
this.originalId = ability.getOriginalId();
}
public WarkiteMarauder(final WarkiteMarauder card) {
super(card);
this.originalId = card.originalId;
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability.getOriginalId().equals(originalId)) {
ability.getTargets().clear();
ability.addTarget(new TargetControlledCreaturePermanent());
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
filter.add(new ControllerIdPredicate(defenderId));
TargetCreaturePermanent target = new TargetCreaturePermanent(0, 1, filter, false);
ability.addTarget(target);
}
}
@Override
public WarkiteMarauder copy() {
return new WarkiteMarauder(this);
}
}
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.effects.common.continuous.LoseAllAbilitiesTargetEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class WarkiteMarauder extends CardImpl {
private final UUID originalId;
public WarkiteMarauder(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.PIRATE);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever Warkite Marauder attacks, target creature defending player controls loses all abilities and has base power and toughness 0/1 until end of turn.
Ability ability = new AttacksTriggeredAbility(new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn)
.setText("target creature defending player controls loses all abilities"), false);
ability.addEffect(new SetPowerToughnessTargetEffect(0, 1, Duration.EndOfTurn)
.setText("and has base power and toughness 0/1 until end of turn"));
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
this.addAbility(ability);
this.originalId = ability.getOriginalId();
}
public WarkiteMarauder(final WarkiteMarauder card) {
super(card);
this.originalId = card.originalId;
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability.getOriginalId().equals(originalId)) {
ability.getTargets().clear();
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
filter.add(new ControllerIdPredicate(defenderId));
TargetCreaturePermanent target = new TargetCreaturePermanent(1, 1, filter, false);
ability.addTarget(target);
}
}
@Override
public WarkiteMarauder copy() {
return new WarkiteMarauder(this);
}
}

View file

@ -27,10 +27,12 @@
*/
package mage.abilities.effects.common;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.game.Game;
@ -38,8 +40,6 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.Target;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
@ -129,6 +129,11 @@ public class DamageTargetEffect extends OneShotEffect {
this.sourceName = sourceName;
}
public Effect setUseOnlyTargetPointer(boolean useOnlyTargetPointer) {
this.useOnlyTargetPointer = useOnlyTargetPointer;
return this;
}
@Override
public DamageTargetEffect copy() {
return new DamageTargetEffect(this);
@ -152,7 +157,7 @@ public class DamageTargetEffect extends OneShotEffect {
}
return true;
}
for (UUID targetId :this.getTargetPointer().getTargets(game, source)) {
for (UUID targetId : this.getTargetPointer().getTargets(game, source)) {
Permanent permanent = game.getPermanent(targetId);
if (permanent != null) {
permanent.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, preventable);