X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGameTick.cpp;h=3115b4396611e592018e1fa3d51f763e8b09a1e6;hb=cd46cab54acd39ff8c02b204844f1ce53fd2edbc;hp=909c5033bfe0a31a7997f2ff55ef6e0cc4547b3c;hpb=0941fb2cb76a06a316d8a488c1504f84b66e4b4f;p=lugaru.git diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 909c503..3115b43 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -168,16 +168,6 @@ extern int currenthotspot; extern int kBitsPerPixel; extern int hostile; -extern int numaccounts; -extern int accountactive; -extern int accountdifficulty[10]; -extern int accountprogress[10]; -extern float accountpoints[10]; -extern float accounthighscore[10][50]; -extern float accountfasttime[10][50]; -extern bool accountunlocked[10][60]; -extern char accountname[10][256]; - extern bool stillloading; extern bool winfreeze; @@ -224,14 +214,6 @@ extern bool campaign; extern float oldgamespeed; -extern float accountcampaignhighscore[10]; -extern float accountcampaignfasttime[10]; -extern float accountcampaignscore[10]; -extern float accountcampaigntime[10]; - -extern int accountcampaignchoicesmade[10]; -extern int accountcampaignchoices[10][5000]; - static const char *rabbitskin[] = { ":Data:Textures:Fur3.jpg", ":Data:Textures:Fur.jpg", @@ -333,142 +315,131 @@ static void ch_save(Game *game, const char *args) fpackf(tfile, "Bi Bi", player[0].whichskin, player[0].creature); fpackf(tfile, "Bi", numdialogues); - if(numdialogues) - for(k=0;k1&&numplayers0&&player[j].num_weapons<5) - for(k=0;knumpathpoints); - if(game->numpathpoints) - for(j=0;jnumpathpoints;j++){ - fpackf(tfile, "Bf Bf Bf Bi", game->pathpoint[j].x, game->pathpoint[j].y, game->pathpoint[j].z, game->numpathpointconnect[j]); - for(k=0;knumpathpointconnect[j];k++){ - fpackf(tfile, "Bi", game->pathpointconnect[j][k]); - } - } + for(j=0;jnumpathpoints;j++){ + fpackf(tfile, "Bf Bf Bf Bi", game->pathpoint[j].x, game->pathpoint[j].y, game->pathpoint[j].z, game->numpathpointconnect[j]); + for(k=0;knumpathpointconnect[j];k++){ + fpackf(tfile, "Bi", game->pathpointconnect[j][k]); + } + } fpackf(tfile, "Bf Bf Bf Bf", game->mapcenter.x, game->mapcenter.y, game->mapcenter.z, game->mapradius); @@ -555,9 +526,7 @@ static void set_proportion(int pnum, const char *args) player[pnum].proportionbody=1.1*bodyprop; player[pnum].proportionarms=1.1*armprop; player[pnum].proportionlegs=1.1*legprop; - } - - if(player[pnum].creature==rabbittype){ + } else if(player[pnum].creature==rabbittype){ player[pnum].proportionhead=1.2*headprop; player[pnum].proportionbody=1.05*bodyprop; player[pnum].proportionarms=1.00*armprop; @@ -1012,9 +981,7 @@ static void ch_default(Game *game, const char *args) player[0].proportionbody=1.1; player[0].proportionarms=1.1; player[0].proportionlegs=1.1; - } - - if(player[0].creature==rabbittype){ + } else if(player[0].creature==rabbittype){ player[0].proportionhead=1.2; player[0].proportionbody=1.05; player[0].proportionarms=1.00; @@ -1699,7 +1666,7 @@ void Game::Loadlevel(char *name){ damagedealt=0; damagetaken=0; - if(accountactive!=-1)difficulty=accountdifficulty[accountactive]; + if(accountactive)difficulty=accountactive->getDifficulty(); if(difficulty!=2)minimap=1; else minimap=0; @@ -2551,23 +2518,23 @@ void Game::Tick() } mainmenutogglekeydown=1; } - if(!IsKeyDown(theKeyMap, MAC_ESCAPE_KEY)){ + if(!Input::isKeyDown(SDLK_ESCAPE)){ mainmenutogglekeydown=0; } } /*static bool minimaptogglekeydown; - if(IsKeyDown(theKeyMap, MAC_TAB_KEY)&&!minimaptogglekeydown){ + if(Input::isKeyDown(SDLK_TAB)&&!minimaptogglekeydown){ minimap=1-minimap; minimaptogglekeydown=1; } - if(!IsKeyDown(theKeyMap, MAC_TAB_KEY)){ + if(!Input::isKeyDown(SDLK_TAB)){ minimaptogglekeydown=0; } */ static bool minimaptogglekeydown; - if(IsKeyDown(theKeyMap, MAC_TAB_KEY)&&!minimaptogglekeydown&&tutoriallevel){ + if(Input::isKeyDown(SDLK_TAB)&&!minimaptogglekeydown&&tutoriallevel){ if(tutorialstage!=51) tutorialstagetime=tutorialmaxtime; PlaySoundEx( consolefailsound, samp[consolefailsound], NULL, true); @@ -2575,46 +2542,26 @@ void Game::Tick() OPENAL_SetPaused(channels[consolefailsound], false); minimaptogglekeydown=1; } - if(!IsKeyDown(theKeyMap, MAC_TAB_KEY)){ + if(!Input::isKeyDown(SDLK_TAB)){ minimaptogglekeydown=0; } if(mainmenu){ //menu buttons if(mainmenu==1||mainmenu==2){ - if(Button()&&!oldbutton&&selected==1){ + if(Input::Button()&&!oldbutton&&selected==1){ if(!gameon){ - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); - OPENAL_SetVolume(channels[firestartsound], 256); - OPENAL_SetPaused(channels[firestartsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); - - flashr=1; - flashg=0; - flashb=0; - flashamount=1; - flashdelay=1; + fireSound(firestartsound); + + flash(); //new game - if(accountactive!=-1)mainmenu=5; - else mainmenu=7; - /* - startbonustotal=0; - - loading=2; - loadtime=0; - if(firstload)TickOnceAfter(); - if(!firstload)LoadStuff(); - else { - Loadlevel(0); + if(accountactive) { + mainmenu=5; + } else { + mainmenu=7; } - mainmenu=0; - gameon=1; - OPENAL_SetPaused(channels[music3], true); */ + selected=-1; } else { @@ -2625,21 +2572,10 @@ void Game::Tick() } } - if(Button()&&!oldbutton&&selected==2){ - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); - OPENAL_SetVolume(channels[firestartsound], 256); - OPENAL_SetPaused(channels[firestartsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + if(Input::Button()&&!oldbutton&&selected==2){ + fireSound(); - flashr=1; - flashg=0; - flashb=0; - flashamount=1; - flashdelay=1; + flash(); //options @@ -2653,21 +2589,10 @@ void Game::Tick() if(newscreenheight<0)newscreenheight=screenheight; } - if(Button()&&!oldbutton&&selected==3){ - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - OPENAL_3D_SetAttributes(channels[fireendsound], gLoc, vel); - OPENAL_SetVolume(channels[fireendsound], 256); - OPENAL_SetPaused(channels[fireendsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); + if(Input::Button()&&!oldbutton&&selected==3){ + fireSound(); - flashr=1; - flashg=0; - flashb=0; - flashamount=1; - flashdelay=1; + flash(); if(!gameon){ //quit @@ -2680,22 +2605,12 @@ void Game::Tick() mainmenu=1; } } - if(Button())oldbutton=1; - else oldbutton=0; } - if(mainmenu==3){ - if(Button()&&!oldbutton&&selected!=-1){ - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); - OPENAL_SetVolume(channels[firestartsound], 256); - OPENAL_SetPaused(channels[firestartsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); + if(Input::Button()&&!oldbutton&&selected!=-1){ + fireSound(); } - if(Button()&&!oldbutton&&selected==0){ + if(Input::Button()&&!oldbutton&&selected==0){ extern SDL_Rect **resolutions; bool isCustomResolution = true; @@ -2939,9 +2854,7 @@ void Game::Tick() if(mainmenu==5){ if(endgame==2){ - accountcampaignchoicesmade[accountactive]=0; - accountcampaignscore[accountactive]=0; - accountcampaigntime[accountactive]=0; + accountactive->endGame(); endgame=0; } @@ -2997,9 +2910,8 @@ void Game::Tick() loading=2; loadtime=0; targetlevel=7; - if(firstload)TickOnceAfter(); - if(!firstload)LoadStuff(); - //else { + if(firstload) TickOnceAfter(); + else LoadStuff(); for(i=0;i<255;i++){ mapname[i]='\0'; } @@ -3014,8 +2926,8 @@ void Game::Tick() mapname[8]='p'; mapname[9]='s'; mapname[10]=':'; - strcat(mapname,campaignmapname[campaignchoicewhich[selected-7-accountcampaignchoicesmade[accountactive]]]); - whichchoice=selected-7-accountcampaignchoicesmade[accountactive]; + strcat(mapname,campaignmapname[campaignchoicewhich[selected-7-accountactive->getCampaignChoicesMade()]]); + whichchoice=selected-7-accountactive->getCampaignChoicesMade(); visibleloading=1; stillloading=1; Loadlevel(mapname); @@ -3177,11 +3089,11 @@ void Game::Tick() loading=2; loadtime=0; targetlevel=selected; - if(firstload)TickOnceAfter(); - if(!firstload)LoadStuff(); - else { + if(firstload) { + TickOnceAfter(); Loadlevel(selected); - } + } else + LoadStuff(); campaign=0; mainmenu=0; @@ -3234,156 +3146,59 @@ void Game::Tick() } if(mainmenu==6){ - if(Button()&&!oldbutton&&selected!=-1){ - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); - OPENAL_SetVolume(channels[firestartsound], 256); - OPENAL_SetPaused(channels[firestartsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); - } - if(Button()&&!oldbutton&&selected==1){ - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - OPENAL_3D_SetAttributes(channels[fireendsound], gLoc, vel); - OPENAL_SetVolume(channels[fireendsound], 256); - OPENAL_SetPaused(channels[fireendsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); - - flashr=1; - flashg=0; - flashb=0; - flashamount=1; - flashdelay=1; - - for(i=accountactive;i-1){ + fireSound(); + if(selected==1) { + flash(); + accountactive = Account::destroy(accountactive); + mainmenu=7; + } else if(selected==2) { + flash(); + mainmenu=5; } - accountcampaignhighscore[i]=accountcampaignhighscore[i+1]; - accountprogress[i]=accountprogress[i+1]; - accountcampaignfasttime[i]=accountcampaignfasttime[i+1]; - accountcampaignscore[i]=accountcampaignscore[i+1]; - accountcampaigntime[i]=accountcampaigntime[i+1]; } - - numaccounts--; - accountactive=-1; - - - mainmenu=7; - } - if(Button()&&!oldbutton&&selected==2){ - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); - PlaySoundEx( fireendsound, samp[fireendsound], NULL, true); - OPENAL_3D_SetAttributes(channels[fireendsound], gLoc, vel); - OPENAL_SetVolume(channels[fireendsound], 256); - OPENAL_SetPaused(channels[fireendsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 8.0f, 2000.0f); - - flashr=1; - flashg=0; - flashb=0; - flashamount=1; - flashdelay=1; - - mainmenu=5; } if(Button())oldbutton=1; else oldbutton=0; } if(mainmenu==7){ - if(Button()&&!oldbutton&&selected!=-1){ - float gLoc[3]={0,0,0}; - float vel[3]={0,0,0}; - OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f); - PlaySoundEx( firestartsound, samp[firestartsound], NULL, true); - OPENAL_3D_SetAttributes(channels[firestartsound], gLoc, vel); - OPENAL_SetVolume(channels[firestartsound], 256); - OPENAL_SetPaused(channels[firestartsound], false); - OPENAL_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f); - } - if(Button()&&!oldbutton&&selected==0&&numaccounts<8){ - entername=1; - } - if(Button()&&!oldbutton&&selected>0&&selected-1){ + fireSound(); - if(selected==0)accountdifficulty[accountactive]=0; - if(selected==1)accountdifficulty[accountactive]=1; - if(selected==2)accountdifficulty[accountactive]=2; + if(selected<=2) + accountactive->setDifficulty(selected); mainmenu=5; - flashr=1; - flashg=0; - flashb=0; - flashamount=1; - flashdelay=1; + flash(); } if(Button())oldbutton=1; @@ -3973,44 +3788,31 @@ void Game::Tick() } if(tutorialstage==1){ tutorialmaxtime=5; - } - if(tutorialstage==2){ + } else if(tutorialstage==2){ tutorialmaxtime=2; - } - if(tutorialstage==3){ + } else if(tutorialstage==3){ tutorialmaxtime=600; - } - if(tutorialstage==4){ + } else if(tutorialstage==4){ tutorialmaxtime=1000; - } - if(tutorialstage==5){ + } else if(tutorialstage==5){ tutorialmaxtime=600; - } - if(tutorialstage==6){ + } else if(tutorialstage==6){ tutorialmaxtime=600; - } - if(tutorialstage==7){ + } else if(tutorialstage==7){ tutorialmaxtime=600; - } - if(tutorialstage==8){ + } else if(tutorialstage==8){ tutorialmaxtime=600; - } - if(tutorialstage==9){ + } else if(tutorialstage==9){ tutorialmaxtime=600; - } - if(tutorialstage==10){ + } else if(tutorialstage==10){ tutorialmaxtime=2; - } - if(tutorialstage==11){ + } else if(tutorialstage==11){ tutorialmaxtime=1000; - } - if(tutorialstage==12){ + } else if(tutorialstage==12){ tutorialmaxtime=1000; - } - if(tutorialstage==13){ + } else if(tutorialstage==13){ tutorialmaxtime=2; - } - if(tutorialstage==14){ + } else if(tutorialstage==14){ tutorialmaxtime=3; XYZ temp,temp2; @@ -4047,107 +3849,82 @@ void Game::Tick() } } - } - if(tutorialstage==15){ + } else if(tutorialstage==15){ tutorialmaxtime=500; - } - if(tutorialstage==16){ + } else if(tutorialstage==16){ tutorialmaxtime=500; - } - if(tutorialstage==17){ + } else if(tutorialstage==17){ tutorialmaxtime=500; - } - if(tutorialstage==18){ + } else if(tutorialstage==18){ tutorialmaxtime=500; - } - if(tutorialstage==19){ + } else if(tutorialstage==19){ tutorialstage=20; //tutorialmaxtime=500; - } - if(tutorialstage==20){ + } else if(tutorialstage==20){ tutorialmaxtime=500; - } - if(tutorialstage==21){ + } else if(tutorialstage==21){ tutorialmaxtime=500; if(bonus==cannon){ bonus=Slicebonus; againbonus=1; } else againbonus=0; - } - if(tutorialstage==22){ + } else if(tutorialstage==22){ tutorialmaxtime=500; - } - if(tutorialstage==23){ + } else if(tutorialstage==23){ tutorialmaxtime=500; - } - if(tutorialstage==24){ + } else if(tutorialstage==24){ tutorialmaxtime=500; - } - if(tutorialstage==25){ + } else if(tutorialstage==25){ tutorialmaxtime=500; - } - if(tutorialstage==26){ + } else if(tutorialstage==26){ tutorialmaxtime=2; - } - if(tutorialstage==27){ + } else if(tutorialstage==27){ tutorialmaxtime=4; reversaltrain=1; cananger=1; player[1].aitype=attacktypecutoff; - } - if(tutorialstage==28){ + } else if(tutorialstage==28){ tutorialmaxtime=400; - } - if(tutorialstage==29){ + } else if(tutorialstage==29){ tutorialmaxtime=400; player[0].escapednum=0; - } - if(tutorialstage==30){ + } else if(tutorialstage==30){ tutorialmaxtime=4; reversaltrain=0; cananger=0; player[1].aitype=passivetype; - } - if(tutorialstage==31){ + } else if(tutorialstage==31){ tutorialmaxtime=13; - } - if(tutorialstage==32){ + } else if(tutorialstage==32){ tutorialmaxtime=8; - } - if(tutorialstage==33){ + } else if(tutorialstage==33){ tutorialmaxtime=400; cananger=1; canattack=1; player[1].aitype=attacktypecutoff; - } - if(tutorialstage==34){ + } else if(tutorialstage==34){ tutorialmaxtime=400; - } - if(tutorialstage==35){ + } else if(tutorialstage==35){ tutorialmaxtime=400; - } - if(tutorialstage==36){ + } else if(tutorialstage==36){ tutorialmaxtime=2; reversaltrain=0; cananger=0; player[1].aitype=passivetype; - } - if(tutorialstage==37){ + } else if(tutorialstage==37){ damagedealt=0; damagetaken=0; tutorialmaxtime=50; cananger=1; canattack=1; player[1].aitype=attacktypecutoff; - } - if(tutorialstage==38){ + } else if(tutorialstage==38){ tutorialmaxtime=4; canattack=0; cananger=0; player[1].aitype=passivetype; - } - if(tutorialstage==39){ + } else if(tutorialstage==39){ XYZ temp,temp2; temp.x=1011; @@ -4176,20 +3953,15 @@ void Game::Tick() weapons.physics[weapons.numweapons]=1; weapons.numweapons++; - } - if(tutorialstage==40){ + } else if(tutorialstage==40){ tutorialmaxtime=300; - } - if(tutorialstage==41){ + } else if(tutorialstage==41){ tutorialmaxtime=300; - } - if(tutorialstage==42){ + } else if(tutorialstage==42){ tutorialmaxtime=8; - } - if(tutorialstage==43){ + } else if(tutorialstage==43){ tutorialmaxtime=300; - } - if(tutorialstage==44){ + } else if(tutorialstage==44){ weapons.owner[0]=1; player[0].weaponactive=-1; player[0].num_weapons=0; @@ -4202,8 +3974,7 @@ void Game::Tick() player[1].aitype=attacktypecutoff; tutorialmaxtime=300; - } - if(tutorialstage==45){ + } else if(tutorialstage==45){ weapons.owner[0]=1; player[0].weaponactive=-1; player[0].num_weapons=0; @@ -4212,8 +3983,7 @@ void Game::Tick() player[1].weaponids[0]=0; tutorialmaxtime=300; - } - if(tutorialstage==46){ + } else if(tutorialstage==46){ weapons.owner[0]=1; player[0].weaponactive=-1; player[0].num_weapons=0; @@ -4224,9 +3994,7 @@ void Game::Tick() weapons.type[0]=sword; tutorialmaxtime=300; - } - - if(tutorialstage==47){ + } else if(tutorialstage==47){ tutorialmaxtime=10; XYZ temp,temp2; @@ -4265,8 +4033,7 @@ void Game::Tick() player[1].weaponids[0]=0; weapons.numweapons++; - } - if(tutorialstage==48){ + } else if(tutorialstage==48){ canattack=0; cananger=0; player[1].aitype=passivetype; @@ -4286,8 +4053,7 @@ void Game::Tick() else weapons.type[0]=staff; weapons.numweapons++; - } - if(tutorialstage==49){ + } else if(tutorialstage==49){ canattack=0; cananger=0; player[1].aitype=passivetype; @@ -4308,8 +4074,7 @@ void Game::Tick() weapons.type[0]=knife; weapons.numweapons++; - } - if(tutorialstage==50){ + } else if(tutorialstage==50){ tutorialmaxtime=8; XYZ temp,temp2; @@ -4350,8 +4115,7 @@ void Game::Tick() weapons.freetime[0]=0; weapons.firstfree[0]=1; weapons.physics[0]=1; - } - if(tutorialstage==51){ + } else if(tutorialstage==51){ tutorialmaxtime=80000; } if(tutorialstage<=51)tutorialstagetime=0; @@ -5983,7 +5747,8 @@ void Game::Tick() } if(IsKeyDown(theKeyMap, MAC_COMMA_KEY)&&!IsKeyDown(theKeyMap, MAC_SHIFT_KEY)&&!drawmodetogglekeydown&&editorenabled){ pathpointselected--; - if(pathpointselected<=-2)pathpointselected=numpathpoints-1; + if(pathpointselected<=-2) + pathpointselected=numpathpoints-1; drawmodetogglekeydown=1; } if(IsKeyDown(theKeyMap, MAC_COMMA_KEY)&&IsKeyDown(theKeyMap, MAC_SHIFT_KEY)&&!drawmodetogglekeydown&&editorenabled){ @@ -6014,19 +5779,14 @@ void Game::Tick() editorenabled=1-editorenabled; if(editorenabled){ player[0].damagetolerance=100000; - player[0].damage=0; - player[0].superpermanentdamage=0; - player[0].bloodloss=0; - player[0].deathbleeding=0; - } - if(!editorenabled){ + } else { player[0].damagetolerance=200; - player[0].damage=0; - player[0].permanentdamage=0; - player[0].superpermanentdamage=0; - player[0].bloodloss=0; - player[0].deathbleeding=0; } + player[0].damage=0; // these lines were in both if and else, but I think they would better fit in the if + player[0].permanentdamage=0; + player[0].superpermanentdamage=0; + player[0].bloodloss=0; + player[0].deathbleeding=0; drawmodetogglekeydown=1; } @@ -8833,24 +8593,19 @@ void Game::TickOnceAfter(){ //high scores, awards, win if(campaign){ won=1; - accountcampaignchoices[accountactive][accountcampaignchoicesmade[accountactive]]=whichchoice; - accountcampaignchoicesmade[accountactive]++; + accountactive->winCampaignLevel(whichchoice, bonustotal, leveltime); + /*accountcampaignchoices[accountactive][accountactive->getCampaignChoicesMade()]=whichchoice; + accountactive->getCampaignChoicesMade()++; accountcampaignscore[accountactive]+=bonustotal; - scoreadded=1; accountcampaigntime[accountactive]+=leveltime; - if(accountcampaignscore[accountactive]>accountcampaignhighscore[accountactive])accountcampaignhighscore[accountactive]=accountcampaignscore[accountactive]; - - //if(accountprogress[accountactive]accountcampaignhighscore[accountactive]) + accountcampaignhighscore[accountactive]=accountcampaignscore[accountactive];*/ + scoreadded=1; } else { won=1; - if(!debugmode){ - if(bonustotal-startbonustotal>accounthighscore[accountactive][whichlevel])accounthighscore[accountactive][whichlevel]=bonustotal-startbonustotal; - if(accountfasttime[accountactive][whichlevel]==0||leveltimewinLevel(whichlevel,bonustotal-startbonustotal,leveltime); } } } @@ -8931,7 +8686,7 @@ void Game::TickOnceAfter(){ mapname[8]='p'; mapname[9]='s'; mapname[10]=':'; - strcat(mapname,campaignmapname[levelorder[accountcampaignchoicesmade[accountactive]]]);//[campaignchoicewhich[whichchoice]]); + strcat(mapname,campaignmapname[levelorder[accountactive->getCampaignChoicesMade()]]);//[campaignchoicewhich[whichchoice]]); Loadlevel(mapname); OPENAL_Sample_SetMinMaxDistance(samp[fireendsound], 9999.0f, 99999.0f); @@ -9028,13 +8783,13 @@ void Game::TickOnceAfter(){ levelorder[0]=0; levelvisible[0]=1; - if(accountcampaignchoicesmade[accountactive]) - for(i=0;igetCampaignChoicesMade()) + for(i=0;igetCampaignChoicesMade();i++){ + levelorder[i+1]=campaignnextlevel[levelorder[i]][accountactive->getCampaignChoice(i)]; levelvisible[levelorder[i+1]]=1; } int whichlevelstart; - whichlevelstart=accountcampaignchoicesmade[accountactive]-1; + whichlevelstart=accountactive->getCampaignChoicesMade()-1; if(whichlevelstart<0){ campaignchoicenum=1; campaignchoicewhich[0]=0;