From ce33d146d0baafb8da033ff3c53a4fb03a7e0ba4 Mon Sep 17 00:00:00 2001 From: swordshine Date: Sat, 12 Oct 2013 13:06:37 +0000 Subject: [PATCH] - Converted Land Equilibrium to script --- res/cardsfolder/l/land_equilibrium.txt | 5 +++-- src/main/java/forge/Card.java | 15 ++++++++++++--- .../forge/game/zone/PlayerZoneBattlefield.java | 4 ++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/res/cardsfolder/l/land_equilibrium.txt b/res/cardsfolder/l/land_equilibrium.txt index c53c3b4d060..dab01940e2f 100644 --- a/res/cardsfolder/l/land_equilibrium.txt +++ b/res/cardsfolder/l/land_equilibrium.txt @@ -1,7 +1,8 @@ Name:Land Equilibrium ManaCost:2 U U Types:Enchantment -Text:If an opponent who controls at least as many lands as you do would put a land onto the battlefield, that player instead puts that land onto the battlefield then sacrifices a land. -SVar:SacLand:DB$ Sacrifice | SacValid$ Land | Defined$ Opponent | SpellDescription$ Opponent sacrifices a land +R:Event$ Moved | ActiveZones$ Battlefield | Destination$ Battlefield | ValidCard$ Land.OppCtrl+ControllerControlsAtLeastAsManyLand | ReplaceWith$ MoveToPlay | Description$ If an opponent who controls at least as many lands as you do would put a land onto the battlefield, that player instead puts that land onto the battlefield then sacrifices a land. +SVar:MoveToPlay:DB$ ChangeZone | Origin$ All | Destination$ Battlefield | Defined$ ReplacedCard | SubAbility$ SacLand +SVar:SacLand:DB$ Sacrifice | SacValid$ Land | Defined$ ReplacedCardController SVar:Picture:http://www.wizards.com/global/images/magic/general/land_equilibrium.jpg Oracle:If an opponent who controls at least as many lands as you do would put a land onto the battlefield, that player instead puts that land onto the battlefield then sacrifices a land. \ No newline at end of file diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index 3779242118f..eea3d01b342 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -5540,9 +5540,18 @@ public class Card extends GameEntity implements Comparable { } } else if (property.startsWith("ControllerControls")) { final String type = property.substring(18); - final List list = this.getController().getCardsIn(ZoneType.Battlefield); - if (CardLists.getType(list, type).isEmpty()) { - return false; + if (type.startsWith("AtLeastAsMany")) { + String realType = type.split("AtLeastAsMany")[1]; + List list = CardLists.getType(this.getController().getCardsIn(ZoneType.Battlefield), realType); + List yours = CardLists.getType(sourceController.getCardsIn(ZoneType.Battlefield), realType); + if (list.size() < yours.size()) { + return false; + } + } else { + final List list = this.getController().getCardsIn(ZoneType.Battlefield); + if (CardLists.getType(list, type).isEmpty()) { + return false; + } } } else if (property.startsWith("Other")) { if (this.equals(source)) { diff --git a/src/main/java/forge/game/zone/PlayerZoneBattlefield.java b/src/main/java/forge/game/zone/PlayerZoneBattlefield.java index bed5d4fab1b..9b346b8310d 100644 --- a/src/main/java/forge/game/zone/PlayerZoneBattlefield.java +++ b/src/main/java/forge/game/zone/PlayerZoneBattlefield.java @@ -84,7 +84,7 @@ public class PlayerZoneBattlefield extends PlayerZone { c.setSickness(true); // summoning sickness c.executeTrigger(ZCTrigger.ENTERFIELD); - if (c.isLand()) { + /*if (c.isLand()) { for( Player opp : c.getOwner().getOpponents()) @@ -97,7 +97,7 @@ public class PlayerZoneBattlefield extends PlayerZone { game.getStack().addSimultaneousStackEntry(abSac); } } - } // isLand() + } // isLand()*/ } if (game.getStaticEffects().getCardToEffectsList().containsKey(c.getName())) {