diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index 71718220..b746ffad 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -3129,7 +3129,6 @@ void entityclass::updateentities( int i ) } else if (entities[i].state == 1) { - game.crewmates++; if (game.intimetrial) { customcollect[entities[i].para] = 1; diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index ea90da2a..8f235eaa 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -2006,17 +2006,17 @@ void Game::updatestate() graphics.addline("You have found a lost crewmate!"); graphics.textboxcenterx(); - if(int(map.customcrewmates-crewmates)==0) + if(int(map.customcrewmates-crewmates())==0) { graphics.createtextbox(" All crewmates rescued! ", 50, 65, 174, 174, 174); } - else if(map.customcrewmates-crewmates==1) + else if(map.customcrewmates-crewmates()==1) { - graphics.createtextbox(" " + help.number(int(map.customcrewmates-crewmates))+ " remains ", 50, 65, 174, 174, 174); + graphics.createtextbox(" " + help.number(int(map.customcrewmates-crewmates()))+ " remains ", 50, 65, 174, 174, 174); } else { - graphics.createtextbox(" " + help.number(int(map.customcrewmates-crewmates))+ " remain ", 50, 65, 174, 174, 174); + graphics.createtextbox(" " + help.number(int(map.customcrewmates-crewmates()))+ " remain ", 50, 65, 174, 174, 174); } graphics.textboxcenterx(); @@ -2028,17 +2028,17 @@ void Game::updatestate() graphics.addline("You have found a lost crewmate!"); graphics.textboxcenterx(); - if(int(map.customcrewmates-crewmates)==0) + if(int(map.customcrewmates-crewmates())==0) { graphics.createtextbox(" All crewmates rescued! ", 50, 135, 174, 174, 174); } - else if(map.customcrewmates-crewmates==1) + else if(map.customcrewmates-crewmates()==1) { - graphics.createtextbox(" " + help.number(int(map.customcrewmates-crewmates))+ " remains ", 50, 135, 174, 174, 174); + graphics.createtextbox(" " + help.number(int(map.customcrewmates-crewmates()))+ " remains ", 50, 135, 174, 174, 174); } else { - graphics.createtextbox(" " + help.number(int(map.customcrewmates-crewmates))+ " remain ", 50, 135, 174, 174, 174); + graphics.createtextbox(" " + help.number(int(map.customcrewmates-crewmates()))+ " remain ", 50, 135, 174, 174, 174); } graphics.textboxcenterx(); } @@ -2051,7 +2051,7 @@ void Game::updatestate() completestop = false; state = 0; - if(map.customcrewmates-crewmates==0) + if(map.customcrewmates-crewmates()==0) { if(map.custommodeforreal) { @@ -2087,7 +2087,7 @@ void Game::updatestate() graphics.backgrounddrawn = true; map.tdrawback = true; //Update level stats - if(map.customcrewmates-crewmates==0) + if(map.customcrewmates-crewmates()==0) { //Finished level if(map.customtrinkets-trinkets()==0) @@ -4926,7 +4926,6 @@ void Game::starttrial( int t ) gravitycontrol = savegc; coins = 0; - crewmates = 0; //state = 2; deathseq = -1; lifeseq = 10; //Not dead, in game initilisation state state = 0; @@ -5335,10 +5334,6 @@ void Game::customloadquick(std::string savfile) { savepoint = atoi(pText); } - else if (pKey == "crewmates") - { - crewmates = atoi(pText); - } else if (pKey == "companion") { companion = atoi(pText); @@ -6124,7 +6119,7 @@ void Game::customsavequick(std::string savfile) msgs->LinkEndChild( msg ); msg = new TiXmlElement( "crewmates" ); - msg->LinkEndChild( new TiXmlText( help.String(crewmates).c_str() )); + msg->LinkEndChild( new TiXmlText( help.String(crewmates()).c_str() )); msgs->LinkEndChild( msg ); @@ -7659,3 +7654,8 @@ int Game::trinkets() { return std::count(obj.collect.begin(), obj.collect.end(), 1); } + +int Game::crewmates() +{ + return std::count(obj.customcollect.begin(), obj.customcollect.end(), 1); +} diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h index 37c13ad2..cce63025 100644 --- a/desktop_version/src/Game.h +++ b/desktop_version/src/Game.h @@ -247,7 +247,7 @@ public: int deathseq, lifeseq; - int coins, trinkets(), crewmates, trinkencollect; + int coins, trinkets(), crewmates(), trinkencollect; int savepoint, teleport, teleportxpos; int edteleportent; bool completestop; diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index d390203a..d409c913 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -2138,10 +2138,10 @@ void maprender() graphics.Print( -1, 220-110, ed.ListOfMetaData[game.playcustomlevel].Desc2, 196, 196, 255 - help.glow, true); graphics.Print( -1, 220-120, ed.ListOfMetaData[game.playcustomlevel].Desc3, 196, 196, 255 - help.glow, true); - if(map.customcrewmates-game.crewmates==1){ - graphics.Print(1,220-165, help.number(int(map.customcrewmates-game.crewmates))+ " crewmate remains", 196, 196, 255 - help.glow, true); - }else if(map.customcrewmates-game.crewmates>0){ - graphics.Print(1,220-165, help.number(int(map.customcrewmates-game.crewmates))+ " crewmates remain", 196, 196, 255 - help.glow, true); + if(map.customcrewmates-game.crewmates()==1){ + graphics.Print(1,220-165, help.number(int(map.customcrewmates-game.crewmates()))+ " crewmate remains", 196, 196, 255 - help.glow, true); + }else if(map.customcrewmates-game.crewmates()>0){ + graphics.Print(1,220-165, help.number(int(map.customcrewmates-game.crewmates()))+ " crewmates remain", 196, 196, 255 - help.glow, true); } } else @@ -2153,10 +2153,10 @@ void maprender() graphics.Print( -1, 110, ed.ListOfMetaData[game.playcustomlevel].Desc2, 196, 196, 255 - help.glow, true); graphics.Print( -1, 120, ed.ListOfMetaData[game.playcustomlevel].Desc3, 196, 196, 255 - help.glow, true); - if(map.customcrewmates-game.crewmates==1){ - graphics.Print(1,165, help.number(int(map.customcrewmates-game.crewmates))+ " crewmate remains", 196, 196, 255 - help.glow, true); - }else if(map.customcrewmates-game.crewmates>0){ - graphics.Print(1,165, help.number(int(map.customcrewmates-game.crewmates))+ " crewmates remain", 196, 196, 255 - help.glow, true); + if(map.customcrewmates-game.crewmates()==1){ + graphics.Print(1,165, help.number(int(map.customcrewmates-game.crewmates()))+ " crewmate remains", 196, 196, 255 - help.glow, true); + }else if(map.customcrewmates-game.crewmates()>0){ + graphics.Print(1,165, help.number(int(map.customcrewmates-game.crewmates()))+ " crewmates remain", 196, 196, 255 - help.glow, true); } } } diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index fa9d7487..f3571e2b 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -1466,7 +1466,6 @@ void scriptclass::run() i = obj.getplayer(); obj.entities[i].tile = 0; - game.crewmates=0; for (i = 0; i < 100; i++) { obj.collect[i] = 0; @@ -3490,8 +3489,6 @@ void scriptclass::hardreset() game.inintermission = false; game.insecretlab = false; - game.crewmates=0; - game.state = 0; game.statedelay = 0;