mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59: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:
parent
9510c3c871
commit
c077e51fb4
5 changed files with 25 additions and 29 deletions
|
@ -3129,7 +3129,6 @@ void entityclass::updateentities( int i )
|
||||||
}
|
}
|
||||||
else if (entities[i].state == 1)
|
else if (entities[i].state == 1)
|
||||||
{
|
{
|
||||||
game.crewmates++;
|
|
||||||
if (game.intimetrial)
|
if (game.intimetrial)
|
||||||
{
|
{
|
||||||
customcollect[entities[i].para] = 1;
|
customcollect[entities[i].para] = 1;
|
||||||
|
|
|
@ -2006,17 +2006,17 @@ void Game::updatestate()
|
||||||
graphics.addline("You have found a lost crewmate!");
|
graphics.addline("You have found a lost crewmate!");
|
||||||
graphics.textboxcenterx();
|
graphics.textboxcenterx();
|
||||||
|
|
||||||
if(int(map.customcrewmates-crewmates)==0)
|
if(int(map.customcrewmates-crewmates())==0)
|
||||||
{
|
{
|
||||||
graphics.createtextbox(" All crewmates rescued! ", 50, 65, 174, 174, 174);
|
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
|
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();
|
graphics.textboxcenterx();
|
||||||
|
|
||||||
|
@ -2028,17 +2028,17 @@ void Game::updatestate()
|
||||||
graphics.addline("You have found a lost crewmate!");
|
graphics.addline("You have found a lost crewmate!");
|
||||||
graphics.textboxcenterx();
|
graphics.textboxcenterx();
|
||||||
|
|
||||||
if(int(map.customcrewmates-crewmates)==0)
|
if(int(map.customcrewmates-crewmates())==0)
|
||||||
{
|
{
|
||||||
graphics.createtextbox(" All crewmates rescued! ", 50, 135, 174, 174, 174);
|
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
|
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();
|
graphics.textboxcenterx();
|
||||||
}
|
}
|
||||||
|
@ -2051,7 +2051,7 @@ void Game::updatestate()
|
||||||
completestop = false;
|
completestop = false;
|
||||||
state = 0;
|
state = 0;
|
||||||
|
|
||||||
if(map.customcrewmates-crewmates==0)
|
if(map.customcrewmates-crewmates()==0)
|
||||||
{
|
{
|
||||||
if(map.custommodeforreal)
|
if(map.custommodeforreal)
|
||||||
{
|
{
|
||||||
|
@ -2087,7 +2087,7 @@ void Game::updatestate()
|
||||||
graphics.backgrounddrawn = true;
|
graphics.backgrounddrawn = true;
|
||||||
map.tdrawback = true;
|
map.tdrawback = true;
|
||||||
//Update level stats
|
//Update level stats
|
||||||
if(map.customcrewmates-crewmates==0)
|
if(map.customcrewmates-crewmates()==0)
|
||||||
{
|
{
|
||||||
//Finished level
|
//Finished level
|
||||||
if(map.customtrinkets-trinkets()==0)
|
if(map.customtrinkets-trinkets()==0)
|
||||||
|
@ -4926,7 +4926,6 @@ void Game::starttrial( int t )
|
||||||
gravitycontrol = savegc;
|
gravitycontrol = savegc;
|
||||||
|
|
||||||
coins = 0;
|
coins = 0;
|
||||||
crewmates = 0;
|
|
||||||
|
|
||||||
//state = 2; deathseq = -1; lifeseq = 10; //Not dead, in game initilisation state
|
//state = 2; deathseq = -1; lifeseq = 10; //Not dead, in game initilisation state
|
||||||
state = 0;
|
state = 0;
|
||||||
|
@ -5335,10 +5334,6 @@ void Game::customloadquick(std::string savfile)
|
||||||
{
|
{
|
||||||
savepoint = atoi(pText);
|
savepoint = atoi(pText);
|
||||||
}
|
}
|
||||||
else if (pKey == "crewmates")
|
|
||||||
{
|
|
||||||
crewmates = atoi(pText);
|
|
||||||
}
|
|
||||||
else if (pKey == "companion")
|
else if (pKey == "companion")
|
||||||
{
|
{
|
||||||
companion = atoi(pText);
|
companion = atoi(pText);
|
||||||
|
@ -6124,7 +6119,7 @@ void Game::customsavequick(std::string savfile)
|
||||||
msgs->LinkEndChild( msg );
|
msgs->LinkEndChild( msg );
|
||||||
|
|
||||||
msg = new TiXmlElement( "crewmates" );
|
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 );
|
msgs->LinkEndChild( msg );
|
||||||
|
|
||||||
|
|
||||||
|
@ -7659,3 +7654,8 @@ int Game::trinkets()
|
||||||
{
|
{
|
||||||
return std::count(obj.collect.begin(), obj.collect.end(), 1);
|
return std::count(obj.collect.begin(), obj.collect.end(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Game::crewmates()
|
||||||
|
{
|
||||||
|
return std::count(obj.customcollect.begin(), obj.customcollect.end(), 1);
|
||||||
|
}
|
||||||
|
|
|
@ -247,7 +247,7 @@ public:
|
||||||
|
|
||||||
int deathseq, lifeseq;
|
int deathseq, lifeseq;
|
||||||
|
|
||||||
int coins, trinkets(), crewmates, trinkencollect;
|
int coins, trinkets(), crewmates(), trinkencollect;
|
||||||
int savepoint, teleport, teleportxpos;
|
int savepoint, teleport, teleportxpos;
|
||||||
int edteleportent;
|
int edteleportent;
|
||||||
bool completestop;
|
bool completestop;
|
||||||
|
|
|
@ -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-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);
|
graphics.Print( -1, 220-120, ed.ListOfMetaData[game.playcustomlevel].Desc3, 196, 196, 255 - help.glow, true);
|
||||||
|
|
||||||
if(map.customcrewmates-game.crewmates==1){
|
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);
|
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){
|
}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);
|
graphics.Print(1,220-165, help.number(int(map.customcrewmates-game.crewmates()))+ " crewmates remain", 196, 196, 255 - help.glow, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
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, 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);
|
graphics.Print( -1, 120, ed.ListOfMetaData[game.playcustomlevel].Desc3, 196, 196, 255 - help.glow, true);
|
||||||
|
|
||||||
if(map.customcrewmates-game.crewmates==1){
|
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);
|
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){
|
}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);
|
graphics.Print(1,165, help.number(int(map.customcrewmates-game.crewmates()))+ " crewmates remain", 196, 196, 255 - help.glow, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1466,7 +1466,6 @@ void scriptclass::run()
|
||||||
i = obj.getplayer();
|
i = obj.getplayer();
|
||||||
obj.entities[i].tile = 0;
|
obj.entities[i].tile = 0;
|
||||||
|
|
||||||
game.crewmates=0;
|
|
||||||
for (i = 0; i < 100; i++)
|
for (i = 0; i < 100; i++)
|
||||||
{
|
{
|
||||||
obj.collect[i] = 0;
|
obj.collect[i] = 0;
|
||||||
|
@ -3490,8 +3489,6 @@ void scriptclass::hardreset()
|
||||||
game.inintermission = false;
|
game.inintermission = false;
|
||||||
game.insecretlab = false;
|
game.insecretlab = false;
|
||||||
|
|
||||||
game.crewmates=0;
|
|
||||||
|
|
||||||
game.state = 0;
|
game.state = 0;
|
||||||
game.statedelay = 0;
|
game.statedelay = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue