- Converted Land Equilibrium to script

This commit is contained in:
swordshine
2013-10-12 13:06:37 +00:00
parent 055695890e
commit ce33d146d0
3 changed files with 17 additions and 7 deletions

View File

@@ -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.

View File

@@ -5540,10 +5540,19 @@ public class Card extends GameEntity implements Comparable<Card> {
}
} else if (property.startsWith("ControllerControls")) {
final String type = property.substring(18);
if (type.startsWith("AtLeastAsMany")) {
String realType = type.split("AtLeastAsMany")[1];
List<Card> list = CardLists.getType(this.getController().getCardsIn(ZoneType.Battlefield), realType);
List<Card> yours = CardLists.getType(sourceController.getCardsIn(ZoneType.Battlefield), realType);
if (list.size() < yours.size()) {
return false;
}
} else {
final List<Card> list = this.getController().getCardsIn(ZoneType.Battlefield);
if (CardLists.getType(list, type).isEmpty()) {
return false;
}
}
} else if (property.startsWith("Other")) {
if (this.equals(source)) {
return false;

View File

@@ -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())) {