- Fixed Whimwader.

- Converted Kulrath Knight to script.
- Performance update in canAttackNextTurn.
This commit is contained in:
Sloth
2012-06-29 17:02:17 +00:00
parent 5500b86e84
commit 6f27c07481
4 changed files with 44 additions and 74 deletions

View File

@@ -1,10 +1,11 @@
Name:Kulrath Knight
ManaCost:3 BR BR
Types:Creature Elemental Knight
Text:Creatures your opponents control with counters on them can't attack or block.
Text:no text
PT:3/3
K:Flying
K:Wither
S:Mode$ Continuous | Affected$ Creature.YouDontCtrl+HasCounters | AddHiddenKeyword$ HIDDEN CARDNAME can't attack or block. | Description$ Creatures your opponents control with counters on them can't attack or block.
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/kulrath_knight.jpg
SetInfo:SHM|Uncommon|http://magiccards.info/scans/en/shm/190.jpg

View File

@@ -7118,6 +7118,10 @@ public class Card extends GameEntity implements Comparable<Card> {
if (!((this.getAbilityText().trim().equals("") || this.isFaceDown()) && (this.getUnhiddenKeyword().size() == 0))) {
return false;
}
} else if (property.equals("HasCounters")) {
if (!this.hasCounters()) {
return false;
}
} else if (property.equals("SameNameAsImprinted")) {
boolean b = false;
for (final Card card : source.getImprinted()) {

View File

@@ -137,7 +137,6 @@ public class CardList implements Iterable<Card> {
list.add(c);
}
}
return list;
} // getColor()

View File

@@ -32,6 +32,7 @@ import forge.AllZoneUtil;
import forge.Card;
import forge.CardList;
import forge.CardListFilter;
import forge.CardListUtil;
import forge.Command;
import forge.Constant;
import forge.Counters;
@@ -130,18 +131,6 @@ public class CombatUtil {
return false;
}
final CardList kulrath = AllZoneUtil.getCardsIn(ZoneType.Battlefield, "Kulrath Knight");
if (kulrath.size() > 0) {
for (int i = 0; i < kulrath.size(); i++) {
final Card cKK = kulrath.get(i);
final Player oppKK = cKK.getController().getOpponent();
if (blocker.getController().equals(oppKK) && blocker.hasCounters()) {
return false;
}
}
}
return true;
}
@@ -768,34 +757,32 @@ public class CombatUtil {
final CardList list = c.getController().getOpponent().getCardsIn(ZoneType.Battlefield);
CardList temp;
if (c.hasKeyword("CARDNAME can't attack unless defending player controls an Island.")) {
for (String keyword : c.getKeyword()) {
if (keyword.equals("CARDNAME can't attack.") || keyword.equals("CARDNAME can't attack or block.")) {
return false;
} else if (keyword.equals("Defender") && !c.hasKeyword("CARDNAME can attack as though it didn't have defender.")) {
return false;
} else if (keyword.equals("CARDNAME can't attack unless defending player controls an Island.")) {
temp = list.getType("Island");
if (temp.isEmpty()) {
return false;
}
}
if (c.hasKeyword("CARDNAME can't attack unless defending player controls a Forest.")) {
} else if (keyword.equals("CARDNAME can't attack unless defending player controls a Forest.")) {
temp = list.getType("Forest");
if (temp.isEmpty()) {
return false;
}
}
if (c.hasKeyword("CARDNAME can't attack unless defending player controls a Swamp.")) {
} else if (keyword.equals("CARDNAME can't attack unless defending player controls a Swamp.")) {
temp = list.getType("Swamp");
if (temp.isEmpty()) {
return false;
}
}
if (c.hasKeyword("CARDNAME can't attack unless defending player controls a Mountain.")) {
temp = list.getType("Montain");
} else if (keyword.equals("CARDNAME can't attack unless defending player controls a Mountain.")) {
temp = list.getType("Mountain");
if (temp.isEmpty()) {
return false;
}
}
if (c.hasKeyword("CARDNAME can't attack unless defending player controls a snow land.")) {
} else if (keyword.equals("CARDNAME can't attack unless defending player controls a snow land.")) {
temp = list.filter(new CardListFilter() {
@Override
public boolean addCard(final Card c) {
@@ -805,14 +792,13 @@ public class CombatUtil {
if (temp.isEmpty()) {
return false;
}
}
if (c.hasKeyword("CARDNAME can't attack unless defending player controls a blue permanent.")) {
temp = list.getColor(Constant.Color.BLUE);
} else if (keyword.equals("CARDNAME can't attack unless defending player controls a blue permanent.")) {
temp = CardListUtil.getColor(list, Constant.Color.BLUE);
if (temp.isEmpty()) {
return false;
}
}
}
if (c.getName().equals("Harbor Serpent")) {
final CardList allislands = AllZoneUtil.getCardsIn(ZoneType.Battlefield).getType("Island");
@@ -826,26 +812,6 @@ public class CombatUtil {
return false;
}
if (c.hasKeyword("CARDNAME can't attack.") || c.hasKeyword("CARDNAME can't attack or block.")) {
return false;
}
if (c.hasKeyword("Defender") && !c.hasKeyword("CARDNAME can attack as though it didn't have defender.")) {
return false;
}
if (AllZoneUtil.isCardInPlay("Kulrath Knight")) {
final CardList all = AllZoneUtil.getCardsIn(ZoneType.Battlefield, "Kulrath Knight");
for (int i = 0; i < all.size(); i++) {
final Card cKK = all.get(i);
final Player oppKK = cKK.getController().getOpponent();
if (c.getController().equals(oppKK) && c.hasCounters()) {
return false;
}
}
}
return true;
} // canAttack()