mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 10:09:43 +01:00
Don't use separate variable for number of crewmates in level
Same as previous commit, this time for crewmates.
This commit is contained in:
parent
0047dc8d81
commit
89b6b67a77
4 changed files with 33 additions and 28 deletions
|
@ -2011,17 +2011,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(ed.numcrewmates-crewmates()==0)
|
if(ed.numcrewmates()-crewmates()==0)
|
||||||
{
|
{
|
||||||
graphics.createtextbox(" All crewmates rescued! ", 50, 65, 174, 174, 174);
|
graphics.createtextbox(" All crewmates rescued! ", 50, 65, 174, 174, 174);
|
||||||
}
|
}
|
||||||
else if(ed.numcrewmates-crewmates()==1)
|
else if(ed.numcrewmates()-crewmates()==1)
|
||||||
{
|
{
|
||||||
graphics.createtextbox(" " + help.number(ed.numcrewmates-crewmates())+ " remains ", 50, 65, 174, 174, 174);
|
graphics.createtextbox(" " + help.number(ed.numcrewmates()-crewmates())+ " remains ", 50, 65, 174, 174, 174);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
graphics.createtextbox(" " + help.number(ed.numcrewmates-crewmates())+ " remain ", 50, 65, 174, 174, 174);
|
graphics.createtextbox(" " + help.number(ed.numcrewmates()-crewmates())+ " remain ", 50, 65, 174, 174, 174);
|
||||||
}
|
}
|
||||||
graphics.textboxcenterx();
|
graphics.textboxcenterx();
|
||||||
|
|
||||||
|
@ -2033,17 +2033,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(ed.numcrewmates-crewmates()==0)
|
if(ed.numcrewmates()-crewmates()==0)
|
||||||
{
|
{
|
||||||
graphics.createtextbox(" All crewmates rescued! ", 50, 135, 174, 174, 174);
|
graphics.createtextbox(" All crewmates rescued! ", 50, 135, 174, 174, 174);
|
||||||
}
|
}
|
||||||
else if(ed.numcrewmates-crewmates()==1)
|
else if(ed.numcrewmates()-crewmates()==1)
|
||||||
{
|
{
|
||||||
graphics.createtextbox(" " + help.number(ed.numcrewmates-crewmates())+ " remains ", 50, 135, 174, 174, 174);
|
graphics.createtextbox(" " + help.number(ed.numcrewmates()-crewmates())+ " remains ", 50, 135, 174, 174, 174);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
graphics.createtextbox(" " + help.number(ed.numcrewmates-crewmates())+ " remain ", 50, 135, 174, 174, 174);
|
graphics.createtextbox(" " + help.number(ed.numcrewmates()-crewmates())+ " remain ", 50, 135, 174, 174, 174);
|
||||||
}
|
}
|
||||||
graphics.textboxcenterx();
|
graphics.textboxcenterx();
|
||||||
}
|
}
|
||||||
|
@ -2055,7 +2055,7 @@ void Game::updatestate()
|
||||||
completestop = false;
|
completestop = false;
|
||||||
state = 0;
|
state = 0;
|
||||||
|
|
||||||
if(ed.numcrewmates-crewmates()==0)
|
if(ed.numcrewmates()-crewmates()==0)
|
||||||
{
|
{
|
||||||
if(map.custommodeforreal)
|
if(map.custommodeforreal)
|
||||||
{
|
{
|
||||||
|
@ -2092,7 +2092,7 @@ void Game::updatestate()
|
||||||
map.tdrawback = true;
|
map.tdrawback = true;
|
||||||
#if !defined(NO_CUSTOM_LEVELS)
|
#if !defined(NO_CUSTOM_LEVELS)
|
||||||
//Update level stats
|
//Update level stats
|
||||||
if(ed.numcrewmates-crewmates()==0)
|
if(ed.numcrewmates()-crewmates()==0)
|
||||||
{
|
{
|
||||||
//Finished level
|
//Finished level
|
||||||
if(ed.numtrinkets()-trinkets()==0)
|
if(ed.numtrinkets()-trinkets()==0)
|
||||||
|
|
|
@ -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(ed.numcrewmates-game.crewmates()==1){
|
if(ed.numcrewmates()-game.crewmates()==1){
|
||||||
graphics.Print(1,220-165, help.number(ed.numcrewmates-game.crewmates())+ " crewmate remains", 196, 196, 255 - help.glow, true);
|
graphics.Print(1,220-165, help.number(ed.numcrewmates()-game.crewmates())+ " crewmate remains", 196, 196, 255 - help.glow, true);
|
||||||
}else if(ed.numcrewmates-game.crewmates()>0){
|
}else if(ed.numcrewmates()-game.crewmates()>0){
|
||||||
graphics.Print(1,220-165, help.number(ed.numcrewmates-game.crewmates())+ " crewmates remain", 196, 196, 255 - help.glow, true);
|
graphics.Print(1,220-165, help.number(ed.numcrewmates()-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(ed.numcrewmates-game.crewmates()==1){
|
if(ed.numcrewmates()-game.crewmates()==1){
|
||||||
graphics.Print(1,165, help.number(ed.numcrewmates-game.crewmates())+ " crewmate remains", 196, 196, 255 - help.glow, true);
|
graphics.Print(1,165, help.number(ed.numcrewmates()-game.crewmates())+ " crewmate remains", 196, 196, 255 - help.glow, true);
|
||||||
}else if(ed.numcrewmates-game.crewmates()>0){
|
}else if(ed.numcrewmates()-game.crewmates()>0){
|
||||||
graphics.Print(1,165, help.number(ed.numcrewmates-game.crewmates())+ " crewmates remain", 196, 196, 255 - help.glow, true);
|
graphics.Print(1,165, help.number(ed.numcrewmates()-game.crewmates())+ " crewmates remain", 196, 196, 255 - help.glow, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -285,7 +285,6 @@ void editorclass::reset()
|
||||||
entframe=0;
|
entframe=0;
|
||||||
entframedelay=0;
|
entframedelay=0;
|
||||||
|
|
||||||
numcrewmates=0;
|
|
||||||
edentity.clear();
|
edentity.clear();
|
||||||
levmusic=0;
|
levmusic=0;
|
||||||
|
|
||||||
|
@ -1621,11 +1620,6 @@ int editorclass::findwarptoken(int t)
|
||||||
|
|
||||||
void editorclass::countstuff()
|
void editorclass::countstuff()
|
||||||
{
|
{
|
||||||
numcrewmates=0;
|
|
||||||
for(size_t i=0; i<edentity.size(); i++)
|
|
||||||
{
|
|
||||||
if(edentity[i].t==15) numcrewmates++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void editorclass::load(std::string& _path)
|
void editorclass::load(std::string& _path)
|
||||||
|
@ -4920,11 +4914,10 @@ void editorinput()
|
||||||
}
|
}
|
||||||
else if(ed.drawmode==15) //Crewmate
|
else if(ed.drawmode==15) //Crewmate
|
||||||
{
|
{
|
||||||
if(ed.numcrewmates<100)
|
if(ed.numcrewmates()<100)
|
||||||
{
|
{
|
||||||
addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),15,1 + int(fRandom() * 5));
|
addedentity(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30),15,1 + int(fRandom() * 5));
|
||||||
ed.lclickdelay=1;
|
ed.lclickdelay=1;
|
||||||
ed.numcrewmates++;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -5047,7 +5040,6 @@ void editorinput()
|
||||||
{
|
{
|
||||||
if(edentity[i].x==ed.tilex + (ed.levx*40)&& edentity[i].y==ed.tiley+ (ed.levy*30))
|
if(edentity[i].x==ed.tilex + (ed.levx*40)&& edentity[i].y==ed.tiley+ (ed.levy*30))
|
||||||
{
|
{
|
||||||
if(edentity[i].t==15) ed.numcrewmates--;
|
|
||||||
removeedentity(i);
|
removeedentity(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5214,4 +5206,17 @@ int editorclass::numtrinkets()
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int editorclass::numcrewmates()
|
||||||
|
{
|
||||||
|
int temp = 0;
|
||||||
|
for (size_t i = 0; i < edentity.size(); i++)
|
||||||
|
{
|
||||||
|
if (edentity[i].t == 15)
|
||||||
|
{
|
||||||
|
temp++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* NO_CUSTOM_LEVELS */
|
#endif /* NO_CUSTOM_LEVELS */
|
||||||
|
|
|
@ -152,7 +152,7 @@ class editorclass{
|
||||||
std::vector <int> contents;
|
std::vector <int> contents;
|
||||||
std::vector <int> vmult;
|
std::vector <int> vmult;
|
||||||
int numtrinkets();
|
int numtrinkets();
|
||||||
int numcrewmates;
|
int numcrewmates();
|
||||||
edlevelclass level[400]; //Maxwidth*maxheight
|
edlevelclass level[400]; //Maxwidth*maxheight
|
||||||
int kludgewarpdir[400]; //Also maxwidth*maxheight
|
int kludgewarpdir[400]; //Also maxwidth*maxheight
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue