Fixed issue where player could swim upwards super-fast by holding UP+SWIM with

a mask

Removed a cheat key which could cause a crash.

Modified some levels (to remove duplicate monsters)
This commit is contained in:
Rob Pearce 2009-03-03 02:18:10 +00:00
parent c0c10963cd
commit 79c84370ed
10 changed files with 67 additions and 15 deletions

View File

@ -1,10 +1,10 @@
all: rc edit all: rc edit
rc: rc.c shared.c rc.h shared.h globals.h defs.h 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 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 app: rc
./makeapp.sh ./makeapp.sh

View File

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

View File

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

View File

@ -5,7 +5,7 @@ help
endhelp endhelp
monsters monsters
0 16 19 0 16 19
134 34 28 134 22 19
23 20 8 23 20 8
16 23 19 16 23 19
12 22 28 12 22 28

View File

@ -46,7 +46,7 @@ monsters
endmonsters endmonsters
exitdir -2 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,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,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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,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,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,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,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,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,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,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,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,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, 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,

View File

@ -74,6 +74,7 @@
605,level605.dat,Frosty Towers 605,level605.dat,Frosty Towers
616,level616.dat,Polar Claw 616,level616.dat,Polar Claw
615,level615.dat,Raaa! 615,level615.dat,Raaa!
618,level618.dat,Secret Exit
109,level109.dat,THE END SO FAR 109,level109.dat,THE END SO FAR
99,level99.dat,TEST LEVEL 99,level99.dat,TEST LEVEL
0,intro.dat,INTRO 0,intro.dat,INTRO

1
defs.h
View File

@ -723,6 +723,7 @@
#define MV_WALK 1 // walked/climbed on purpose #define MV_WALK 1 // walked/climbed on purpose
#define MV_ICE 3 // slid on ice #define MV_ICE 3 // slid on ice
#define MV_FLY 4 // flying #define MV_FLY 4 // flying
#define MV_SWIM 64 // swum somewhere - OR this
// Tile types // Tile types

17
edit.c
View File

