mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
crown_of_empires - uses a common variable, not a custom condition to check for M12 empire parts.
Removed special conditions from spellability/SpellAbilityCondition.java adjusted visibility for a few methods Zone: cotains(predicate<Card>) method added, still don't know if it's correct to put it there.
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
Name:Crown of Empires
|
Name:Crown of Empires
|
||||||
ManaCost:2
|
ManaCost:2
|
||||||
Types:Artifact
|
Types:Artifact
|
||||||
A:AB$ Tap | Cost$ 3 T | ValidTgts$ Creature | TgtPrompt$ Select target creature | ConditionNotAllM12Empires$ True | SubAbility$ DBControl | SpellDescription$ Tap target creature. Gain control of that creature instead if you control artifacts named Scepter of Empires and Throne of Empires.
|
A:AB$ Tap | Cost$ 3 T | ValidTgts$ Creature | TgtPrompt$ Select target creature | ConditionCheckSVar$ M12Complete | ConditionSVarCompare$ EQ0 | SubAbility$ DBControl | SpellDescription$ Tap target creature. Gain control of that creature instead if you control artifacts named Scepter of Empires and Throne of Empires.
|
||||||
SVar:DBControl:DB$ GainControl | Defined$ Targeted | ConditionAllM12Empires$ True
|
SVar:DBControl:DB$ GainControl | Defined$ Targeted | ConditionCheckSVar$ M12Complete
|
||||||
SVar:RemRandomDeck:True
|
SVar:RemRandomDeck:True
|
||||||
DeckHints:Name$Scepter of Empires|Throne of Empires
|
DeckHints:Name$Scepter of Empires|Throne of Empires
|
||||||
|
SVar:M12Complete:Count$AllM12Empires.1.0
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/crown_of_empires.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/crown_of_empires.jpg
|
||||||
Oracle:{3}, {T}: Tap target creature. Gain control of that creature instead if you control artifacts named Scepter of Empires and Throne of Empires.
|
Oracle:{3}, {T}: Tap target creature. Gain control of that creature instead if you control artifacts named Scepter of Empires and Throne of Empires.
|
||||||
SetInfo:M12 Uncommon
|
SetInfo:M12 Uncommon
|
||||||
@@ -1452,9 +1452,7 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
// Count$M12Empires.<numIf>.<numIfNot>
|
// Count$M12Empires.<numIf>.<numIfNot>
|
||||||
if (sq[0].contains("AllM12Empires")) {
|
if (sq[0].contains("AllM12Empires")) {
|
||||||
boolean has = c.getController().isCardInPlay("Crown of Empires");
|
boolean has = cc.isCardInPlay("Crown of Empires") && cc.isCardInPlay("Scepter of Empires") && cc.isCardInPlay("Throne of Empires");
|
||||||
has &= c.getController().isCardInPlay("Scepter of Empires");
|
|
||||||
has &= c.getController().isCardInPlay("Throne of Empires");
|
|
||||||
return doXMath(Integer.parseInt(sq[has ? 1 : 2]), m, c);
|
return doXMath(Integer.parseInt(sq[has ? 1 : 2]), m, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -116,13 +116,6 @@ public class SpellAbilityCondition extends SpellAbilityVariables {
|
|||||||
this.setPhases(PhaseType.parseRange(params.get("ConditionPhases")));
|
this.setPhases(PhaseType.parseRange(params.get("ConditionPhases")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.containsKey("ConditionAllM12Empires")) {
|
|
||||||
this.setAllM12Empires(true);
|
|
||||||
}
|
|
||||||
if (params.containsKey("ConditionNotAllM12Empires")) {
|
|
||||||
this.setNotAllM12Empires(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (params.containsKey("ConditionChosenColor")) {
|
if (params.containsKey("ConditionChosenColor")) {
|
||||||
this.setColorToCheck(params.get("ConditionChosenColor"));
|
this.setColorToCheck(params.get("ConditionChosenColor"));
|
||||||
}
|
}
|
||||||
@@ -233,25 +226,6 @@ public class SpellAbilityCondition extends SpellAbilityVariables {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isAllM12Empires()) {
|
|
||||||
final Player p = sa.getSourceCard().getController();
|
|
||||||
boolean has = p.isCardInPlay("Crown of Empires");
|
|
||||||
has &= p.isCardInPlay("Scepter of Empires");
|
|
||||||
has &= p.isCardInPlay("Throne of Empires");
|
|
||||||
if (!has) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.isNotAllM12Empires()) {
|
|
||||||
final Player p = sa.getSourceCard().getController();
|
|
||||||
boolean has = p.isCardInPlay("Crown of Empires");
|
|
||||||
has &= p.isCardInPlay("Scepter of Empires");
|
|
||||||
has &= p.isCardInPlay("Throne of Empires");
|
|
||||||
if (has) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.getCardsInHand() != -1) {
|
if (this.getCardsInHand() != -1) {
|
||||||
// Can handle Library of Alexandria, or Hellbent
|
// Can handle Library of Alexandria, or Hellbent
|
||||||
if (activator.getCardsIn(ZoneType.Hand).size() != this.getCardsInHand()) {
|
if (activator.getCardsIn(ZoneType.Hand).size() != this.getCardsInHand()) {
|
||||||
|
|||||||
@@ -82,8 +82,6 @@ public class SpellAbilityVariables {
|
|||||||
this.lifeAmount = sav.getLifeAmount();
|
this.lifeAmount = sav.getLifeAmount();
|
||||||
this.manaSpent = sav.getManaSpent();
|
this.manaSpent = sav.getManaSpent();
|
||||||
this.pwAbility = sav.isPwAbility();
|
this.pwAbility = sav.isPwAbility();
|
||||||
this.allM12Empires = sav.isAllM12Empires();
|
|
||||||
this.notAllM12Empires = sav.isNotAllM12Empires();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// default values for Sorcery speed abilities
|
// default values for Sorcery speed abilities
|
||||||
@@ -174,63 +172,10 @@ public class SpellAbilityVariables {
|
|||||||
/** The pw ability. */
|
/** The pw ability. */
|
||||||
private boolean pwAbility = false;
|
private boolean pwAbility = false;
|
||||||
|
|
||||||
/** The all m12 empires. */
|
|
||||||
private boolean allM12Empires = false;
|
|
||||||
|
|
||||||
/** The not all m12 empires. */
|
|
||||||
private boolean notAllM12Empires = false;
|
|
||||||
|
|
||||||
/** The chosen colors string. */
|
/** The chosen colors string. */
|
||||||
private String chosenColors = null;
|
private String chosenColors = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Setter for the field <code>notAllM12Empires</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param b
|
|
||||||
* a boolean
|
|
||||||
*/
|
|
||||||
public final void setNotAllM12Empires(final boolean b) {
|
|
||||||
this.notAllM12Empires = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Getter for the field <code>notAllM12Empires</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return a boolean
|
|
||||||
*/
|
|
||||||
public final boolean getNotAllM12Empires() {
|
|
||||||
return this.isNotAllM12Empires();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Setter for the field <code>allM12Empires</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param b
|
|
||||||
* a boolean
|
|
||||||
*/
|
|
||||||
public final void setAllM12Empires(final boolean b) {
|
|
||||||
this.allM12Empires = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Getter for the field <code>allM12Empires</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return a boolean
|
|
||||||
*/
|
|
||||||
public final boolean getAllM12Empires() {
|
|
||||||
return this.isAllM12Empires();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Setter for the field <code>manaSpent</code>.
|
* Setter for the field <code>manaSpent</code>.
|
||||||
@@ -819,25 +764,6 @@ public class SpellAbilityVariables {
|
|||||||
public final String getPresentDefined() {
|
public final String getPresentDefined() {
|
||||||
return this.presentDefined;
|
return this.presentDefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if is all m12 empires.
|
|
||||||
*
|
|
||||||
* @return the allM12Empires
|
|
||||||
*/
|
|
||||||
public final boolean isAllM12Empires() {
|
|
||||||
return this.allM12Empires;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if is not all m12 empires.
|
|
||||||
*
|
|
||||||
* @return the notAllM12Empires
|
|
||||||
*/
|
|
||||||
public final boolean isNotAllM12Empires() {
|
|
||||||
return this.notAllM12Empires;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the s var operand.
|
* Gets the s var operand.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class AiController {
|
|||||||
game = game0;
|
game = game0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final SpellAbility getSpellAbilityToPlay() {
|
private final SpellAbility getSpellAbilityToPlay() {
|
||||||
// if top of stack is owned by me
|
// if top of stack is owned by me
|
||||||
if (!game.getStack().isEmpty() && game.getStack().peekAbility().getActivatingPlayer().equals(player)) {
|
if (!game.getStack().isEmpty() && game.getStack().peekAbility().getActivatingPlayer().equals(player)) {
|
||||||
// probably should let my stuff resolve
|
// probably should let my stuff resolve
|
||||||
|
|||||||
@@ -2771,11 +2771,11 @@ public class Player extends GameEntity implements Comparable<Player> {
|
|||||||
return CardLists.filter(getCardsIn(ZoneType.Battlefield), Presets.LANDS);
|
return CardLists.filter(getCardsIn(ZoneType.Battlefield), Presets.LANDS);
|
||||||
}
|
}
|
||||||
public boolean isCardInPlay(final String cardName) {
|
public boolean isCardInPlay(final String cardName) {
|
||||||
return Iterables.any(getZone(ZoneType.Battlefield), CardPredicates.nameEquals(cardName));
|
return getZone(ZoneType.Battlefield).contains(CardPredicates.nameEquals(cardName));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCardInCommand(final String cardName) {
|
public boolean isCardInCommand(final String cardName) {
|
||||||
return Iterables.any(getZone(ZoneType.Command), CardPredicates.nameEquals(cardName));
|
return getZone(ZoneType.Command).contains(CardPredicates.nameEquals(cardName));
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Card> getColoredCardsInPlay(final String color) {
|
public List<Card> getColoredCardsInPlay(final String color) {
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ package forge.game.zone;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.google.common.base.Predicate;
|
||||||
|
|
||||||
import forge.Card;
|
import forge.Card;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -121,6 +123,7 @@ interface IZone {
|
|||||||
* @return true, if successful
|
* @return true, if successful
|
||||||
*/
|
*/
|
||||||
boolean contains(Card c);
|
boolean contains(Card c);
|
||||||
|
boolean contains(final Predicate<Card> condition);
|
||||||
/**
|
/**
|
||||||
* isEmpty returns true if given zone contains no cards.
|
* isEmpty returns true if given zone contains no cards.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ import java.util.Observable;
|
|||||||
import java.util.Observer;
|
import java.util.Observer;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
||||||
|
import com.google.common.base.Predicate;
|
||||||
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
import forge.Card;
|
import forge.Card;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.util.MyObservable;
|
import forge.util.MyObservable;
|
||||||
@@ -171,6 +174,10 @@ public class Zone extends MyObservable implements IZone, Observer, java.io.Seria
|
|||||||
return this.cardList.contains(c);
|
return this.cardList.contains(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final boolean contains(final Predicate<Card> condition) {
|
||||||
|
return Iterables.any(this.cardList, condition);
|
||||||
|
}
|
||||||
|
|
||||||
public final int getPosition(final Card c) {
|
public final int getPosition(final Card c) {
|
||||||
return this.cardList.indexOf(c);
|
return this.cardList.indexOf(c);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -412,7 +412,7 @@ public final class GuiDisplayUtil {
|
|||||||
* a {@link forge.game.player.Player} object.
|
* a {@link forge.game.player.Player} object.
|
||||||
* @return a {@link forge.CardList} object.
|
* @return a {@link forge.CardList} object.
|
||||||
*/
|
*/
|
||||||
public static List<Card> devProcessCardsForZone(final String[] data, final Player player) {
|
private static List<Card> devProcessCardsForZone(final String[] data, final Player player) {
|
||||||
final List<Card> cl = new ArrayList<Card>();
|
final List<Card> cl = new ArrayList<Card>();
|
||||||
for (final String element : data) {
|
for (final String element : data) {
|
||||||
final String[] cardinfo = element.trim().split("\\|");
|
final String[] cardinfo = element.trim().split("\\|");
|
||||||
|
|||||||
@@ -54,14 +54,4 @@ public class MyRandom {
|
|||||||
public static Random getRandom() {
|
public static Random getRandom() {
|
||||||
return MyRandom.random;
|
return MyRandom.random;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the random.
|
|
||||||
*
|
|
||||||
* @param random0
|
|
||||||
* the random to set
|
|
||||||
*/
|
|
||||||
public static void setRandom(final Random random0) {
|
|
||||||
MyRandom.random = random0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user