[DOM] Added three cards. Some fixes to rule texts and some more minor fixes.

This commit is contained in:
LevelX2 2018-04-15 11:33:57 +02:00
parent dddb77b856
commit 041ad9e036
26 changed files with 464 additions and 105 deletions

View file

@ -27,9 +27,9 @@
*/
package mage.abilities.common;
import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
@ -37,10 +37,14 @@ import mage.game.events.GameEvent;
*
* @author North
*/
public class DrawCardControllerTriggeredAbility extends TriggeredAbilityImpl {
public class DrawCardControllerTriggeredAbility extends TriggeredAbilityImpl {
public DrawCardControllerTriggeredAbility(Effect effect, boolean optional) {
super(Zone.BATTLEFIELD, effect, optional);
this(Zone.BATTLEFIELD, effect, optional);
}
public DrawCardControllerTriggeredAbility(Zone zone, Effect effect, boolean optional) {
super(zone, effect, optional);
}
public DrawCardControllerTriggeredAbility(final DrawCardControllerTriggeredAbility ability) {
@ -66,4 +70,4 @@ public class DrawCardControllerTriggeredAbility extends TriggeredAbilityImpl {
public DrawCardControllerTriggeredAbility copy() {
return new DrawCardControllerTriggeredAbility(this);
}
}
}

View file

@ -173,7 +173,7 @@ class ChapterTriggeredAbility extends TriggeredAbilityImpl {
}
}
String text = super.getRule();
sb.append(": ").append(Character.toUpperCase(text.charAt(0)) + text.substring(1));
sb.append(": ").append(Character.toUpperCase(text.charAt(0))).append(text.substring(1));
return sb.toString();
}
}

View file

