1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Don't use separate variable for number of collected crewmates

Same as previous commit, except for crewmates in custom levels instead.
This commit is contained in:
Misa 2020-04-06 23:53:32 -07:00 committed by Ethan Lee
parent 9510c3c871
commit c077e51fb4
5 changed files with 25 additions and 29 deletions

View file

@ -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;

View file

@ -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);
}

View file

@ -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;

View file

@ -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);
}
}
}

View file

@ -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;