From 6d622a8f00a11f8868114d6d83af90b6323b11c5 Mon Sep 17 00:00:00 2001 From: drmDev Date: Sat, 21 May 2016 05:34:57 -0400 Subject: [PATCH 1/5] LastStand fixes - loss of life and 2x --- Mage.Sets/src/mage/sets/planechase2012/LastStand.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/sets/planechase2012/LastStand.java b/Mage.Sets/src/mage/sets/planechase2012/LastStand.java index 4d6b42246b..17579324b3 100644 --- a/Mage.Sets/src/mage/sets/planechase2012/LastStand.java +++ b/Mage.Sets/src/mage/sets/planechase2012/LastStand.java @@ -28,13 +28,13 @@ package mage.sets.planechase2012; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.filter.common.FilterControlledLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; @@ -54,7 +54,6 @@ public class LastStand extends CardImpl { super(ownerId, 100, "Last Stand", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{W}{U}{B}{R}{G}"); this.expansionSetCode = "PC2"; - // Target opponent loses 2 life for each Swamp you control. Last Stand deals damage equal to the number of Mountains you control to target creature. Put a 1/1 green Saproling creature token onto the battlefield for each Forest you control. You gain 2 life for each Plains you control. Draw a card for each Island you control, then discard that many cards. this.getSpellAbility().addEffect(new LastStandEffect()); this.getSpellAbility().addTarget(new TargetOpponent()); @@ -108,7 +107,7 @@ class LastStandEffect extends OneShotEffect { Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source)); if (opponent != null) { int swamps = game.getBattlefield().count(filterSwamp, source.getSourceId(), source.getControllerId(), game); - opponent.damage(swamps, source.getSourceId(), game, false, true); + opponent.loseLife(swamps * 2, game); } // Last Stand deals damage equal to the number of Mountains you control to target creature. Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget()); @@ -125,7 +124,7 @@ class LastStandEffect extends OneShotEffect { } // You gain 2 life for each Plains you control. int plains = game.getBattlefield().count(filterPlains, source.getSourceId(), source.getControllerId(), game); - controller.gainLife(plains, game); + controller.gainLife(plains * 2, game); // Draw a card for each Island you control, then discard that many cards int islands = game.getBattlefield().count(filterIsland, source.getSourceId(), source.getControllerId(), game); if (islands > 0) { From f8452a43d374204adfdd8a4a6cd61176a25cd61c Mon Sep 17 00:00:00 2001 From: Fenhl Date: Sat, 21 May 2016 10:50:02 +0000 Subject: [PATCH 2/5] Update card counts in readme Morningtide is complete! --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index d68cb2fa83..dfe53ff007 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,7 @@ [![Join the chat at https://gitter.im/magefree/mage](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magefree/mage?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -XMage allows you to play Magic against one or more online players or computer opponents. It includes full rules enforcement for over **13,000** unique cards (26,000 counting all cards from different editions). Starting with Shadowmoor, all regular sets have nearly all the cards implemented ([detailed overview](http://ct-magefree.rhcloud.com/stats)). +XMage allows you to play Magic against one or more online players or computer opponents. It includes full rules enforcement for over **13,000** unique cards (over 26,000 counting all cards from different editions). Starting with Morningtide, all regular sets have nearly all the cards implemented ([detailed overview](http://ct-magefree.rhcloud.com/stats)). There are public servers where you can play XMage against other players. You can also host your own server to play against the AI and/or your friends. From 4a416c7fbb90c83f3d0dde249b683ed77af8872e Mon Sep 17 00:00:00 2001 From: Nathaniel Brandes Date: Sat, 21 May 2016 03:59:16 -0700 Subject: [PATCH 3/5] Fix ETB kicker on Dralnu's Pet. --- Mage.Sets/src/mage/sets/planeshift/DralnusPet.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Mage.Sets/src/mage/sets/planeshift/DralnusPet.java b/Mage.Sets/src/mage/sets/planeshift/DralnusPet.java index d156e71615..732fc1eb44 100644 --- a/Mage.Sets/src/mage/sets/planeshift/DralnusPet.java +++ b/Mage.Sets/src/mage/sets/planeshift/DralnusPet.java @@ -45,6 +45,7 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.KickerAbility; import mage.cards.CardImpl; +import mage.constants.AbilityType; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; @@ -111,6 +112,9 @@ class DralnusPetEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent == null && source.getAbilityType().equals(AbilityType.STATIC)) { + permanent = game.getPermanentEntering(source.getSourceId()); + } if (controller != null && permanent != null) { SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); if (spellAbility != null From 4aadc359c4ad0ba209030d88fb11d76664f203e3 Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 22 May 2016 23:11:04 +1000 Subject: [PATCH 4/5] spjspj - Implement Portcullis (STH) --- .../src/mage/sets/stronghold/Portcullis.java | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/stronghold/Portcullis.java diff --git a/Mage.Sets/src/mage/sets/stronghold/Portcullis.java b/Mage.Sets/src/mage/sets/stronghold/Portcullis.java new file mode 100644 index 0000000000..ba6001b110 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/Portcullis.java @@ -0,0 +1,133 @@ +/* + * 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.sets.stronghold; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.common.LeavesBattlefieldTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnFromExileForSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.util.CardUtil; + +/** + * + * @author spjspj + */ +public class Portcullis extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature"); + + public Portcullis(UUID ownerId) { + super(ownerId, 133, "Portcullis", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "STH"; + + // Whenever a creature enters the battlefield, if there are two or more other creatures on the battlefield, exile that creature. + String rule = "Whenever a creature enters the battlefield, if there are two or more other creatures on the battlefield, exile that creature"; + TriggeredAbility ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new PortcullisExileEffect(), filter, false, SetTargetPointer.PERMANENT, rule, true); + + MoreThanXCreaturesOnBFCondition condition = new MoreThanXCreaturesOnBFCondition(2); + this.addAbility(new ConditionalTriggeredAbility(ability, condition, rule)); + + // Return that card to the battlefield under its owner's control when Portcullis leaves the battlefield. + Ability ability2 = new LeavesBattlefieldTriggeredAbility(new ReturnFromExileForSourceEffect(Zone.BATTLEFIELD), false); + this.addAbility(ability2); + } + + public Portcullis(final Portcullis card) { + super(card); + } + + @Override + public Portcullis copy() { + return new Portcullis(this); + } +} + +class MoreThanXCreaturesOnBFCondition implements Condition { + + protected final int value; + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures on field"); + + public MoreThanXCreaturesOnBFCondition(int value) { + this.value = value; + } + + @Override + public final boolean apply(Game game, Ability source) { + PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(filter); + int count = amount.calculate(game, source, null); + return count > value; + } +} + +class PortcullisExileEffect extends OneShotEffect { + + public PortcullisExileEffect() { + super(Outcome.Neutral); + this.staticText = "Whenever a creature enters the battlefield, if there are two or more other creatures on the battlefield, exile that creature."; + } + + public PortcullisExileEffect(final PortcullisExileEffect effect) { + super(effect); + } + + @Override + public PortcullisExileEffect copy() { + return new PortcullisExileEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + Permanent creature = game.getPermanent(targetPointer.getFirst(game, source)); + + if (permanent != null && creature != null) { + Player controller = game.getPlayer(creature.getControllerId()); + Zone currentZone = game.getState().getZone(creature.getId()); + if (currentZone.equals(Zone.BATTLEFIELD)) { + controller.moveCardsToExile(creature, source, game, true, CardUtil.getCardExileZoneId(game, source), permanent.getIdName()); + } + } + return false; + } +} From 691294982508400018b8f295dc9ee21dbbb88795 Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 22 May 2016 23:16:44 +1000 Subject: [PATCH 5/5] spjspj - Implement Portcullis (STH) --- Mage.Sets/src/mage/sets/stronghold/Portcullis.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/stronghold/Portcullis.java b/Mage.Sets/src/mage/sets/stronghold/Portcullis.java index ba6001b110..b1b6c284e7 100644 --- a/Mage.Sets/src/mage/sets/stronghold/Portcullis.java +++ b/Mage.Sets/src/mage/sets/stronghold/Portcullis.java @@ -63,7 +63,7 @@ public class Portcullis extends CardImpl { // Whenever a creature enters the battlefield, if there are two or more other creatures on the battlefield, exile that creature. String rule = "Whenever a creature enters the battlefield, if there are two or more other creatures on the battlefield, exile that creature"; - TriggeredAbility ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new PortcullisExileEffect(), filter, false, SetTargetPointer.PERMANENT, rule, true); + TriggeredAbility ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new PortcullisExileEffect(), filter, false, SetTargetPointer.PERMANENT, rule); MoreThanXCreaturesOnBFCondition condition = new MoreThanXCreaturesOnBFCondition(2); this.addAbility(new ConditionalTriggeredAbility(ability, condition, rule));