Proposal for a Winter Orb like keyword
I suggested in a topic on the decks forum that we make a Winter Orb like keyword. I found the existing code and it tests for cards by their name and I believe that we are trying to move away from that habit when possible.
The existing code looks like this:
I commented out this code in my local copy and created this new version:
I also modified the card files for these cards:
I ran a test with the combo deck that I recently created and this code appears to work correctly.
My main concern at this time is making sure that my code edit is rules compliant and my knowledge is fairly weak in this area.
The Winter Orb ability (static?) is only in effect if this card is untapped. Yet the other two cards do not have this restriction. Is this caused by the fact that the other two cards are creatures and the Winter Orb is not?
How would the Winter Orb be handled if it was animated? Ugh.
The existing code looks like this:
- Code: Select all
private static boolean canOnlyUntapOneLand() {
CardList orbs = AllZoneUtil.getCardsInPlay("Winter Orb");
for(Card c : orbs){
//if any Winter Orb is untapped, effect is on
if (c.isUntapped())
return true;
}
if (AllZoneUtil.getCardsInPlay("Hokori, Dust Drinker").size() > 0)
return true;
if (AllZoneUtil.getPlayerCardsInPlay(AllZone.Phase.getPlayerTurn(), "Mungha Wurm").size() > 0)
return true;
return false;
}
I commented out this code in my local copy and created this new version:
- Code: Select all
private static boolean canOnlyUntapOneLand() {
CardList orbLikeCards = AllZoneUtil.getCardsInPlay();
orbLikeCards = orbLikeCards.getKeywordsContain(" can only untap one land.");
if (orbLikeCards.size() > 0) {
for (Card c : orbLikeCards) {
if (c.getKeyword().contains("Both players can only untap one land.")) {
if (!c.isArtifact() || (c.isArtifact() && c.isCreature())) {
return true;
}
else {
if (c.isUntapped())
return true;
}
}
else if (c.getKeyword().contains("You can only untap one land.")
&& AllZone.Phase.getPlayerTurn().equals(c.getController())) {
return true;
}
}
}
return false;
}
I also modified the card files for these cards:
- card file edits | Open
I ran a test with the combo deck that I recently created and this code appears to work correctly.
My main concern at this time is making sure that my code edit is rules compliant and my knowledge is fairly weak in this area.
The Winter Orb ability (static?) is only in effect if this card is untapped. Yet the other two cards do not have this restriction. Is this caused by the fact that the other two cards are creatures and the Winter Orb is not?
How would the Winter Orb be handled if it was animated? Ugh.