- The keyword "CARDNAME enters the battlefield tapped." will now be checked at runtime.

- Added the static ability ETBTapped and converted six cards to script.
This commit is contained in:
Sloth
2011-11-19 08:02:15 +00:00
parent 0336ab87f5
commit 94e50fe399
11 changed files with 86 additions and 18 deletions

1
.gitattributes vendored
View File

@@ -10630,6 +10630,7 @@ src/main/java/forge/card/staticability/StaticAbility.java svneol=native#text/pla
src/main/java/forge/card/staticability/StaticAbilityCantBeCast.java svneol=native#text/plain
src/main/java/forge/card/staticability/StaticAbilityCantTarget.java -text
src/main/java/forge/card/staticability/StaticAbilityContinuous.java svneol=native#text/plain
src/main/java/forge/card/staticability/StaticAbilityETBTapped.java -text
src/main/java/forge/card/staticability/StaticAbilityPreventDamage.java -text svneol=native#text/plain
src/main/java/forge/card/staticability/package-info.java svneol=native#text/plain
src/main/java/forge/card/trigger/Trigger.java svneol=native#text/plain

View File

@@ -1,7 +1,8 @@
Name:Frozen AEther
ManaCost:3 U
Types:Enchantment
Text:Artifacts, creatures, and lands your opponents control enter the battlefield tapped.
Text:no text
S:Mode$ ETBTapped | ValidCard$ Artifact.YouDontCtrl,Creature.YouDontCtrl,Land.YouDontCtrl | Description$ Artifacts, creatures, and lands your opponents control enter the battlefield tapped.
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/frozen_aether.jpg
SetInfo:PLC|Uncommon|http://magiccards.info/scans/en/pc/54.jpg

View File

@@ -1,7 +1,8 @@
Name:Kismet
ManaCost:3 W
Types:Enchantment
Text:Artifacts, creatures, and lands your opponents control enter the battlefield tapped.
Text:no text
S:Mode$ ETBTapped | ValidCard$ Artifact.YouDontCtrl,Creature.YouDontCtrl,Land.YouDontCtrl | Description$ Artifacts, creatures, and lands your opponents control enter the battlefield tapped.
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/kismet.jpg
SetInfo:5ED|Uncommon|http://magiccards.info/scans/en/5e/319.jpg

View File

@@ -1,8 +1,9 @@
Name:Loxodon Gatekeeper
ManaCost:2 W W
Types:Creature Elephant Soldier
Text:Artifacts, creatures, and lands your opponents control enter the battlefield tapped.
Text:no text
PT:2/3
S:Mode$ ETBTapped | ValidCard$ Artifact.YouDontCtrl,Creature.YouDontCtrl,Land.YouDontCtrl | Description$ Artifacts, creatures, and lands your opponents control enter the battlefield tapped.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/loxodon_gatekeeper.jpg
SetInfo:RAV|Rare|http://magiccards.info/scans/en/rav/25.jpg

View File

@@ -1,7 +1,8 @@
Name:Orb of Dreams
ManaCost:3
Types:Artifact
Text:Permanents enter the battlefield tapped.
Text:no text
S:Mode$ ETBTapped | ValidCard$ Permanent | Description$ Permanents enter the battlefield tapped.
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/orb_of_dreams.jpg

View File

@@ -1,7 +1,8 @@
Name:Root Maze
ManaCost:G
Types:Enchantment
Text:Artifacts and lands enter the battlefield tapped.
Text:no text
S:Mode$ ETBTapped | ValidCard$ Artifact,Land | Description$ Artifacts and lands enter the battlefield tapped.
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/root_maze.jpg

View File

@@ -1,9 +1,10 @@
Name:Urabrask the Hidden
ManaCost:3 R R
Types:Legendary Creature Praetor
Text:Creatures your opponents control enter the battlefield tapped.
Text:
PT:4/4
S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddKeyword$ Haste | Description$ Creatures you control have haste.
S:Mode$ ETBTapped | ValidCard$ Creature.YouDontCtrl | Description$ Creatures your opponents control enter the battlefield tapped.
SVar:PlayMain1:TRUE
SVar:BuffedBy:Creature
SVar:Rarity:Mythic