@ -35,6 +35,7 @@ int skipto = -1;
int layer = 1; // which layer we are editting, either 1 or 2 int layer = 1; // which layer we are editting, either 1 or 2
int layertransparent = B_TRUE; int layertransparent = B_TRUE;
int showlayer3 = B_TRUE;
sprite_t *waypointm = NULL; sprite_t *waypointm = NULL;
@ -511,7 +512,18 @@ int main (int argc, char **argv) {
drawsprites(); drawsprites();
sprintf(tempm, "Transparent layers now %s",layertransparent ? "ON" : "OFF"); sprintf(tempm, "Transparent layers now %s",layertransparent ? "ON" : "OFF");
setstatustext(tempm, &green); 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 if (keys[SDLK_w]) { // set waypoints
@ -1272,6 +1284,9 @@ void draweditortile3(SDL_Surface *where, int x, int y) {
tiletype_t *tt; tiletype_t *tt;
int offset; int offset;
if (!showlayer3) {
return;
}
if ((x < 0) || (y < 0) || (x >= LEVELW) || (y >= LEVELH)) { if ((x < 0) || (y < 0) || (x >= LEVELW) || (y >= LEVELH)) {
return; return;

18
rc.c
View File

@ -10896,8 +10896,11 @@ void swimup(sprite_t *pl) {
} else if (pl == player2) { } else if (pl == player2) {
pnum = 1; pnum = 1;
} else return; // only valid for players } else return; // only valid for players
if (pl->moved & MV_SWIM) {
return;
}
pl->falling = B_FALSE; pl->falling = B_FALSE;
if (!isroofabove(pl)) { if (!isroofabove(pl)) {
// is there water above us too? // is there water above us too?
@ -10912,6 +10915,7 @@ void swimup(sprite_t *pl) {
} }
// if so, swim up // if so, swim up
pl->y -= swimspeed; pl->y -= swimspeed;
pl->moved |= MV_SWIM;
} else { } else {
int whichway; int whichway;
// if not, jump up // if not, jump up
@ -10931,6 +10935,11 @@ void swimup(sprite_t *pl) {
} }
void swimdown(sprite_t *pl) { void swimdown(sprite_t *pl) {
if (pl->moved & MV_SWIM) {
return;
}
pl->falling = B_FALSE; pl->falling = B_FALSE;
if (!isonground(pl)) { if (!isonground(pl)) {
double swimspeed; double swimspeed;
@ -10942,6 +10951,7 @@ void swimdown(sprite_t *pl) {
swimspeed *= 2; swimspeed *= 2;
} }
pl->y += swimspeed; pl->y += swimspeed;
pl->moved |= MV_SWIM;
} }
} }
@ -11636,13 +11646,13 @@ void startgame(void) {
// settings done in addsprite() // settings done in addsprite()
if (player) { if (player) {
int c; int c;
setdefaults(player);
player->permspeed = B_FALSE; player->permspeed = B_FALSE;
player->permbignet = B_FALSE; player->permbignet = B_FALSE;
player->permnumnets = B_FALSE; player->permnumnets = B_FALSE;
player->permmask = B_FALSE; player->permmask = B_FALSE;
player->permarmour = B_FALSE; player->permarmour = B_FALSE;
player->permsticky = B_FALSE; player->permsticky = B_FALSE;
setdefaults(player);
player->numcards = 0; player->numcards = 0;
for (c = 0; c < MAXCARDS; c++) { for (c = 0; c < MAXCARDS; c++) {
player->card[c] = -1; player->card[c] = -1;
@ -11651,13 +11661,13 @@ void startgame(void) {
} }
if (player2) { if (player2) {
int c; int c;
setdefaults(player2);
player2->permspeed = B_FALSE; player2->permspeed = B_FALSE;
player2->permbignet = B_FALSE; player2->permbignet = B_FALSE;
player2->permnumnets = B_FALSE; player2->permnumnets = B_FALSE;
player2->permmask = B_FALSE; player2->permmask = B_FALSE;
player2->permarmour = B_FALSE; player2->permarmour = B_FALSE;
player2->permsticky = B_FALSE; player2->permsticky = B_FALSE;
setdefaults(player2);
player2->numcards = 0; player2->numcards = 0;
for (c = 0; c < MAXCARDS; c++) { for (c = 0; c < MAXCARDS; c++) {
player2->card[c] = -1; player2->card[c] = -1;
@ -11681,11 +11691,13 @@ void startgame(void) {
if (want1up) { if (want1up) {
if (player == NULL) { if (player == NULL) {
player = addsprite(P_PLAYER, 32, 450, "Player 1" ); player = addsprite(P_PLAYER, 32, 450, "Player 1" );
setdefaults(player);
} }
} }
if (want2up) { if (want2up) {
if (player2 == NULL) { if (player2 == NULL) {
player2 = addsprite(P_PLAYER2, 32, 450, "Player 2" ); player2 = addsprite(P_PLAYER2, 32, 450, "Player 2" );
setdefaults(player2);
} }
} }

View File

@ -570,12 +570,20 @@ int loadlevel(int lnum, int wantmonsters) {
if (player == NULL) { if (player == NULL) {
player = addsprite(P_PLAYER, (curlevel->p1x * TILEW) + (TILEW/2), player = addsprite(P_PLAYER, (curlevel->p1x * TILEW) + (TILEW/2),
(curlevel->p1y * TILEH) + TILEH-2 , "Player 1" ); (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 (want2up) {
if (player2 == NULL) { if (player2 == NULL) {
player2 = addsprite(P_PLAYER2, (curlevel->p2x * TILEW) + (TILEW/2), player2 = addsprite(P_PLAYER2, (curlevel->p2x * TILEW) + (TILEW/2),
(curlevel->p2y * TILEH) + TILEH-2 , "Player 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) { void setdefaults(sprite_t *s) {
if (isplayer(s)) { if (isplayer(s)) {
// set permenant powerups based on level // set permenant powerups based on level
if (curlevelnum > 20) { if (curlevelnum > 20) {
s->permspeed = B_TRUE; s->permspeed = B_TRUE;