mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18: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
|
Name:Kulrath Knight
|
||||||
ManaCost:3 BR BR
|
ManaCost:3 BR BR
|
||||||
Types:Creature Elemental Knight
|
Types:Creature Elemental Knight
|
||||||
Text:Creatures your opponents control with counters on them can't attack or block.
|
Text:no text
|
||||||
PT:3/3
|
PT:3/3
|
||||||
K:Flying
|
K:Flying
|
||||||
K:Wither
|
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:Rarity:Uncommon
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/kulrath_knight.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/kulrath_knight.jpg
|
||||||
SetInfo:SHM|Uncommon|http://magiccards.info/scans/en/shm/190.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))) {
|
if (!((this.getAbilityText().trim().equals("") || this.isFaceDown()) && (this.getUnhiddenKeyword().size() == 0))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else if (property.equals("HasCounters")) {
|
||||||
|
if (!this.hasCounters()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else if (property.equals("SameNameAsImprinted")) {
|
} else if (property.equals("SameNameAsImprinted")) {
|
||||||
boolean b = false;
|
boolean b = false;
|
||||||
for (final Card card : source.getImprinted()) {
|
for (final Card card : source.getImprinted()) {
|
||||||
|
|||||||
@@ -137,7 +137,6 @@ public class CardList implements Iterable<Card> {
|
|||||||
list.add(c);
|
list.add(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
} // getColor()
|
} // getColor()
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import forge.AllZoneUtil;
|
|||||||
import forge.Card;
|
import forge.Card;
|
||||||
import forge.CardList;
|
import forge.CardList;
|
||||||
import forge.CardListFilter;
|
import forge.CardListFilter;
|
||||||
|
import forge.CardListUtil;
|
||||||
import forge.Command;
|
import forge.Command;
|
||||||
import forge.Constant;
|
import forge.Constant;
|
||||||
import forge.Counters;
|
import forge.Counters;
|
||||||
@@ -130,18 +131,6 @@ public class CombatUtil {
|
|||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -768,49 +757,46 @@ public class CombatUtil {
|
|||||||
|
|
||||||
final CardList list = c.getController().getOpponent().getCardsIn(ZoneType.Battlefield);
|
final CardList list = c.getController().getOpponent().getCardsIn(ZoneType.Battlefield);
|
||||||
CardList temp;
|
CardList temp;
|
||||||
|
for (String keyword : c.getKeyword()) {
|
||||||
if (c.hasKeyword("CARDNAME can't attack unless defending player controls an Island.")) {
|
if (keyword.equals("CARDNAME can't attack.") || keyword.equals("CARDNAME can't attack or block.")) {
|
||||||
temp = list.getType("Island");
|
|
||||||
if (temp.isEmpty()) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
} else if (keyword.equals("Defender") && !c.hasKeyword("CARDNAME can attack as though it didn't have defender.")) {
|
||||||
}
|
|
||||||
|
|
||||||
if (c.hasKeyword("CARDNAME can't attack unless defending player controls a Forest.")) {
|
|
||||||
temp = list.getType("Forest");
|
|
||||||
if (temp.isEmpty()) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
} else if (keyword.equals("CARDNAME can't attack unless defending player controls an Island.")) {
|
||||||
}
|
temp = list.getType("Island");
|
||||||
|
if (temp.isEmpty()) {
|
||||||
if (c.hasKeyword("CARDNAME can't attack unless defending player controls a Swamp.")) {
|
return false;
|
||||||
temp = list.getType("Swamp");
|
}
|
||||||
if (temp.isEmpty()) {
|
} else if (keyword.equals("CARDNAME can't attack unless defending player controls a Forest.")) {
|
||||||
return false;
|
temp = list.getType("Forest");
|
||||||
}
|
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 Swamp.")) {
|
||||||
if (temp.isEmpty()) {
|
temp = list.getType("Swamp");
|
||||||
return false;
|
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 Mountain.")) {
|
||||||
temp = list.filter(new CardListFilter() {
|
temp = list.getType("Mountain");
|
||||||
@Override
|
if (temp.isEmpty()) {
|
||||||
public boolean addCard(final Card c) {
|
return false;
|
||||||
return c.isLand() && c.isSnow();
|
}
|
||||||
|
} 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;
|
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;
|
return true;
|
||||||
} // canAttack()
|
} // canAttack()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user