Purely stylistic changes to make it easier to read this code for mistakes.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9131 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2010-01-11 16:19:39 +00:00 committed by Git SVN Gateway
parent 8e6b4e59b6
commit baa0ac2188
5 changed files with 26 additions and 45 deletions

View File

@ -66,8 +66,6 @@ event initialisedEvent(CALL_GAMEINIT)
{
enableStructure(command ,playnum); //make structures available to build
enableStructure(factory ,playnum);
// enableStructure(wall ,playnum);
// enableStructure(cornerWall ,playnum);
enableStructure(oilDerrick ,playnum);
enableStructure(powerGen ,playnum);
enableStructure(research ,playnum);
@ -87,15 +85,14 @@ event initialisedEvent(CALL_GAMEINIT)
event initialisedEventTwo(CALL_GAMEINIT)
{
playnum = 0;
while (playnum < 8)
{
count = 0;
count = 0;
while (count < numBaseRes)
{
enableResearch(baseRes[count], playnum);
count = count +1;
count = count + 1;
}
// enable cyborgs components that can't be enabled with research
@ -116,52 +113,46 @@ event initialisedEventTwo(CALL_GAMEINIT)
}
else if(multiPlayerBaseType == CAMP_BASE)
{
setPowerLevel(2500,playnum);
count = 0;
setPowerLevel(2500, playnum);
count = 0;
while (count < numBaseTech)
{
completeResearch(defTech[count], playnum);
count = count +1;
count = count + 1;
}
}
else
{
setPowerLevel(2500,playnum);
count = 0;
{
setPowerLevel(2500,playnum);
count = 0;
while (count < numDefTech)
{
completeResearch(defTech[count], playnum);
count = count +1;
count = count + 1;
}
}
playnum = playnum+ 1;
playnum = playnum + 1;
}
}
// /////////////////////////////////////////////////////////////////
// END CONDITIONS
event checkEndConditions (endConditions)
event checkEndConditions(endConditions)
{
// Losing Conditions
if( ( not anyDroidsLeft(selectedPlayer))
and ( not anyFactoriesLeft(selectedPlayer))
)
if ((not anyDroidsLeft(selectedPlayer)) and (not anyFactoriesLeft(selectedPlayer)))
{
gameLost = TRUE;
/* If teams enabled check if all team members have lost */
if(multiPlayerGameType == SKIRMISH and multiPlayerAlliancesType == ALLIANCES_TEAMS)
if (multiPlayerGameType == SKIRMISH and multiPlayerAlliancesType == ALLIANCES_TEAMS)
{
playnum = 0;
while (playnum < multiPlayerMaxPlayers)
{
if((playnum != selectedPlayer)
and allianceExistsBetween(selectedPlayer , playnum))
if ((playnum != selectedPlayer) and allianceExistsBetween(selectedPlayer, playnum))
{
if(anyDroidsLeft(playnum) or anyFactoriesLeft(playnum))
{

View File

@ -175,8 +175,7 @@ void buttonClearFlash(W_BUTTON *psButton)
/* Set a button's state */
void buttonSetState(W_BUTTON *psButton, UDWORD state)
{
ASSERT( !((state & WBUT_LOCK) && (state & WBUT_CLICKLOCK)),
"widgSetButtonState: Cannot have WBUT_LOCK and WBUT_CLICKLOCK" );
ASSERT(!((state & WBUT_LOCK) && (state & WBUT_CLICKLOCK)), "Cannot have both WBUT_LOCK and WBUT_CLICKLOCK");
if (state & WBUT_DISABLE)
{

View File

@ -1149,7 +1149,6 @@ void intResetScreen(BOOL NoAnim)
widgSetButtonState(psWScreen, IDRET_INTEL_MAP, 0);
widgSetButtonState(psWScreen, IDRET_RESEARCH, 0);
widgSetButtonState(psWScreen, IDRET_DESIGN, 0);
}
/* Remove whatever extra screen was displayed */
@ -3812,13 +3811,13 @@ BOOL intAddReticule(void)
void intRemoveReticule(void)
{
if(ReticuleUp == true) {
widgDelete(psWScreen,IDRET_FORM); // remove reticule
if (ReticuleUp == true)
{
widgDelete(psWScreen, IDRET_FORM); // remove reticule
ReticuleUp = false;
}
}
//toggles the Power Bar display on and off
void togglePowerBar(void)
{

View File

@ -2500,21 +2500,21 @@ static BOOL _intAddMissionResult(BOOL result, BOOL bPlaySuccess)
sButInit.FontID = font_regular;
sButInit.pTip = NULL;
sButInit.pDisplay = displayTextOption;
//if won or in debug mode
// If won or in debug mode
if(result || getDebugMappingStatus() || bMultiPlayer)
{
//continue
sButInit.x = MISSION_2_X;
// Won the game, so display "Quit to main menu"
// Won the game, so display "Quit to main menu"
if(testPlayerHasWon() && !bMultiPlayer)
{
{
sButInit.id = IDMISSIONRES_QUIT;
sButInit.y = MISSION_2_Y-8;
sButInit.pText = _("Quit To Main Menu");
widgAddButton(psWScreen, &sButInit);
}
else
{
else
{
// Finished the mission, so display "Continue Game"
sButInit.y = MISSION_2_Y;
sButInit.id = IDMISSIONRES_CONTINUE;
@ -2523,8 +2523,8 @@ static BOOL _intAddMissionResult(BOOL result, BOOL bPlaySuccess)
}
/* Only add save option if in the game for real, ie, not fastplay.
And the player hasn't just completed the whole game
Don't add save option if just lost and in debug mode*/
* And the player hasn't just completed the whole game
* Don't add save option if just lost and in debug mode. */
if (!bMultiPlayer && !testPlayerHasWon() && !(testPlayerHasLost() && getDebugMappingStatus()))
{
//save

View File

@ -393,14 +393,6 @@ void closeLoadingScreen(void)
BOOL displayGameOver(BOOL bDidit)
{
// AlexL says take this out......
// setConsolePermanence(true,true);
// flushConsoleMessages( );
// addConsoleMessage(" ", CENTRE_JUSTIFY, SYSTEM_MESSAGE);
// addConsoleMessage(_("Game Over"), CENTRE_JUSTIFY, SYSTEM_MESSAGE);
// addConsoleMessage(" ", CENTRE_JUSTIFY, SYSTEM_MESSAGE);
if(bDidit)
{
setPlayerHasWon(true);