(StringOp.EQUALS) {
+ @Override
+ public boolean apply(PaperCard subject) {
+ return op(subject, what);
+ }
+ };
+ }
+
+}
diff --git a/forge-game/pom.xml b/forge-game/pom.xml
index 117c4abbebd..e9cf2c327e8 100644
--- a/forge-game/pom.xml
+++ b/forge-game/pom.xml
@@ -6,7 +6,7 @@
forge
forge
- 1.6.33-SNAPSHOT
+ 1.6.34-SNAPSHOT
forge-game
diff --git a/forge-game/src/main/java/forge/game/Game.java b/forge-game/src/main/java/forge/game/Game.java
index 849e2de4a0d..2a49bae9d59 100644
--- a/forge-game/src/main/java/forge/game/Game.java
+++ b/forge-game/src/main/java/forge/game/Game.java
@@ -914,4 +914,17 @@ public class Game {
}
return false;
}
+
+ public Player getControlVote() {
+ Player result = null;
+ long maxValue = 0;
+ for (Player p : getPlayers()) {
+ Long v = p.getHighestControlVote();
+ if (v != null && v > maxValue) {
+ maxValue = v;
+ result = p;
+ }
+ }
+ return result;
+ }
}
diff --git a/forge-game/src/main/java/forge/game/StaticEffect.java b/forge-game/src/main/java/forge/game/StaticEffect.java
index dc9d51094a0..d6ce1813d7e 100644
--- a/forge-game/src/main/java/forge/game/StaticEffect.java
+++ b/forge-game/src/main/java/forge/game/StaticEffect.java
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
@@ -37,7 +37,7 @@ import com.google.common.collect.Maps;
*
* StaticEffect class.
*
- *
+ *
* @author Forge
* @version $Id$
*/
@@ -72,7 +72,7 @@ public class StaticEffect {
/**
* setTimestamp TODO Write javadoc for this method.
- *
+ *
* @param t
* a long
*/
@@ -82,7 +82,7 @@ public class StaticEffect {
/**
* getTimestamp. TODO Write javadoc for this method.
- *
+ *
* @return a long
*/
public final long getTimestamp() {
@@ -93,7 +93,7 @@ public class StaticEffect {
*
* Getter for the field source.
*
- *
+ *
* @return a {@link forge.game.card.Card} object.
*/
public final Card getSource() {
@@ -104,7 +104,7 @@ public class StaticEffect {
*
* Getter for the field affectedCards.
*
- *
+ *
* @return a {@link forge.CardList} object.
*/
public final CardCollectionView getAffectedCards() {
@@ -115,7 +115,7 @@ public class StaticEffect {
*
* Setter for the field affectedCards.
*
- *
+ *
* @param list
* a {@link forge.CardList} object.
*/
@@ -125,7 +125,7 @@ public class StaticEffect {
/**
* Gets the affected players.
- *
+ *
* @return the affected players
*/
public final List getAffectedPlayers() {
@@ -134,7 +134,7 @@ public class StaticEffect {
/**
* Sets the affected players.
- *
+ *
* @param list
* the new affected players
*/
@@ -144,7 +144,7 @@ public class StaticEffect {
/**
* setParams. TODO Write javadoc for this method.
- *
+ *
* @param params
* a HashMap
*/
@@ -154,7 +154,7 @@ public class StaticEffect {
/**
* Gets the params.
- *
+ *
* @return the params
*/
public final Map getParams() {
@@ -171,13 +171,12 @@ public class StaticEffect {
/**
* Undo everything that was changed by this effect.
- *
+ *
* @return a {@link CardCollectionView} of all affected cards.
*/
final CardCollectionView remove() {
final CardCollectionView affectedCards = getAffectedCards();
final List affectedPlayers = getAffectedPlayers();
- //final Map params = getParams();
String changeColorWordsTo = null;
@@ -245,6 +244,10 @@ public class StaticEffect {
p.removeMaxLandPlays(getTimestamp());
p.removeMaxLandPlaysInfinite(getTimestamp());
+
+ p.removeControlVote(getTimestamp());
+ p.removeAdditionalVote(getTimestamp());
+ p.removeAdditionalOptionalVote(getTimestamp());
}
// modify the affected card
diff --git a/forge-game/src/main/java/forge/game/ability/effects/DebuffEffect.java b/forge-game/src/main/java/forge/game/ability/effects/DebuffEffect.java
index 442fe3c5340..2595c792dec 100644
--- a/forge-game/src/main/java/forge/game/ability/effects/DebuffEffect.java
+++ b/forge-game/src/main/java/forge/game/ability/effects/DebuffEffect.java
@@ -70,7 +70,7 @@ public class DebuffEffect extends SpellAbilityEffect {
for (final Card tgtC : getTargetCards(sa)) {
final List addedKW = Lists.newArrayList();
final List removedKW = Lists.newArrayList();
- if (tgtC.isInPlay() && tgtC.canBeTargetedBy(sa)) {
+ if (tgtC.isInPlay() && (!sa.usesTargeting() || tgtC.canBeTargetedBy(sa))) {
if (sa.hasParam("AllSuffixKeywords")) {
String suffix = sa.getParam("AllSuffixKeywords");
for (final KeywordInterface kw : tgtC.getKeywords()) {
diff --git a/forge-game/src/main/java/forge/game/ability/effects/VoteEffect.java b/forge-game/src/main/java/forge/game/ability/effects/VoteEffect.java
index 769e758388c..cc572a9c5fd 100644
--- a/forge-game/src/main/java/forge/game/ability/effects/VoteEffect.java
+++ b/forge-game/src/main/java/forge/game/ability/effects/VoteEffect.java
@@ -1,6 +1,7 @@
package forge.game.ability.effects;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -9,9 +10,9 @@ import forge.game.ability.AbilityKey;
import org.apache.commons.lang3.StringUtils;
import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.Iterables;
import com.google.common.collect.ListMultimap;
import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
import forge.game.Game;
import forge.game.ability.AbilityFactory;
@@ -19,10 +20,7 @@ import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card;
import forge.game.card.CardLists;
-import forge.game.card.CardPredicates;
import forge.game.player.Player;
-import forge.game.player.PlayerCollection;
-import forge.game.player.PlayerPredicates;
import forge.game.spellability.AbilitySub;
import forge.game.spellability.SpellAbility;
import forge.game.trigger.TriggerType;
@@ -67,33 +65,29 @@ public class VoteEffect extends SpellAbilityEffect {
return;
}
- // starting with the activator
- int pSize = tgtPlayers.size();
Player activator = sa.getActivatingPlayer();
- while (tgtPlayers.contains(activator) && !activator.equals(Iterables.getFirst(tgtPlayers, null))) {
- tgtPlayers.add(pSize - 1, tgtPlayers.remove(0));
+
+ // starting with the activator
+ int aidx = tgtPlayers.indexOf(activator);
+ if (aidx != -1) {
+ Collections.rotate(tgtPlayers, -aidx);
}
+
ListMultimap