I dont know how far can we go through with these codes i am writing some here is a sequence of attempts that should be tested one by one:
1)
2)
3)
4)
Does anyone know if a unit production time of a unit in a city decreses in the beggining of a turn or in its end?
1)
Code:
HandleEvent(BeginTurn) 'PBEM_ActuallyBeginTurn' pre { int_t tmpPlayer; int_t tmpRound; int_t ActualRound; tmpPlayer = player[0]; tmpRound = GetCurrentRound(); ActualRound = tmpRound + 1; Event: BeginTurn(tmpPlayer, ActualRound); }
Code:
int_t CanBeginTurn; HandleEvent(BeginTurn) 'PBEM_ActuallyBeginTurn' pre { int_t tmpPlayer; int_t tmpRound; int_t ActualRound; if(CanBeginTurn == 0) { tmpPlayer = player[0]; tmpRound = GetCurrentRound(); ActualRound = tmpRound + 1; CanBeginTurn = 1; Event: BeginTurn(tmpPlayer, ActualRound); return STOP; } else{ CanBeginTurn = 0; } }
Code:
HandleEvent(EndTurn) 'PBEM_ActuallyEndTurn' pre { int_t tmpPlayer; tmpPlayer = player[0]; Event: EndTurn(tmpPlayer); }
Code:
int_t CanEndTurn; HandleEvent(EndTurn) 'PBEM_ActuallyBeginTurn' pre { int_t tmpPlayer; if(CanEndTurn == 0) { tmpPlayer = player[0]; CanEndTurn = 1; Event: EndTurn(tmpPlayer); } else{ CanEndTurn = 0; } }
Comment