@ -12,13 +12,13 @@ public class BasicManaEffect extends ManaEffect {
public BasicManaEffect(Mana mana) {
super();
this.mana = mana;
staticText = "add " + mana.toString() + " to your mana pool";
staticText = "add " + mana.toString();
}
public BasicManaEffect(ConditionalMana conditionalMana) {
super();
this.mana = conditionalMana;
staticText = "add " + mana.toString() + " to your mana pool. " + conditionalMana.getDescription();
staticText = "add " + mana.toString() + " " + conditionalMana.getDescription();
}
public BasicManaEffect(final BasicManaEffect effect) {

View file

@ -32,6 +32,7 @@ import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.permanent.TappedPredicate;
import mage.game.Game;
@ -40,28 +41,35 @@ import mage.players.Player;
import mage.target.common.TargetLandPermanent;
/**
* "Untap up to X lands" effect
* "Untap (up to) X lands" effect
*/
public class UntapLandsEffect extends OneShotEffect {
private final int amount;
private final boolean upTo;
public UntapLandsEffect(int amount) {
this(amount, true);
}
public UntapLandsEffect(int amount, boolean upTo) {
super(Outcome.Untap);
this.amount = amount;
staticText = "Untap up to " + amount + " lands";
this.upTo = upTo;
staticText = "Untap " + (upTo ? "up to " : "") + amount + " lands";
}
public UntapLandsEffect(final UntapLandsEffect effect) {
super(effect);
this.amount = effect.amount;
this.upTo = effect.upTo;
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
TargetLandPermanent target = new TargetLandPermanent(0, amount, new FilterLandPermanent(), true);
TargetLandPermanent target = new TargetLandPermanent(upTo ? 0 : amount, amount, StaticFilters.FILTER_LAND, true);
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
// UI Shortcut: Check if any lands are already tapped. If there are equal/fewer than amount, give the option to add those in to be untapped now.

View file

@ -1,14 +1,13 @@
package mage.abilities.keyword;
import java.io.ObjectStreamException;
import mage.abilities.MageSingleton;
import mage.abilities.common.SimpleStaticAbility;
import mage.constants.Zone;
import java.io.ObjectStreamException;
/**
* Hexproof from black (This creature or player can't be the target of black spells or abilities
* your opponents control.)
* Hexproof from black (This creature or player can't be the target of black
* spells or abilities your opponents control.)
*
* @author igoudt
*/
@ -39,6 +38,6 @@ public class HexproofFromBlackAbility extends SimpleStaticAbility implements Mag
@Override
public String getRule() {
return "hexproof from black";
return "hexproof from black <i>(This creature can't be the target of black spells or abilities your opponents control.)</i>";
}
}

View file

@ -1,14 +1,13 @@
package mage.abilities.keyword;
import java.io.ObjectStreamException;
import mage.abilities.MageSingleton;
import mage.abilities.common.SimpleStaticAbility;
import mage.constants.Zone;
import java.io.ObjectStreamException;
/**
* Hexproof from white (This creature or player can't be the target of white spells or abilities
* your opponents control.)
* Hexproof from white (This creature or player can't be the target of white
* spells or abilities your opponents control.)
*
* @author igoudt
*/
@ -39,6 +38,6 @@ public class HexproofFromWhiteAbility extends SimpleStaticAbility implements Mag
@Override
public String getRule() {
return "hexproof from white";
return "hexproof from white <i>(This creature can't be the target of white spells or abilities your opponents control.)</i>";
}
}

View file

@ -225,6 +225,12 @@ public final class StaticFilters {
FILTER_LAND.setLockedFilter(true);
}
public static final FilterLandPermanent FILTER_LAND_A = new FilterLandPermanent("a land");
static {
FILTER_LAND_A.setLockedFilter(true);
}
public static final FilterLandPermanent FILTER_LANDS = new FilterLandPermanent("lands");
static {

View file

@ -1,17 +1,17 @@
package mage.game;
import mage.cards.MeldCard;
import mage.game.events.ZoneChangeEvent;
import mage.game.stack.Spell;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.cards.MeldCard;
import mage.game.events.ZoneChangeEvent;
import mage.game.stack.Spell;
/**
* Created by Dilnu on 9/4/16.
*/
public class ZoneChangeInfo {
public boolean faceDown;
public ZoneChangeEvent event;
@ -35,6 +35,7 @@ public class ZoneChangeInfo {
}
public static class Library extends ZoneChangeInfo {
public boolean top;
public Library(ZoneChangeEvent event, boolean top) {
@ -47,7 +48,7 @@ public class ZoneChangeInfo {
this.top = top;
}
public Library(Library info) {
public Library(final Library info) {
super(info);
this.top = info.top;
}
@ -59,6 +60,7 @@ public class ZoneChangeInfo {
}
public static class Exile extends ZoneChangeInfo {
public UUID id;
public String name;
@ -74,7 +76,7 @@ public class ZoneChangeInfo {
this.name = name;
}
public Exile(Exile info) {
public Exile(final Exile info) {
super(info);
this.id = info.id;
this.name = info.name;
@ -87,19 +89,20 @@ public class ZoneChangeInfo {
}
public static class Battlefield extends ZoneChangeInfo {
public boolean tapped;
public Battlefield (ZoneChangeEvent event, boolean tapped) {
public Battlefield(ZoneChangeEvent event, boolean tapped) {
super(event);
this.tapped = tapped;
}
public Battlefield (ZoneChangeEvent event, boolean faceDown, boolean tapped) {
public Battlefield(ZoneChangeEvent event, boolean faceDown, boolean tapped) {
super(event, faceDown);
this.tapped = tapped;
}
public Battlefield(Battlefield info) {
public Battlefield(final Battlefield info) {
super(info);
this.tapped = info.tapped;
}
@ -111,6 +114,7 @@ public class ZoneChangeInfo {
}
public static class Stack extends ZoneChangeInfo {
public Spell spell;
public Stack(ZoneChangeEvent event, Spell spell) {
@ -123,7 +127,7 @@ public class ZoneChangeInfo {
this.spell = spell;
}
public Stack(Stack info) {
public Stack(final Stack info) {
super(info);
this.spell = info.spell;
}
@ -135,7 +139,9 @@ public class ZoneChangeInfo {
}
public static class Unmelded extends ZoneChangeInfo {
List<ZoneChangeInfo> subInfo = new ArrayList<>();
public Unmelded(ZoneChangeInfo info, Game game) {
super(info.event);
MeldCard meld = game.getMeldCard(info.event.getTargetId());

View file

@ -108,7 +108,7 @@ public final class ZonesHandler {
"order to put on top of library (last chosen will be topmost)", cards, owner, game)) {
game.getPlayer(card.getOwnerId()).getLibrary().putOnTop(card, game);
}
} else {
} else { // buttom
for (Card card : chooseOrder(
"order to put on bottom of library (last chosen will be bottommost)", cards, owner, game)) {
game.getPlayer(card.getOwnerId()).getLibrary().putOnBottom(card, game);

View file

@ -0,0 +1,34 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.game.command.emblems;
import mage.abilities.Ability;
import mage.abilities.common.DrawCardControllerTriggeredAbility;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.command.Emblem;
import mage.target.TargetPermanent;
/**
*
* @author LevelX2
*/
public class TeferiHeroOfDominariaEmblem extends Emblem {
// Whenever you draw a card, exile target permanent an opponent controls.
public TeferiHeroOfDominariaEmblem() {
this.setName("Emblem Teferi");
Ability ability = new DrawCardControllerTriggeredAbility(Zone.COMMAND, new ExileTargetEffect(), false);
FilterPermanent filter = new FilterPermanent("permanent an opponent controls");
filter.add(new ControllerPredicate(TargetController.OPPONENT));
ability.addTarget(new TargetPermanent(filter));
this.getAbilities().add(ability);
}
}

View file

@ -27,16 +27,15 @@
*/
package mage.players;
import java.io.Serializable;
import java.util.*;
import java.util.stream.Collectors;
import mage.cards.Card;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.util.RandomUtil;
import java.io.Serializable;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author BetaSteward_at_googlemail.com
*/
@ -136,6 +135,28 @@ public class Library implements Serializable {
}
}
public void putCardThirdFromTheTop(Card card, Game game) {
if (card != null && card.getOwnerId().equals(playerId)) {
Card cardTop = null;
Card cardSecond = null;
if (hasCards()) {
cardTop = removeFromTop(game);
}
if (hasCards()) {
cardSecond = removeFromTop(game);
}
putOnTop(card, game);
if (cardSecond != null) {
putOnTop(cardSecond, game);
}
if (cardTop != null) {
putOnTop(cardTop, game);
}
} else {
game.getPlayer(card.getOwnerId()).getLibrary().putCardThirdFromTheTop(card, game);
}
}
public void putOnBottom(Card card, Game game) {
if (card.getOwnerId().equals(playerId)) {
card.setZone(Zone.LIBRARY, game);