mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- Fixed Whimwader.
- Converted Kulrath Knight to script. - Performance update in canAttackNextTurn.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -137,7 +137,6 @@ public class CardList implements Iterable<Card> {
|
||||
list.add(c);
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
} // getColor()
|
||||
|
||||
|
||||
@@ -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,49 +757,46 @@ 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.")) {
|
||||
temp = list.getType("Island");
|
||||
if (temp.isEmpty()) {
|
||||
for (String keyword : c.getKeyword()) {
|
||||
if (keyword.equals("CARDNAME can't attack.") || keyword.equals("CARDNAME can't attack or block.")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (c.hasKeyword("CARDNAME can't attack unless defending player controls a Forest.")) {
|
||||
temp = list.getType("Forest");
|
||||
if (temp.isEmpty()) {
|
||||
} else if (keyword.equals("Defender") && !c.hasKeyword("CARDNAME can attack as though it didn't have defender.")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (c.hasKeyword("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");
|
||||
if (temp.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (c.hasKeyword("CARDNAME can't attack unless defending player controls a snow land.")) {
|
||||
temp = list.filter(new CardListFilter() {
|
||||
@Override
|
||||
public boolean addCard(final Card c) {
|
||||
return c.isLand() && c.isSnow();
|
||||
} else if (keyword.equals("CARDNAME can't attack unless defending player controls an Island.")) {
|
||||
temp = list.getType("Island");
|
||||
if (temp.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
} else if (keyword.equals("CARDNAME can't attack unless defending player controls a Forest.")) {
|
||||
temp = list.getType("Forest");
|
||||
if (temp.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
} else if (keyword.equals("CARDNAME can't attack unless defending player controls a Swamp.")) {
|
||||
temp = list.getType("Swamp");
|
||||
if (temp.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
} else if (keyword.equals("CARDNAME can't attack unless defending player controls a Mountain.")) {
|
||||
temp = list.getType("Mountain");
|
||||
if (temp.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
} 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) {
|
||||
return c.isLand() && c.isSnow();
|
||||
}
|
||||
});
|
||||
if (temp.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
} 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 (temp.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (c.hasKeyword("CARDNAME can't attack unless defending player controls a blue permanent.")) {
|
||||
temp = list.getColor(Constant.Color.BLUE);
|
||||
if (temp.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user