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

Fix mixed indentation in Script.cpp and Script.h

Looks like the person who added starting a custom level indented with
spaces instead of tabs.
This commit is contained in:
Misa 2020-04-02 13:26:22 -07:00 committed by Ethan Lee
parent 1310896191
commit 4657760c2d
2 changed files with 136 additions and 136 deletions

View file

@ -8,7 +8,7 @@
scriptclass::scriptclass() scriptclass::scriptclass()
{ {
//Start SDL //Start SDL
//Init //Init
words.resize(40); words.resize(40);
@ -90,44 +90,44 @@ void scriptclass::run()
obj.entities[player].yp += ss_toi(words[2]); obj.entities[player].yp += ss_toi(words[2]);
scriptdelay = 1; scriptdelay = 1;
} }
#if !defined(NO_CUSTOM_LEVELS) #if !defined(NO_CUSTOM_LEVELS)
if (words[0] == "warpdir") if (words[0] == "warpdir")
{ {
int temprx=ss_toi(words[1])-1; int temprx=ss_toi(words[1])-1;
int tempry=ss_toi(words[2])-1; int tempry=ss_toi(words[2])-1;
int curlevel=temprx+(ed.maxwidth*(tempry)); int curlevel=temprx+(ed.maxwidth*(tempry));
ed.level[curlevel].warpdir=ss_toi(words[3]); ed.level[curlevel].warpdir=ss_toi(words[3]);
//If screen warping, then override all that: //If screen warping, then override all that:
graphics.backgrounddrawn = false; graphics.backgrounddrawn = false;
//Do we update our own room? //Do we update our own room?
if(game.roomx-100==temprx && game.roomy-100==tempry){ if(game.roomx-100==temprx && game.roomy-100==tempry){
map.warpx=false; map.warpy=false; map.warpx=false; map.warpy=false;
if(ed.level[curlevel].warpdir==0){ if(ed.level[curlevel].warpdir==0){
map.background = 1; map.background = 1;
//Be careful, we could be in a Lab or Warp Zone room... //Be careful, we could be in a Lab or Warp Zone room...
if(ed.level[curlevel].tileset==2){ if(ed.level[curlevel].tileset==2){
//Lab //Lab
map.background = 2; map.background = 2;
graphics.rcol = ed.level[curlevel].tilecol; graphics.rcol = ed.level[curlevel].tilecol;
}else if(ed.level[curlevel].tileset==3){ }else if(ed.level[curlevel].tileset==3){
//Warp Zone //Warp Zone
map.background = 6; map.background = 6;
} }
}else if(ed.level[curlevel].warpdir==1){ }else if(ed.level[curlevel].warpdir==1){
map.warpx=true; map.warpx=true;
map.background=3; map.background=3;
graphics.rcol = ed.getwarpbackground(temprx,tempry); graphics.rcol = ed.getwarpbackground(temprx,tempry);
}else if(ed.level[curlevel].warpdir==2){ }else if(ed.level[curlevel].warpdir==2){
map.warpy=true; map.warpy=true;
map.background=4; map.background=4;
graphics.rcol = ed.getwarpbackground(temprx,tempry); graphics.rcol = ed.getwarpbackground(temprx,tempry);
}else if(ed.level[curlevel].warpdir==3){ }else if(ed.level[curlevel].warpdir==3){
map.warpx=true; map.warpy=true; map.warpx=true; map.warpy=true;
map.background = 5; map.background = 5;
graphics.rcol = ed.getwarpbackground(temprx,tempry); graphics.rcol = ed.getwarpbackground(temprx,tempry);
} }
} }
} }
if (words[0] == "ifwarp") if (words[0] == "ifwarp")
{ {
@ -137,22 +137,22 @@ void scriptclass::run()
position--; position--;
} }
} }
#endif #endif
if (words[0] == "destroy") if (words[0] == "destroy")
{ {
if(words[1]=="gravitylines"){ if(words[1]=="gravitylines"){
for(int edi=0; edi<obj.nentity; edi++){ for(int edi=0; edi<obj.nentity; edi++){
if(obj.entities[edi].type==9) obj.entities[edi].active=false; if(obj.entities[edi].type==9) obj.entities[edi].active=false;
if(obj.entities[edi].type==10) obj.entities[edi].active=false; if(obj.entities[edi].type==10) obj.entities[edi].active=false;
} }
}else if(words[1]=="warptokens"){ }else if(words[1]=="warptokens"){
for(int edi=0; edi<obj.nentity; edi++){ for(int edi=0; edi<obj.nentity; edi++){
if(obj.entities[edi].type==11) obj.entities[edi].active=false; if(obj.entities[edi].type==11) obj.entities[edi].active=false;
} }
}else if(words[1]=="platforms"){ }else if(words[1]=="platforms"){
for(int edi=0; edi<obj.nentity; edi++){ for(int edi=0; edi<obj.nentity; edi++){
if(obj.entities[edi].rule==2 && obj.entities[edi].animate==100) obj.entities[edi].active=false; if(obj.entities[edi].rule==2 && obj.entities[edi].animate==100) obj.entities[edi].active=false;
} }
} }
} }
if (words[0] == "customiftrinkets") if (words[0] == "customiftrinkets")
@ -171,7 +171,7 @@ void scriptclass::run()
position--; position--;
} }
} }
else if (words[0] == "customifflag") else if (words[0] == "customifflag")
{ {
if (obj.flags[ss_toi(words[1])]==1) if (obj.flags[ss_toi(words[1])]==1)
{ {
@ -182,9 +182,9 @@ void scriptclass::run()
if (words[0] == "custommap") if (words[0] == "custommap")
{ {
if(words[1]=="on"){ if(words[1]=="on"){
map.customshowmm=true; map.customshowmm=true;
}else if(words[1]=="off"){ }else if(words[1]=="off"){
map.customshowmm=false; map.customshowmm=false;
} }
} }
if (words[0] == "delay") if (words[0] == "delay")
@ -192,7 +192,7 @@ void scriptclass::run()
//USAGE: delay(frames) //USAGE: delay(frames)
scriptdelay = ss_toi(words[1]); scriptdelay = ss_toi(words[1]);
} }
if (words[0] == "flag") if (words[0] == "flag")
{ {
if(ss_toi(words[1])>=0 && ss_toi(words[1])<100){ if(ss_toi(words[1])>=0 && ss_toi(words[1])<100){
if(words[2]=="on"){ if(words[2]=="on"){
@ -254,7 +254,7 @@ void scriptclass::run()
{ {
music.play(music.resumesong); music.play(music.resumesong);
} }
if (words[0] == "musicfadeout") if (words[0] == "musicfadeout")
{ {
music.fadeout(); music.fadeout();
music.dontquickfade = true; music.dontquickfade = true;
@ -532,8 +532,8 @@ void scriptclass::run()
} }
if(i==0 && words[1]!="player" && words[1]!="cyan"){ if(i==0 && words[1]!="player" && words[1]!="cyan"){
//Requested crewmate is not actually on screen //Requested crewmate is not actually on screen
words[2] = "donothing"; words[2] = "donothing";
j = -1; j = -1;
textx = -500; textx = -500;
texty = -500; texty = -500;
@ -3214,107 +3214,107 @@ void scriptclass::startgamemode( int t )
} }
map.gotoroom(game.saverx, game.savery); map.gotoroom(game.saverx, game.savery);
if(ed.levmusic>0){ if(ed.levmusic>0){
music.play(ed.levmusic); music.play(ed.levmusic);
}else{ }else{
music.currentsong=-1; music.currentsong=-1;
} }
//load("intro"); //load("intro");
break; break;
case 22: //play custom level (in game) case 22: //play custom level (in game)
{ {
//Initilise the level //Initilise the level
//First up, find the start point //First up, find the start point
std::string filename = std::string(ed.ListOfMetaData[game.playcustomlevel].filename); std::string filename = std::string(ed.ListOfMetaData[game.playcustomlevel].filename);
ed.load(filename); ed.load(filename);
ed.findstartpoint(); ed.findstartpoint();
game.gamestate = GAMEMODE; game.gamestate = GAMEMODE;
music.fadeout(); music.fadeout();
hardreset(); hardreset();
game.customstart(); game.customstart();
game.jumpheld = true; game.jumpheld = true;
map.custommodeforreal = true; map.custommodeforreal = true;
map.custommode = true; map.custommode = true;
map.customx = 100; map.customx = 100;
map.customy = 100; map.customy = 100;
//graphics.showcutscenebars = true; //graphics.showcutscenebars = true;
//graphics.cutscenebarspos = 320; //graphics.cutscenebarspos = 320;
//set flipmode //set flipmode
if (graphics.setflipmode) graphics.flipmode = true; if (graphics.setflipmode) graphics.flipmode = true;
if(obj.nentity==0) if(obj.nentity==0)
{ {
obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed
} }
else else
{ {
map.resetplayer(); map.resetplayer();
} }
map.gotoroom(game.saverx, game.savery); map.gotoroom(game.saverx, game.savery);
ed.generatecustomminimap(); ed.generatecustomminimap();
map.customshowmm=true; map.customshowmm=true;
if(ed.levmusic>0){ if(ed.levmusic>0){
music.play(ed.levmusic); music.play(ed.levmusic);
}else{ }else{
music.currentsong=-1; music.currentsong=-1;
} }
graphics.fademode = 4; graphics.fademode = 4;
//load("intro"); //load("intro");
break; break;
} }
case 23: //Continue in custom level case 23: //Continue in custom level
{ {
//Initilise the level //Initilise the level
//First up, find the start point //First up, find the start point
std::string filename = std::string(ed.ListOfMetaData[game.playcustomlevel].filename); std::string filename = std::string(ed.ListOfMetaData[game.playcustomlevel].filename);
ed.load(filename); ed.load(filename);
ed.findstartpoint(); ed.findstartpoint();
game.gamestate = GAMEMODE; game.gamestate = GAMEMODE;
music.fadeout(); music.fadeout();
hardreset(); hardreset();
map.custommodeforreal = true; map.custommodeforreal = true;
map.custommode = true; map.custommode = true;
map.customx = 100; map.customx = 100;
map.customy = 100; map.customy = 100;
game.customstart(); game.customstart();
game.customloadquick(ed.ListOfMetaData[game.playcustomlevel].filename); game.customloadquick(ed.ListOfMetaData[game.playcustomlevel].filename);
game.jumpheld = true; game.jumpheld = true;
game.gravitycontrol = game.savegc; game.gravitycontrol = game.savegc;
//graphics.showcutscenebars = true; //graphics.showcutscenebars = true;
//graphics.cutscenebarspos = 320; //graphics.cutscenebarspos = 320;
//set flipmode //set flipmode
if (graphics.setflipmode) graphics.flipmode = true; if (graphics.setflipmode) graphics.flipmode = true;
if(obj.nentity==0) if(obj.nentity==0)
{ {
obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed obj.createentity(game.savex, game.savey, 0, 0); //In this game, constant, never destroyed
} }
else else
{ {
map.resetplayer(); map.resetplayer();
} }
map.gotoroom(game.saverx, game.savery); map.gotoroom(game.saverx, game.savery);
/* Handled by load /* Handled by load
if(ed.levmusic>0){ if(ed.levmusic>0){
music.play(ed.levmusic); music.play(ed.levmusic);
}else{ }else{
music.currentsong=-1; music.currentsong=-1;
} }
*/ */
ed.generatecustomminimap(); ed.generatecustomminimap();
graphics.fademode = 4; graphics.fademode = 4;
//load("intro"); //load("intro");
break; break;
} }
#endif #endif
case 100: case 100:
game.savestats(); game.savestats();
@ -3524,8 +3524,8 @@ void scriptclass::hardreset()
game.state = 0; game.state = 0;
game.statedelay = 0; game.statedelay = 0;
game.hascontrol = true; game.hascontrol = true;
game.advancetext = false; game.advancetext = false;
game.pausescript = false; game.pausescript = false;
@ -3536,7 +3536,7 @@ void scriptclass::hardreset()
graphics.showcutscenebars = false; graphics.showcutscenebars = false;
graphics.cutscenebarspos = 0; graphics.cutscenebarspos = 0;
//mapclass //mapclass
map.warpx = false; map.warpx = false;
map.warpy = false; map.warpy = false;
map.showteleporters = false; map.showteleporters = false;
@ -3584,9 +3584,9 @@ void scriptclass::hardreset()
obj.flags[i] = false; obj.flags[i] = false;
} }
for (i = 0; i < 6; i++){ for (i = 0; i < 6; i++){
obj.customcrewmoods[i]=1; obj.customcrewmoods[i]=1;
} }
for (i = 0; i < 100; i++) for (i = 0; i < 100; i++)
{ {

View file

@ -14,8 +14,8 @@ public:
scriptclass(); scriptclass();
void load(std::string t); void load(std::string t);
void loadother(std::string t); void loadother(std::string t);
void inline add(std::string t) void inline add(std::string t)