View File

@@ -4,9 +4,9 @@ import java.util.ArrayList;
import java.util.Iterator;
import forge.Constant.Zone;
import forge.card.cardfactory.CardFactoryUtil;
import forge.card.spellability.Ability;
import forge.card.spellability.SpellAbility;
import forge.card.staticability.StaticAbility;
/**
* <p>
@@ -49,15 +49,23 @@ public class PlayerZoneComesIntoPlay extends DefaultPlayerZone {
final Card c = (Card) o;
final Player player = c.getController();
if (trigger
&& ((CardFactoryUtil.oppHasKismet(c.getController())
&& (c.isLand() || c.isCreature() || c.isArtifact()))
|| (AllZoneUtil.isCardInPlay("Urabrask the Hidden", c.getController().getOpponent()) && c
.isCreature())
|| (AllZoneUtil.isCardInPlay("Root Maze") && (c.isLand() || c.isArtifact())) || (AllZoneUtil
.isCardInPlay("Orb of Dreams") && c.isPermanent()))) {
if (trigger) {
if (c.hasKeyword("CARDNAME enters the battlefield tapped.")) {
// it enters the battlefield this way, and should not fire triggers
c.setTapped(true);
} else {
// ETBTapped static abilities
final CardList allp = AllZoneUtil.getCardsIn(Zone.Battlefield);
for (final Card ca : allp) {
final ArrayList<StaticAbility> staticAbilities = ca.getStaticAbilities();
for (final StaticAbility stAb : staticAbilities) {
if (stAb.applyAbility("ETBTapped", c)) {
// it enters the battlefield this way, and should not fire triggers
c.setTapped(true);
}
}
}
}
}
// cannot use addComesIntoPlayCommand - trigger might be set to false;

View File

@@ -4932,7 +4932,7 @@ public class CardFactoryUtil {
*
*/
public static final void parseKeywords(final Card card, final String cardName) {
if (card.hasKeyword("CARDNAME enters the battlefield tapped.")) {
/*if (card.hasKeyword("CARDNAME enters the battlefield tapped.")) {
card.addComesIntoPlayCommand(new Command() {
private static final long serialVersionUID = 203335252453049234L;
@@ -4943,7 +4943,7 @@ public class CardFactoryUtil {
card.setTapped(true);
}
});
} // if "Comes into play tapped."
}*/ // if "Comes into play tapped."
if (card.hasKeyword("CARDNAME enters the battlefield tapped unless you control two or fewer other lands.")) {
card.addComesIntoPlayCommand(new Command() {
private static final long serialVersionUID = 6436821515525468682L;

View File

@@ -319,6 +319,24 @@ public class StaticAbility {
return false;
}
public final boolean applyAbility(final String mode, final Card card) {
// don't apply the ability if it hasn't got the right mode
if (!this.mapParams.get("Mode").equals(mode)) {
return false;
}
if (this.isSuppressed() || !this.checkConditions()) {
return false;
}
if (mode.equals("ETBTapped")) {
return StaticAbilityETBTapped.applyETBTappedAbility(this, card);
}
return false;
}
/**
* Check conditions.
*

View File

@@ -0,0 +1,35 @@
package forge.card.staticability;
import java.util.HashMap;
import forge.Card;
/**
* The Class StaticAbility_CantBeCast.
*/
public class StaticAbilityETBTapped {
/**
* TODO Write javadoc for this method.
*
* @param stAb
* a StaticAbility
* @param card
* the card
* @param activator
* the activator
* @return true, if successful
*/
public static boolean applyETBTappedAbility(final StaticAbility stAb, final Card card) {
final HashMap<String, String> params = stAb.getMapParams();
final Card hostCard = stAb.getHostCard();
if (params.containsKey("ValidCard")
&& !card.isValid(params.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
return false;
}
return true;
}
}