Proposal for a Winter Orb like keyword
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
7 posts
• Page 1 of 1
Proposal for a Winter Orb like keyword
by Chris H. » 07 May 2011, 12:45
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
- Name:Hokori, Dust Drinker
ManaCost:2 W W
Types:Legendary Creature Spirit
Text:Players may only untap one land during their untap steps.
PT:2/2
K:Both players can only untap one land.
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/hokori_dust_drinker.jpg
SetInfo:BOK|Rare|http://magiccards.info/scans/en/bok/7.jpg
End
Name:Mungha Wurm
ManaCost:2 G G
Types:Creature Wurm
Text:You can't untap more than one land during your untap step.
PT:6/5
K:You can only untap one land.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/mungha_wurm.jpg
SetInfo:PCY|Rare|http://magiccards.info/scans/en/pr/119.jpg
End
Name:Winter Orb
ManaCost:2
Types:Artifact
Text:As long as Winter Orb is untapped, players can't untap more than one land during their untap steps.
K:Both players can only untap one land.
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/winter_orb.jpg
SetInfo:LEA|Rare|http://magiccards.info/scans/en/al/275.jpg
SetInfo:LEB|Rare|http://magiccards.info/scans/en/be/277.jpg
SetInfo:5ED|Rare|http://magiccards.info/scans/en/5e/408.jpg
SetInfo:4ED|Rare|http://magiccards.info/scans/en/4e/376.jpg
SetInfo:3ED|Rare|http://magiccards.info/scans/en/rv/280.jpg
SetInfo:2ED|Rare|http://magiccards.info/scans/en/un/276.jpg
End
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.
-

Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Proposal for a Winter Orb like keyword
by slapshot5 » 07 May 2011, 13:11
I think the untapped requirement is just a relic of how things used to be. See Howling Mine vs. Font of Mythos for the same thing. I think static is correct.
I don't see any problem with it being animated. The only thing that matters is tapped vs. untapped.
I'm no rules guru, but that's how I'd look at it.
-slapshot5
I don't see any problem with it being animated. The only thing that matters is tapped vs. untapped.
I'm no rules guru, but that's how I'd look at it.
-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Proposal for a Winter Orb like keyword
by Chris H. » 07 May 2011, 16:41
`slapshot5 wrote:I think the untapped requirement is just a relic of how things used to be. See Howling Mine vs. Font of Mythos for the same thing. I think static is correct.
I don't see any problem with it being animated. The only thing that matters is tapped vs. untapped.
I'm no rules guru, but that's how I'd look at it.
That makes sense now that I think about it ... the "As long as CARDNAME is untapped" restriction is not applied to all artifacts that have a static ability. Some of them have this restriction and others do not.
I should be able to modify the keyword to handle this without too much trouble.
Thank you for the help.
-

Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Proposal for a Winter Orb like keyword
by Hellfish » 07 May 2011, 17:20
Hokori, Dust Drinker is a triggered, mandatory ability unlike Winter Orb.
Perhaps your work can be refined to support all the 7 "You/Players can't untap more than <number> <type> during your/their untap step" cards? List here:
Perhaps your work can be refined to support all the 7 "You/Players can't untap more than <number> <type> during your/their untap step" cards? List here:
- Code: Select all
http://gatherer.wizards.com/Pages/Search/Default.aspx?text=+[%22can't%20untap%22]
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
-

Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Proposal for a Winter Orb like keyword
by Sloth » 07 May 2011, 19:45
Forget about the untapped clause of Winter Orb: http://www.wizards.com/Magic/Magazine/A ... 41a&page=2
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Proposal for a Winter Orb like keyword
by Chris H. » 07 May 2011, 23:29
`Hellfish wrote:Hokori, Dust Drinker is a triggered, mandatory ability unlike Winter Orb.
Perhaps your work can be refined to support all the 7 "You/Players can't untap more than <number> <type> during your/their untap step" cards? List here:
- Code: Select all
http://gatherer.wizards.com/Pages/Search/Default.aspx?text=+[%22can't%20untap%22]
Thanks for the info. I admit that I was never very good at or knowledgable about the game.
I will try to do a more thorough implementation, not sure if it will work or not, but I will at least learn something in the process.
-

Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Proposal for a Winter Orb like keyword
by Chris H. » 07 May 2011, 23:30
`Sloth wrote:Forget about the untapped clause of Winter Orb: http://www.wizards.com/Magic/Magazine/A ... 41a&page=2
Wow, thank you Sloth for the heads up.
I will go ahead and make a minor edit to the card file and to the code to bring this card up to date.
-

Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 36 guests