Mana Pool
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Mana Pool
by mtgrares » 09 Jun 2009, 17:57
I'll try to help. Parts of my code refernce old and forgotten code, just look at Input_Draw which tries to get dredge working. (Dredge sort of works but Input_Draw has to be called all of the time when a card is drawn instead of GameAction.drawCard(). The code for dredge could probably be put into GameAction.drawCard() if someone is feeling ambitious.)
About Meloku, I guess I was trying to get it to work exactly right (as printed on the card) but I do sometimes leave in old code accidentally or leave in old code that is commented out in case I want it later. Feel free to ask me questions though. I'll try to answer them as well as I can remember. (Meloku was programmed a LONG time ago, )
About Meloku, I guess I was trying to get it to work exactly right (as printed on the card) but I do sometimes leave in old code accidentally or leave in old code that is commented out in case I want it later. Feel free to ask me questions though. I'll try to answer them as well as I can remember. (Meloku was programmed a LONG time ago, )
- mtgrares
- DEVELOPER
- Posts: 1352
- Joined: 08 Sep 2008, 22:10
- Has thanked: 3 times
- Been thanked: 12 times
Re: Mana Pool
by Rob Cashwalker » 09 Jun 2009, 22:00
I think you're missing the point a bit. The problem isn't Meloku, the problem is "Where the F should I put the mana subtraction loop?" OR "If it's in the right place, why does it bomb?"mtgrares wrote:I'll try to help. Parts of my code refernce old and forgotten code, just look at Input_Draw which tries to get dredge working. (Dredge sort of works but Input_Draw has to be called all of the time when a card is drawn instead of GameAction.drawCard(). The code for dredge could probably be put into GameAction.drawCard() if someone is feeling ambitious.)
About Meloku, I guess I was trying to get it to work exactly right (as printed on the card) but I do sometimes leave in old code accidentally or leave in old code that is commented out in case I want it later. Feel free to ask me questions though. I'll try to answer them as well as I can remember. (Meloku was programmed a LONG time ago, )
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Mana Pool
by Almost_Clever » 10 Jun 2009, 21:54
Well, it looks like with 2010 changes to the rules, the mana pool clears at the end of each step instead of each phase and mana burn no longer happens, the mana just goes away (I can hear Kramer from Seinfeld saying "they just write it off!").zerker2000 wrote:Also, since mana burn is at end of phase, the code for my "mana tokens" would have to be tweaked a little, since as is they die at end of turn.
A woman came up to me and said / "I'd like to poison your mind / With wrong ideas that appeal to you / Though I am not unkind."
-
Almost_Clever - Tester
- Posts: 345
- Joined: 15 Jan 2009, 01:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Mana Pool
by Rob Cashwalker » 11 Jun 2009, 00:13
Yeah, first I need to get the pool working in general... then I can worry about finding all the spots where it needs to be cleared. At least I don't have to do the burn part. But the other rules changes are going to wreak havoc... unless we ignore half of them....
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Mana Pool
by zerker2000 » 11 Jun 2009, 16:53
What no more mana burn??? Also, I don't understand what you mean by 2010 changes, it's still 2009
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
- zerker2000
- Programmer
- Posts: 569
- Joined: 09 May 2009, 21:40
- Location: South Pasadena, CA
- Has thanked: 0 time
- Been thanked: 0 time
Re: Mana Pool
by mtgrares » 11 Jun 2009, 18:44
My best guess is to add ManaPool (or whatever is is called) to AllZone and make is public final static and then update Input_PayManaCost and Input_PayManaCost_Ability to use the mana pool.Rob Cashwalker wrote:I think you're missing the point a bit. The problem isn't Meloku, the problem is "Where the F should I put the mana subtraction loop?" OR "If it's in the right place, why does it bomb?"
I'm not sure what is the best way to clear the mana pool after each phase and step. One way would be to put the mana clearing code in constructor of each of the "phase Inputs", like Input_Main, Input_CombatDamage, etc..
All mouse input is handled through the Input class and that will have to be modified to accept clicking on the mana pool.
I hope that answers your question, if not, I'll keep trying.
- mtgrares
- DEVELOPER
- Posts: 1352
- Joined: 08 Sep 2008, 22:10
- Has thanked: 3 times
- Been thanked: 12 times
Re: Mana Pool
by Rob Cashwalker » 12 Jun 2009, 03:34
I'm starting to think about the "mana token" idea.... It's making more sense as I attempt to figure out how to get the mana out of the pool on demand. It's a simple enough change to make to the Input_PayManaCostUtil functions to interpret a token land with a series of keywords added and removed as mana is added and removed from it. Then between steps it's also easy enough to clear the keywords from it.... The trick might be some way to start the game with the token in play, because actually creating and destroying the token might cause undesired triggered effects. It would also make it easy to access, always being the first "land" to the left of the panel.
Then no extra class objects need to be created.
Then no extra class objects need to be created.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Mana Pool
by zerker2000 » 12 Jun 2009, 06:43
Erm slightly bad idea, I remember I got some sort of interface problems when I had a bunch of mana abilities on one card.Rob Cashwalker wrote:I'm starting to think about the "mana token" idea.... It's making more sense as I attempt to figure out how to get the mana out of the pool on demand. It's a simple enough change to make to the Input_PayManaCostUtil functions to interpret a token land with a series of keywords added and removed as mana is added and removed from it.
I would think it wouldn't be hard to create a special "ManaToken.Destroy" (and of course something like "Gui.newManaToken" ... I have no idea how/ where this could be put in) method that bypasses all checks, after all it's not like the token should actually be anywhere but in play(pardon "on battlefield" >:\). Also, I would think that the mana pool would (optimally) be a separate(third under lands) UI area where you have "card pictures" of mana tokens on which you click to sacrifice them(while paying costs).actually creating and destroying the token might cause undesired triggered effects. It would also make it easy to access, always being the first "land" to the left of the panel.
Erm unless there are seperate classes for Creatures, Enchantments, Lands, etc. (which I don't think is the case), my suggestion shouldn't require any either.Then no extra class objects need to be created.
Hmm, I don't think mana tokens should have any type besides "Mana", otherwise there might be problems (e.g. Armageddon)Rob Cashwalker wrote:Actually, it's not so difficult to create a card to start in play!<image of Land token>
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
- zerker2000
- Programmer
- Posts: 569
- Joined: 09 May 2009, 21:40
- Location: South Pasadena, CA
- Has thanked: 0 time
- Been thanked: 0 time
Re: Mana Pool
by Rob Cashwalker » 12 Jun 2009, 16:30
Can you be more specific? Birds of paradise has 5 abilities.... The only thing that should need modifying is the Extrinsic keyword code to allow multiple mana pool keywords like this:zerker2000 wrote:Erm slightly bad idea, I remember I got some sort of interface problems when I had a bunch of mana abilities on one card.
- Code: Select all
manapool:R
manapool:R
manapool:R
I realize this is an issue. My next step is to dig around to figure out how MTGForge knows where to put any given card object. Once I know that, then I can put it in its own panel off the battlefield. My goal in the screenshot was to figure out how to create a card on the fly (without it being part of an ability) and if the PlayerZone.add(card) method figured out how to treat it without any other intervention. Somewhere in the code it sees the type "Land" and puts it in the land row.after all it's not like the token should actually be anywhere but in play(pardon "on battlefield" Also, I would think that the mana pool would (optimally) be a separate(third under lands) UI area where you have "card pictures" of mana tokens on which you click to sacrifice them(while paying costs).
...
Hmm, I don't think mana tokens should have any type besides "Mana", otherwise there might be problems (e.g. Armageddon)
Edit - Come to think of it, I could just give it "Indestructible, Pro-W, Pro-U, Pro-B, Pro-R, Pro-G, Pro-A"....
Right. I'm simply pointing out that by reusing the card object in a hacky sort of way, I don't have to figure out how to derive input from some new object, or modify both forms of PayManaCost (as rares was suggesting) - they're all handled by Input_PayManaCostUtil, where it looks for cards that contain keywords that begin with "tap: add _".... I can simply modify this bit of code to also look for "manapool:_" (mana character is in the same position, so even less changes) and let it do the rest basically as is... and then check if the card selected is the mana pool card, and not tap it.Erm unless there are seperate classes for Creatures, Enchantments, Lands, etc. (which I don't think is the case), my suggestion shouldn't require any either.
The only other part is back to making spells and abilities that add extrinsic keywords to the mana pool card.... For the most part, a generic keyword handler can be written to deal with all cards that have "tap: add_". Then, the card can be activated during play, then when specifically paying costs, it's still selectable.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Mana Pool
by mtgrares » 12 Jun 2009, 17:19
The problem is that if you put the mana pool into a special card how can you click on a specific mana color? Maybe you could create 6 special cards (WUBRG and colorless) that show you how much mana you have in each category. Just a guess.
- mtgrares
- DEVELOPER
- Posts: 1352
- Joined: 08 Sep 2008, 22:10
- Has thanked: 3 times
- Been thanked: 12 times
Re: Mana Pool
by Rob Cashwalker » 12 Jun 2009, 17:55
When you're selecting mana as it is now, how do you select a given color from Birds of Paradise? Same thing.mtgrares wrote:The problem is that if you put the mana pool into a special card how can you click on a specific mana color? Maybe you could create 6 special cards (WUBRG and colorless) that show you how much mana you have in each category. Just a guess.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Mana Pool
by mtgrares » 12 Jun 2009, 18:05
Hm...well the problem is when you are trying to add mana to the mana pool and you aren't paying a card's cost. (When you are paying a card's cost you don't have to choose the color of the mana since.) When you click on Birds of Paradise I guess the code could ask you which mana color to add to the mana pool.
Adding the mana pool seems simple but there might be landmines ahead.
Adding the mana pool seems simple but there might be landmines ahead.
- mtgrares
- DEVELOPER
- Posts: 1352
- Joined: 08 Sep 2008, 22:10
- Has thanked: 3 times
- Been thanked: 12 times
Re: Mana Pool
by Rob Cashwalker » 12 Jun 2009, 18:19
I don't doubt there are land mines. And Birds of paradise might be a big exception to a generic keyword handler....mtgrares wrote:Hm...well the problem is when you are trying to add mana to the mana pool and you aren't paying a card's cost. (When you are paying a card's cost you don't have to choose the color of the mana since.) When you click on Birds of Paradise I guess the code could ask you which mana color to add to the mana pool.
Adding the mana pool seems simple but there might be landmines ahead.
The mana pool is more useful to handle quantities of mana generated by single effects. If you just want to tap a card to get a single mana, you might as well wait until actually paying the costs. But if you want to play Seething Song, you need the pool. The only other exception would be a land that makes 2 mana at a time, like the filter lands from Shadowmoor, or the bounce lands from Ravnica. But those are corner cases.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Mana Pool
by zerker2000 » 13 Jun 2009, 05:28
Why not just indestructible/shroud, I don't think there are any cards that remove all lands from the game.Rob Cashwalker wrote:Edit - Come to think of it, I could just give it "Indestructible, Pro-W, Pro-U, Pro-B, Pro-R, Pro-G, Pro-A"....
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
- zerker2000
- Programmer
- Posts: 569
- Joined: 09 May 2009, 21:40
- Location: South Pasadena, CA
- Has thanked: 0 time
- Been thanked: 0 time
Who is online
Users browsing this forum: No registered users and 104 guests