diff --git a/Makefile b/Makefile index ac8da96..0fa53c4 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ all: rc edit rc: rc.c shared.c rc.h shared.h globals.h defs.h - gcc -O3 -Wall -DREV=`./getsvnrev.sh` -o rc -g rc.c shared.c `sdl-config --cflags --libs` -I/usr/local/include -L/usr/local/lib -L/opt/local/lib -lSDLmain -lSDL -lSDL_image -lSDL_gfx -lSDL_ttf -lSDL_mixer + gcc -O3 -Wall -DREV=`./getsvnrev.sh` -o rc -g rc.c shared.c `sdl-config --cflags --libs` -I/usr/local/include -L/sw/lib -L/usr/local/lib -L/opt/local/lib -lSDLmain -lSDL -lSDL_image -lSDL_gfx -lSDL_ttf -lSDL_mixer edit: edit.c shared.c edit.h shared.h globals.h defs.h - gcc -D__EDITOR -DREV=`./getsvnrev.sh` -Wall -o edit -g edit.c shared.c `sdl-config --cflags --libs` -I/usr/local/include -L/usr/local/lib -L/opt/local/lib -lSDLmain -lSDL -lSDL_image -lSDL_gfx -lSDL_ttf + gcc -D__EDITOR -DREV=`./getsvnrev.sh` -Wall -o edit -g edit.c shared.c `sdl-config --cflags --libs` -I/usr/local/include -L/sw/lib -lSDLmain -lSDL -lSDL_image -lSDL_ttf -L/opt/local/lib -lSDL_gfx app: rc ./makeapp.sh diff --git a/data/levels/level610.dat b/data/levels/level610.dat index 911f8fa..520bf6d 100644 --- a/data/levels/level610.dat +++ b/data/levels/level610.dat @@ -61,8 +61,8 @@ exitdir -2 33,0,0,0,0,90,90,90,90,0,0,0,90,90,90,90,89,89,0,0,0,0,89,89,90,90,90,90,0,0,0,90,90,90,90,0,0,0,0,33, 33,89,89,89,89,90,90,90,90,89,89,89,90,90,90,90,90,90,89,0,0,89,90,90,90,90,90,90,89,89,89,90,90,90,90,89,89,89,89,33, 33,0,0,0,0,86,86,86,0,0,0,0,90,90,90,90,90,90,0,0,0,0,90,90,90,90,90,90,0,0,0,86,86,0,0,0,86,0,0,33, -33,0,0,0,0,0,0,0,0,0,0,0,90,90,90,90,0,0,0,0,0,0,0,0,90,90,90,90,0,0,0,0,0,0,0,0,0,0,0,33, -33,0,0,0,0,0,0,0,0,0,0,0,90,90,0,86,0,0,0,0,0,0,0,0,0,0,90,90,0,0,0,0,0,0,0,0,0,0,0,33, +33,0,0,0,0,0,0,0,0,0,0,0,90,90,90,90,92,0,0,0,0,0,0,93,90,90,90,90,0,0,0,0,0,0,0,0,0,0,0,33, +33,0,0,0,0,0,0,0,0,0,0,0,90,90,92,86,0,0,0,0,0,0,0,0,0,93,90,90,0,0,0,0,0,0,0,0,0,0,0,33, 33,0,0,0,32,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,32,0,0,0,33, 33,0,0,0,33,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,33,0,0,0,33, 33,0,0,0,33,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,33,0,0,0,33, diff --git a/data/levels/level615.dat b/data/levels/level615.dat index 855dabb..aa5acf4 100644 --- a/data/levels/level615.dat +++ b/data/levels/level615.dat @@ -55,3 +55,19 @@ exitdir 1 33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33, 33,0,0,0,0,0,0,0,0,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,0,0,0,0,0,0,0,0,33, layer2 +7,11,95,layer3 +8,11,95,layer3 +9,11,95,layer3 +30,11,95,layer3 +31,11,95,layer3 +32,11,95,layer3 +7,12,95,layer3 +8,12,95,layer3 +9,12,95,layer3 +30,12,95,layer3 +31,12,95,layer3 +32,12,95,layer3 +18,14,95,layer3 +19,14,95,layer3 +20,14,95,layer3 +21,14,95,layer3 diff --git a/data/levels/level616.dat b/data/levels/level616.dat index 543a36a..0a2c406 100644 --- a/data/levels/level616.dat +++ b/data/levels/level616.dat @@ -5,7 +5,7 @@ help endhelp monsters 0 16 19 -134 34 28 +134 22 19 23 20 8 16 23 19 12 22 28 diff --git a/data/levels/level617.dat b/data/levels/level617.dat index d87ca76..96cd7f6 100644 --- a/data/levels/level617.dat +++ b/data/levels/level617.dat @@ -46,7 +46,7 @@ monsters endmonsters exitdir -2 90,90,90,90,90,90,90,90,90,90,90,90,90,91,91,90,90,90,90,90,91,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90, -90,0,0,0,0,0,0,0,0,0,90,90,90,90,91,91,90,90,90,90,91,90,90,90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90, +90,0,0,0,0,0,0,0,0,93,90,90,90,90,91,91,90,90,90,90,91,90,90,90,92,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90, 90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90, 90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90, 90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90, @@ -54,11 +54,11 @@ exitdir -2 90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90, 90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,89,89,89,89,0,0,0,0,0,0,0,0,90, 90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90,90,90,90,0,0,0,0,0,0,0,0,90, -90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90,90,90,90,0,0,0,0,0,0,0,0,90, -90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,89,89,90,90,90,90,89,0,0,0,0,0,0,0,90, +90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90,90,91,90,0,0,0,0,0,0,0,0,90, +90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,89,89,90,90,91,90,89,0,0,0,0,0,0,0,90, 90,89,89,89,89,89,89,89,89,89,89,89,89,89,89,0,0,0,0,89,89,89,89,89,89,90,90,90,90,90,90,90,89,89,89,89,89,89,89,90, -90,90,90,90,90,90,90,90,92,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,90, -90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,90, +90,91,90,90,90,90,90,90,92,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,93,90, +90,92,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,90, 90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,90, 90,0,0,0,0,0,0,0,0,0,0,0,0,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,0,0,0,0,0,0,0,7,0,0,0,90, 90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90, diff --git a/data/map.dat b/data/map.dat index 2852273..a5ff64f 100644 --- a/data/map.dat +++ b/data/map.dat @@ -74,6 +74,7 @@ 605,level605.dat,Frosty Towers 616,level616.dat,Polar Claw 615,level615.dat,Raaa! +618,level618.dat,Secret Exit 109,level109.dat,THE END SO FAR 99,level99.dat,TEST LEVEL 0,intro.dat,INTRO diff --git a/defs.h b/defs.h index 4c6387b..b09d549 100644 --- a/defs.h +++ b/defs.h @@ -723,6 +723,7 @@ #define MV_WALK 1 // walked/climbed on purpose #define MV_ICE 3 // slid on ice #define MV_FLY 4 // flying +#define MV_SWIM 64 // swum somewhere - OR this // Tile types diff --git a/edit.c b/edit.c index 6933151..178420d 100644 --- a/edit.c +++ b/edit.c @@ -35,6 +35,7 @@ int skipto = -1; int layer = 1; // which layer we are editting, either 1 or 2 int layertransparent = B_TRUE; +int showlayer3 = B_TRUE; sprite_t *waypointm = NULL; @@ -511,7 +512,18 @@ int main (int argc, char **argv) { drawsprites(); sprintf(tempm, "Transparent layers now %s",layertransparent ? "ON" : "OFF"); setstatustext(tempm, &green); - toggletimer = 15; + toggletimer = 45; + } + } + if (keys[SDLK_y]) { + if (toggletimer == 0) { + if (showlayer3) showlayer3 = B_FALSE; + else showlayer3 = B_TRUE; + draweditorlevel(); + drawsprites(); + sprintf(tempm, "Now %s layer 3",layertransparent ? "showing" : "hiding"); + setstatustext(tempm, &green); + toggletimer = 45; } } if (keys[SDLK_w]) { // set waypoints @@ -1272,6 +1284,9 @@ void draweditortile3(SDL_Surface *where, int x, int y) { tiletype_t *tt; int offset; + if (!showlayer3) { + return; + } if ((x < 0) || (y < 0) || (x >= LEVELW) || (y >= LEVELH)) { return; diff --git a/rc.c b/rc.c index 97e6879..45d9ff1 100644 --- a/rc.c +++ b/rc.c @@ -10896,8 +10896,11 @@ void swimup(sprite_t *pl) { } else if (pl == player2) { pnum = 1; } else return; // only valid for players - + if (pl->moved & MV_SWIM) { + return; + } + pl->falling = B_FALSE; if (!isroofabove(pl)) { // is there water above us too? @@ -10912,6 +10915,7 @@ void swimup(sprite_t *pl) { } // if so, swim up pl->y -= swimspeed; + pl->moved |= MV_SWIM; } else { int whichway; // if not, jump up @@ -10931,6 +10935,11 @@ void swimup(sprite_t *pl) { } void swimdown(sprite_t *pl) { + + if (pl->moved & MV_SWIM) { + return; + } + pl->falling = B_FALSE; if (!isonground(pl)) { double swimspeed; @@ -10942,6 +10951,7 @@ void swimdown(sprite_t *pl) { swimspeed *= 2; } pl->y += swimspeed; + pl->moved |= MV_SWIM; } } @@ -11636,13 +11646,13 @@ void startgame(void) { // settings done in addsprite() if (player) { int c; - setdefaults(player); player->permspeed = B_FALSE; player->permbignet = B_FALSE; player->permnumnets = B_FALSE; player->permmask = B_FALSE; player->permarmour = B_FALSE; player->permsticky = B_FALSE; + setdefaults(player); player->numcards = 0; for (c = 0; c < MAXCARDS; c++) { player->card[c] = -1; @@ -11651,13 +11661,13 @@ void startgame(void) { } if (player2) { int c; - setdefaults(player2); player2->permspeed = B_FALSE; player2->permbignet = B_FALSE; player2->permnumnets = B_FALSE; player2->permmask = B_FALSE; player2->permarmour = B_FALSE; player2->permsticky = B_FALSE; + setdefaults(player2); player2->numcards = 0; for (c = 0; c < MAXCARDS; c++) { player2->card[c] = -1; @@ -11681,11 +11691,13 @@ void startgame(void) { if (want1up) { if (player == NULL) { player = addsprite(P_PLAYER, 32, 450, "Player 1" ); + setdefaults(player); } } if (want2up) { if (player2 == NULL) { player2 = addsprite(P_PLAYER2, 32, 450, "Player 2" ); + setdefaults(player2); } } diff --git a/shared.c b/shared.c index 36739ff..d5ee9cb 100644 --- a/shared.c +++ b/shared.c @@ -570,12 +570,20 @@ int loadlevel(int lnum, int wantmonsters) { if (player == NULL) { player = addsprite(P_PLAYER, (curlevel->p1x * TILEW) + (TILEW/2), (curlevel->p1y * TILEH) + TILEH-2 , "Player 1" ); + // call this again to make sure player gets + // level-based powerups when starting on other + // levels + setdefaults(player); } } if (want2up) { if (player2 == NULL) { player2 = addsprite(P_PLAYER2, (curlevel->p2x * TILEW) + (TILEW/2), (curlevel->p2y * TILEH) + TILEH-2 , "Player 2" ); + // call this again to make sure player gets + // level-based powerups when starting on other + // levels + setdefaults(player2); } } @@ -667,7 +675,6 @@ printf(".\n"); void setdefaults(sprite_t *s) { if (isplayer(s)) { - // set permenant powerups based on level if (curlevelnum > 20) { s->permspeed = B_TRUE;