diff --git a/res/cardsfolder/a/advice_from_the_fae.txt b/res/cardsfolder/a/advice_from_the_fae.txt index d6791d8bacd..df814d75ce3 100644 --- a/res/cardsfolder/a/advice_from_the_fae.txt +++ b/res/cardsfolder/a/advice_from_the_fae.txt @@ -5,7 +5,7 @@ Text:no text A:SP$ Dig | Cost$ 2/U 2/U 2/U | DigNum$ 4 | ChangeNum$ 1 | SubAbility$ Dig2 | ConditionCheckSVar$ X | ConditionSVarCompare$ LEY | References$ X,Y | SpellDescription$ Look at the top five cards of your library. If you control more creatures than each other player, put two of those cards into your hand. Otherwise, put one of them into your hand. Then put the rest on the bottom of your library in any order. SVar:Dig2:DB$ Dig | DigNum$ 4 | ChangeNum$ 2 | ConditionCheckSVar$ X | ConditionSVarCompare$ GTY | References$ X,Y SVar:X:Count$Valid Creature.YouCtrl -SVar:Y:Count$Valid Creature.YouDontCtrl +SVar:Y:PlayerCountOther$HighestValid Creature.YouCtrl SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/advice_from_the_fae.jpg diff --git a/res/cardsfolder/b/bond_of_agony.txt b/res/cardsfolder/b/bond_of_agony.txt index 5b07dcb653f..64cb5a090da 100644 --- a/res/cardsfolder/b/bond_of_agony.txt +++ b/res/cardsfolder/b/bond_of_agony.txt @@ -2,7 +2,7 @@ Name:Bond of Agony ManaCost:X B Types:Sorcery Text:no text -A:SP$ LoseLife | Cost$ X B PayLife | Defined$ Opponent | LifeAmount$ X | References$ X | SpellDescription$ Each other player loses X life. +A:SP$ LoseLife | Cost$ X B PayLife | Defined$ Player.Other | LifeAmount$ X | References$ X | SpellDescription$ Each other player loses X life. SVar:X:Count$xPaid SVar:RemAIDeck:True SVar:Rarity:Uncommon diff --git a/res/cardsfolder/c/charmed_griffin.txt b/res/cardsfolder/c/charmed_griffin.txt index 4168baddca2..c9c745711d1 100644 --- a/res/cardsfolder/c/charmed_griffin.txt +++ b/res/cardsfolder/c/charmed_griffin.txt @@ -5,7 +5,7 @@ Text:no text PT:3/3 K:Flying T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, each other player may put an artifact or enchantment card onto the battlefield from his or her hand. -SVar:TrigChange:AB$ ChangeZone | Cost$ 0 | Origin$ Hand | Destination$ Battlefield | ChangeType$ Artifact,Enchantment | DefinedPlayer$ Opponent | ChangeNum$ 1 +SVar:TrigChange:AB$ ChangeZone | Cost$ 0 | Origin$ Hand | Destination$ Battlefield | ChangeType$ Artifact,Enchantment | DefinedPlayer$ Player.Other | ChangeNum$ 1 SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/charmed_griffin.jpg SetInfo:MMQ|Uncommon|http://magiccards.info/scans/en/mm/7.jpg diff --git a/res/cardsfolder/c/curse_of_echoes.txt b/res/cardsfolder/c/curse_of_echoes.txt index 1a3569067c5..bde2c184c0b 100644 --- a/res/cardsfolder/c/curse_of_echoes.txt +++ b/res/cardsfolder/c/curse_of_echoes.txt @@ -7,6 +7,7 @@ A:SP$ Attach | Cost$ 4 U | ValidTgts$ Player | AILogic$ Curse T:Mode$ SpellCast | ValidCard$ Instant,Sorcery | ValidActivatingPlayer$ Player.EnchantedBy | Execute$ TrigCopy | TriggerZones$ Battlefield | OptionalDecider$ TriggeredCardOpponent | TriggerDescription$ Whenever enchanted player casts an instant or sorcery spell, each other player may copy that spell and may choose new targets for the copy he or she controls. SVar:TrigCopy:AB$ CopySpellAbility | Cost$ 0 | Defined$ TriggeredSpellAbility | Controller$ TriggeredCardOpponent SVar:RemAIDeck:True +SVar:RemMultiplayer:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/curse_of_echoes.jpg SetInfo:DKA|Rare|http://magiccards.info/scans/en/dka/34.jpg diff --git a/res/cardsfolder/e/enslaved_horror.txt b/res/cardsfolder/e/enslaved_horror.txt index 100466f028e..d863a6a653d 100644 --- a/res/cardsfolder/e/enslaved_horror.txt +++ b/res/cardsfolder/e/enslaved_horror.txt @@ -3,8 +3,9 @@ ManaCost:3 B Types:Creature Horror Text:no text PT:4/4 -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, each other player may return a creature card from his or her graveyard to the battlefield. -SVar:TrigChange:AB$ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Battlefield | ChangeType$ Creature.YouDontCtrl | DefinedPlayer$ Opponent | ChangeNum$ 1 | Hidden$ True | Optional$ True +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ RepeatPlayers | TriggerDescription$ When CARDNAME enters the battlefield, each other player may return a creature card from his or her graveyard to the battlefield. +SVar:RepeatPlayers:AB$ RepeatEach | Cost$ 0 | RepeatPlayers$ Player | RepeatSubAbility$ TrigChange +SVar:TrigChange:DB$ ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Battlefield | ChangeType$ Creature.RememberedPlayerCtrl | DefinedPlayer$ Player.Opponent | ChangeNum$ 1 | Hidden$ True | Optional$ True SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/enslaved_horror.jpg diff --git a/res/cardsfolder/g/ghazban_ogre.txt b/res/cardsfolder/g/ghazban_ogre.txt index 840a84c270f..2ea953c2cd5 100644 --- a/res/cardsfolder/g/ghazban_ogre.txt +++ b/res/cardsfolder/g/ghazban_ogre.txt @@ -3,11 +3,8 @@ ManaCost:G Types:Creature Ogre Text:no text PT:2/2 -T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | LifeTotal$ Opponent | LifeAmount$ GTX | Execute$ TrigOppControl | TriggerDescription$ At the beginning of your upkeep, if a player has more life than each other player, the player with the most life gains control of CARDNAME. -SVar:TrigOppControl:AB$ GainControl | Cost$ 0 | Defined$ Self | NewController$ Opponent -SVar:X:Count$YourLifeTotal -T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | LifeTotal$ You | LifeAmount$ GTY | Execute$ TrigYouControl | Secondary$ True | TriggerDescription$ At the beginning of your upkeep, if a player has more life than each other player, the player with the most life gains control of CARDNAME. -SVar:TrigYouControl:AB$ GainControl | Cost$ 0 | Defined$ Self | NewController$ You +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | APlayerHasMoreLifeThanEachOther$ True | LifeAmount$ GTX | Execute$ TrigOppControl | TriggerDescription$ At the beginning of your upkeep, if a player has more life than each other player, the player with the most life gains control of CARDNAME. +SVar:TrigOppControl:AB$ GainControl | Cost$ 0 | Defined$ Self | NewController$ Player.withMostLife SVar:Y:Count$OppLifeTotal SVar:RemAIDeck:True SVar:Rarity:Common diff --git a/res/cardsfolder/g/grave_pact.txt b/res/cardsfolder/g/grave_pact.txt index d85426bff79..3d10c372db0 100644 --- a/res/cardsfolder/g/grave_pact.txt +++ b/res/cardsfolder/g/grave_pact.txt @@ -3,7 +3,7 @@ ManaCost:1 B B B Types:Enchantment Text:no text T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.YouCtrl | TriggerZones$ Battlefield | Execute$ TrigSac | TriggerDescription$ Whenever a creature you control is put into a graveyard from the battlefield, each other player sacrifices a creature. -SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ Opponent | SacValid$ Creature +SVar:TrigSac:AB$ Sacrifice | Cost$ 0 | Defined$ Player.Other | SacValid$ Creature SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/grave_pact.jpg SetInfo:8ED|Rare|http://magiccards.info/scans/en/8e/137.jpg diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactory.java b/src/main/java/forge/card/abilityfactory/AbilityFactory.java index 89ca89fe279..5f780c6f1bd 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactory.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactory.java @@ -552,6 +552,9 @@ public class AbilityFactory { } else if (hType.equals("Opponents")) { players.addAll(card.getController().getOpponents()); return CardFactoryUtil.playerXCount(players, calcX[1], card) * multiplier; + } else if (hType.equals("Other")) { + players.addAll(card.getController().getAllOtherPlayers()); + return CardFactoryUtil.playerXCount(players, calcX[1], card) * multiplier; } else if (hType.equals("Remembered")) { for (final Object o : card.getRemembered()) { if (o instanceof Player) { diff --git a/src/main/java/forge/card/trigger/Trigger.java b/src/main/java/forge/card/trigger/Trigger.java index 5a2d06a249f..92d8d3f41ef 100644 --- a/src/main/java/forge/card/trigger/Trigger.java +++ b/src/main/java/forge/card/trigger/Trigger.java @@ -34,6 +34,7 @@ import forge.card.spellability.Ability; import forge.card.spellability.SpellAbility; import forge.game.phase.PhaseHandler; import forge.game.phase.PhaseType; +import forge.game.player.Player; import forge.game.zone.ZoneType; import forge.util.Expressions; @@ -335,6 +336,26 @@ public abstract class Trigger extends TriggerReplacementBase { } + if (this.getMapParams().containsKey("APlayerHasMoreLifeThanEachOther")) { + int highestLife = -50; // Negative base just in case a few Lich's or Platinum Angels are running around + final List healthiest = new ArrayList(); + for (final Player p : Singletons.getModel().getGame().getPlayers()) { + if (p.getLife() > highestLife) { + healthiest.clear(); + highestLife = p.getLife(); + healthiest.add(p); + } else if (p.getLife() == highestLife) { + highestLife = p.getLife(); + healthiest.add(p); + } + } + + if (healthiest.size() != 1) { + // More than one player tied for most life + return false; + } + } + if (this.getMapParams().containsKey("IsPresent")) { final String sIsPresent = this.getMapParams().get("IsPresent"); String presentCompare = "GE1"; diff --git a/src/main/java/forge/game/player/Player.java b/src/main/java/forge/game/player/Player.java index 461c2778ec0..0f77ebf746a 100644 --- a/src/main/java/forge/game/player/Player.java +++ b/src/main/java/forge/game/player/Player.java @@ -2589,6 +2589,18 @@ public abstract class Player extends GameEntity implements Comparable { if (oppList.size() <= yourList.size()) { return false; } + } else if (property.startsWith("withMostLife")) { + int highestLife = -50; // Negative base just in case a few Lich's are running around + Player healthiest = null; + for (final Player p : Singletons.getModel().getGame().getPlayers()) { + if (p.getLife() > highestLife) { + highestLife = p.getLife(); + healthiest = p; + } + } + if (!this.equals(healthiest)) { + return false; + } } return true;