A key to switch to End of Turn

If you have a question about the git repository and the code, or if you have code to propose then please post in this forum.
Do not post request here.
Yeshua
Posts: 314
Joined: Sun Nov 02, 2008 4:02 am

A key to switch to End of Turn

Post by Yeshua »

Why won't this code work?

Code: Select all

while(game->currentGamePhase < Constants::MTG_PHASE_EOT)
	game->userRequestNextGamePhase();
This works but I don't think its the best idea.

Code: Select all

while(game->currentGamePhase < Constants::MTG_PHASE_EOT)
	game->nextGamePhase();
EDIT:
Oh wait I got an idea! make a new function thatll request end of turn! Will that work?
wololo
Site Admin
Posts: 3728
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: A key to switch to End of Turn

Post by wololo »

Something's very tricky: Some abilities trigger on a "frame" basis.
So if you request the end of a turn, you have to make sure that you still go through each phase, and wait a few frames between each, in order to make sure that abilities that need to trigger... do trigger. I believe that's why putting game->userRequestNextGamePhase(); in a loop doesn't work as expected.

It is not an easy problem at all.
Yeshua
Posts: 314
Joined: Sun Nov 02, 2008 4:02 am

Re: A key to switch to End of Turn

Post by Yeshua »

How should I implement this, cause now I have no idea.
wololo
Site Admin
Posts: 3728
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: A key to switch to End of Turn

Post by wololo »

I have no idea either, I never took the time to really think about it. If you want to help with the code, you should browse the list of current bugs. Some of them are probably really easy to fix, but we have many of them and not enough hands to fix them:
http://code.google.com/p/wagic/issues/list
Yeshua
Posts: 314
Joined: Sun Nov 02, 2008 4:02 am

Re: A key to switch to End of Turn

Post by Yeshua »

If fix a few bugs will you consider putting me on the dev team?
wololo
Site Admin
Posts: 3728
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: A key to switch to End of Turn

Post by wololo »

yes, depending on the quality of your code.
Yeshua
Posts: 314
Joined: Sun Nov 02, 2008 4:02 am

Re: A key to switch to End of Turn

Post by Yeshua »

I know this is low priority but do we have a test suite file for this issue, or can the test suite help with this? http://code.google.com/p/wagic/issues/detail?id=63
Psyringe
Posts: 1163
Joined: Mon Aug 31, 2009 10:53 am

Re: A key to switch to End of Turn

Post by Psyringe »

Yeshua wrote:I know this is low priority but do we have a test suite file for this issue, or can the test suite help with this? http://code.google.com/p/wagic/issues/detail?id=63
The test suite wouldn't have anything to actually test (since the reported problem is about the display, and the test suite has no idea how the cards are are displayed). You could use the test suite to quickly load a game state where you have lots of cards in your hand though, this might be useful. Try this (untested):

Code: Select all

[INIT]
firstmain
[PLAYER1]
hand:Plains,Forest,Swamp,Mountain,Island,Plains,Forest,Swamp,Mountain,Island,Plains,Forest,Swamp,Mountain,Island
[PLAYER2]
[DO]
human
[END]
Yeshua
Posts: 314
Joined: Sun Nov 02, 2008 4:02 am

Re: A key to switch to End of Turn

Post by Yeshua »

and the purple screen any way to reproduce it yet?
Psyringe
Posts: 1163
Joined: Mon Aug 31, 2009 10:53 am

Re: A key to switch to End of Turn

Post by Psyringe »

Yeshua wrote:and the purple screen any way to reproduce it yet?
No, unfortunately not.

Did the above script do what you needed?
Locked