- 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/StaticAbilityCantBeCast.java svneol=native#text/plain
src/main/java/forge/card/staticability/StaticAbilityCantTarget.java -text 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/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/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/staticability/package-info.java svneol=native#text/plain
src/main/java/forge/card/trigger/Trigger.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 Name:Frozen AEther
ManaCost:3 U ManaCost:3 U
Types:Enchantment 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:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/frozen_aether.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/frozen_aether.jpg
SetInfo:PLC|Uncommon|http://magiccards.info/scans/en/pc/54.jpg SetInfo:PLC|Uncommon|http://magiccards.info/scans/en/pc/54.jpg

View File

@@ -1,7 +1,8 @@
Name:Kismet Name:Kismet
ManaCost:3 W ManaCost:3 W
Types:Enchantment 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:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/kismet.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/kismet.jpg
SetInfo:5ED|Uncommon|http://magiccards.info/scans/en/5e/319.jpg SetInfo:5ED|Uncommon|http://magiccards.info/scans/en/5e/319.jpg

View File

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

View File

@@ -1,7 +1,8 @@
Name:Orb of Dreams Name:Orb of Dreams
ManaCost:3 ManaCost:3
Types:Artifact 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:RemRandomDeck:True
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/orb_of_dreams.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/orb_of_dreams.jpg

View File

@@ -1,7 +1,8 @@
Name:Root Maze Name:Root Maze
ManaCost:G ManaCost:G
Types:Enchantment 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:RemRandomDeck:True
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/root_maze.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/root_maze.jpg

View File

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

View File

@@ -4,9 +4,9 @@ import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import forge.Constant.Zone; import forge.Constant.Zone;
import forge.card.cardfactory.CardFactoryUtil;
import forge.card.spellability.Ability; import forge.card.spellability.Ability;
import forge.card.spellability.SpellAbility; import forge.card.spellability.SpellAbility;
import forge.card.staticability.StaticAbility;
/** /**
* <p> * <p>
@@ -49,15 +49,23 @@ public class PlayerZoneComesIntoPlay extends DefaultPlayerZone {
final Card c = (Card) o; final Card c = (Card) o;
final Player player = c.getController(); final Player player = c.getController();
if (trigger if (trigger) {
&& ((CardFactoryUtil.oppHasKismet(c.getController()) if (c.hasKeyword("CARDNAME enters the battlefield tapped.")) {
&& (c.isLand() || c.isCreature() || c.isArtifact())) // it enters the battlefield this way, and should not fire triggers
|| (AllZoneUtil.isCardInPlay("Urabrask the Hidden", c.getController().getOpponent()) && c c.setTapped(true);
.isCreature()) } else {
|| (AllZoneUtil.isCardInPlay("Root Maze") && (c.isLand() || c.isArtifact())) || (AllZoneUtil // ETBTapped static abilities
.isCardInPlay("Orb of Dreams") && c.isPermanent()))) { final CardList allp = AllZoneUtil.getCardsIn(Zone.Battlefield);
// it enters the battlefield this way, and should not fire triggers for (final Card ca : allp) {
c.setTapped(true); 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; // 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) { 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() { card.addComesIntoPlayCommand(new Command() {
private static final long serialVersionUID = 203335252453049234L; private static final long serialVersionUID = 203335252453049234L;
@@ -4943,7 +4943,7 @@ public class CardFactoryUtil {
card.setTapped(true); 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.")) { if (card.hasKeyword("CARDNAME enters the battlefield tapped unless you control two or fewer other lands.")) {
card.addComesIntoPlayCommand(new Command() { card.addComesIntoPlayCommand(new Command() {
private static final long serialVersionUID = 6436821515525468682L; private static final long serialVersionUID = 6436821515525468682L;

View File

@@ -318,6 +318,24 @@ public class StaticAbility {
return false; 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. * 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;
}
}