- [+] when weighing a trampoline down, move sprite down to lowness of

"trampdown" tile.
- [+] check difficulty curve
    - [+] Level 1-17 (mountaineering)
        - [+] move to level 19 due to difficulty.
        - [+] increase hurryup period to 60 seconds
        - [+] 2-9 a lot harder now that planets shoot - move later.
        - [+] sand castle - unintentionally hard to get up. fixed
- [+] don't draw anchor powerup on king cloud 
- [+] don't create magic lamp coins on top of spikes
- [+] redraw egg.png (ant food from king ant)
- [+] draw player 2 death text in correct player colour
- [+] allow player 1 be mrs dwarf - press 1up/2up again on mode
      selection screen
This commit is contained in:
Rob Pearce 2013-08-17 21:53:59 +00:00
parent 22404cae90
commit 9146ee5ab1
15 changed files with 145 additions and 86 deletions

View File

@ -1,6 +1,6 @@
bgfile forest.png bgfile forest.png
bg 0 bg 0
hurryup 30 hurryup 60
help help
Jump in the direction of the logs... Jump in the direction of the logs...
endhelp endhelp

View File

@ -15,8 +15,6 @@ monsters
6 16 7 6 16 7
7 31 11 7 31 11
7 8 11 7 8 11
49 27 21
49 13 21
16 9 8 16 9 8
16 31 8 16 31 8
16 29 8 16 29 8

View File

@ -14,9 +14,9 @@
14,theisland.dat,The Island 14,theisland.dat,The Island
15,beecaverns.dat,Bee Caverns 15,beecaverns.dat,Bee Caverns
16,thehive.dat,The Hive 16,thehive.dat,The Hive
17,mountaineering.dat,Mountaineering
18,backyardone.dat,Backyard One 18,backyardone.dat,Backyard One
19,beepods.dat,Bee Pods 19,beepods.dat,Bee Pods
17,mountaineering.dat,Mountaineering
20,kingrat.dat,King Rat 20,kingrat.dat,King Rat
21,thebeach.dat,The Beach 21,thebeach.dat,The Beach
22,observationpost.dat,Observation Post 22,observationpost.dat,Observation Post
@ -26,7 +26,6 @@
26,sandbars.dat,Sand Bars 26,sandbars.dat,Sand Bars
27,fishbowls.dat,Fishbowls 27,fishbowls.dat,Fishbowls
28,twistylittlepassages.dat,Twisty Little Passages 28,twistylittlepassages.dat,Twisty Little Passages
29,loopyplants.dat,Loopy Plants
30,divingpool.dat,Diving Pool 30,divingpool.dat,Diving Pool
31,portraitgallery1.dat,Portrait Gallery #1 31,portraitgallery1.dat,Portrait Gallery #1
32,thechimney.dat,The Chimney 32,thechimney.dat,The Chimney
@ -34,6 +33,7 @@
34,frogs.dat,Frogs 34,frogs.dat,Frogs
35,sandcastle.dat,Sand Castle 35,sandcastle.dat,Sand Castle
36,divideandconquer.dat,Divide and Conquer 36,divideandconquer.dat,Divide and Conquer
29,loopyplants.dat,Loopy Plants
37,bewaretherapids.dat,Beware the rapids! 37,bewaretherapids.dat,Beware the rapids!
38,bunkers.dat,Bunkers 38,bunkers.dat,Bunkers
39,lookoutabove.dat,Look out above... 39,lookoutabove.dat,Look out above...
@ -100,4 +100,4 @@
100,kingcat.dat,King Cat 100,kingcat.dat,King Cat
101,theendsofar.dat,THE END SO FAR 101,theendsofar.dat,THE END SO FAR
102,testlevel.dat,TEST LEVEL 102,testlevel.dat,TEST LEVEL
101,intro.dat,INTRO 101,intro.dat,Rat Catcher Level Editor v0.665

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
data/sprites/fireup1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

BIN
data/sprites/fireup2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

BIN
data/sprites/fireup3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

BIN
data/sprites/fireup4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

2
defs.h
View File

@ -1186,7 +1186,7 @@ extern char *deathtext[];
extern char *bifftext[]; extern char *bifftext[];
extern spriteinfo_t spriteinfo[]; extern spriteinfo_t spriteinfo[];
extern int want1up,want2up; extern int want1up,want2up,swapplayers;
extern int gotcard; extern int gotcard;
extern int curcard; extern int curcard;

View File

@ -12,6 +12,7 @@ int curlevelnum;
int maxlevid; int maxlevid;
int want1up,want2up; int want1up,want2up;
int swapplayers;
int globpowerup; int globpowerup;

151
rc.c
View File

@ -103,6 +103,8 @@ int paused;
int wantframerate = B_FALSE; int wantframerate = B_FALSE;
int initialswapplayers = B_FALSE;
int fps; int fps;
int fpscount; int fpscount;
@ -271,6 +273,9 @@ int main (int argc, char **argv) {
} else if (!strcmp(argv[i], "-as")) { } else if (!strcmp(argv[i], "-as")) {
printf("Automatic screenshot mode activated.\n"); printf("Automatic screenshot mode activated.\n");
autoshot = B_TRUE; autoshot = B_TRUE;
} else if (!strcmp(argv[i], "-s")) {
printf("Swapplayers mode activated.\n");
initialswapplayers = B_TRUE;
} else if (!strcmp(argv[i], "-t")) { } else if (!strcmp(argv[i], "-t")) {
printf("Tutorial mode activated.\n"); printf("Tutorial mode activated.\n");
showhelp = B_TRUE; showhelp = B_TRUE;
@ -1970,9 +1975,9 @@ void die(sprite_t *s) {
// lose armour // lose armour
s->armour = B_FALSE; s->armour = B_FALSE;
if (s == player) { if (s == player) {
s->id = P_PLAYER; s->id = swapplayers ? P_PLAYER2 : P_PLAYER;
} else { } else {
s->id = P_PLAYER2; s->id = swapplayers ? P_PLAYER : P_PLAYER2;
} }
// become invulnerable temporarily // become invulnerable temporarily
makeinvuln(s); makeinvuln(s);
@ -2052,7 +2057,7 @@ void die(sprite_t *s) {
// draw text // draw text
tnum = rand() % MAXDEATHTEXT; tnum = rand() % MAXDEATHTEXT;
addoutlinetext(s->x,s->y,TEXTSIZE_DEATH,deathtext[tnum],&red,&black,DIEDELAY, TT_NORM); addoutlinetext(s->x,s->y,TEXTSIZE_DEATH,deathtext[tnum],getptextcol(s),&black,DIEDELAY, TT_NORM);
/* release anything we've caught */ /* release anything we've caught */
for (s2 = sprite; s2 ; s2 = s2->next) { for (s2 = sprite; s2 ; s2 = s2->next) {
@ -2879,8 +2884,6 @@ int movesprite(sprite_t *s) {
} }
} }
if (s->caughtby) { if (s->caughtby) {
if (s->caughtby->slamming) { if (s->caughtby->slamming) {
/* */ /* */
@ -6879,7 +6882,8 @@ void dotileeffects(sprite_t *s) {
drawtile(temps, s->trampx, s->trampy); drawtile(temps, s->trampx, s->trampy);
} }
} else { } else {
tiletype_t *temptile; tiletype_t *temptile, *tt;
int xoff;
// remember we were on it so it can release // remember we were on it so it can release
s->ontramp = B_TRUE; s->ontramp = B_TRUE;
s->trampx = tilex; s->trampx = tilex;
@ -6899,6 +6903,11 @@ void dotileeffects(sprite_t *s) {
curlevel->map2[tiley*LEVELW+tilex] = getuniq(T_TRAMPDOWN); curlevel->map2[tiley*LEVELW+tilex] = getuniq(T_TRAMPDOWN);
} }
drawtile(temps, tilex, tiley); drawtile(temps, tilex, tiley);
// move player to new trampoline height
tt = gettile(T_TRAMPDOWN);
xoff = s->x - (tilex*TILEW);
s->y = (tiley * TILEH) + tt->lowness[xoff];
} }
} }
finished = B_TRUE; finished = B_TRUE;
@ -9854,7 +9863,7 @@ int dofruiteffect(sprite_t *pp, sprite_t *s) {
for (xx = 0; xx < LEVELW; xx++) { for (xx = 0; xx < LEVELW; xx++) {
for (yy = 0; yy < (LEVELH-1); yy++) { for (yy = 0; yy < (LEVELH-1); yy++) {
tt = gettileat(xx*TILEW,yy*TILEH, NULL,NULL); tt = gettileat(xx*TILEW,yy*TILEH, NULL,NULL);
if (!tt->solid) { if (!tt->solid && !tt->spikes) {
// check tile below // check tile below
tt = gettileat(xx*TILEW,(yy+1)*TILEH, NULL,NULL); tt = gettileat(xx*TILEW,(yy+1)*TILEH, NULL,NULL);
if (tt->id == T_LAND) { if (tt->id == T_LAND) {
@ -10262,7 +10271,7 @@ int dofruiteffect(sprite_t *pp, sprite_t *s) {
newc->img = imageset[s->timer1].img[F_WALK1]; newc->img = imageset[s->timer1].img[F_WALK1];
} else { } else {
// is this possible?! // is this possible?!
addoutlinetext(s->x,s->y - s->img->h/2, TEXTSIZE_POINTS, "Full cards!",&red,&black,POINTSDELAY,TT_NORM); addoutlinetext(s->x,s->y - s->img->h/2, TEXTSIZE_POINTS, "Full cards!",getptextcol(s),&black,POINTSDELAY,TT_NORM);
} }
return B_TRUE; return B_TRUE;
} else if (isflower(s->id)) { } else if (isflower(s->id)) {
@ -10324,6 +10333,8 @@ void usage(void) {
printf(" -hp xx Connect to hiscore_server on port xx.\n"); printf(" -hp xx Connect to hiscore_server on port xx.\n");
printf(" -js Joystick test mode.\n"); printf(" -js Joystick test mode.\n");
printf(" -as Auto screenshot mode (dumps to /tmp/levelxx.bmp).\n"); printf(" -as Auto screenshot mode (dumps to /tmp/levelxx.bmp).\n");
printf(" -t Enable tutorial (ie. help text).\n");
printf(" -s Enable swapplayers mode (ie. player 1 is Mrs Dwarf)\n");
printf("\n"); printf("\n");
} }
@ -12084,7 +12095,7 @@ void handleinput(void) {
// toggle fullscreen // toggle fullscreen
if (keydown(0, SDLK_F3)) { if (keydown(0, SDLK_F3) || keydown(0, SDLK_BACKSLASH)) {
if (toggletimer == 0) { if (toggletimer == 0) {
// always pause first // always pause first
paused = B_TRUE; paused = B_TRUE;
@ -12288,7 +12299,7 @@ if (cheat) {
py = (curlevel->p1y * TILEH) + TILEH-2; py = (curlevel->p1y * TILEH) + TILEH-2;
want1up = B_TRUE; want1up = B_TRUE;
player = addsprite(P_PLAYER, px, py, "Player 1" ); player = addsprite(swapplayers ? P_PLAYER2 : P_PLAYER, px, py, "Player 1" );
setdefaults(player); setdefaults(player);
puffin(-1, px, py-TILEH, "nothing", 0); puffin(-1, px, py-TILEH, "nothing", 0);
puffin(-1, px, py, "nothing", 0); puffin(-1, px, py, "nothing", 0);
@ -12298,11 +12309,11 @@ if (cheat) {
if (gamemode == GM_EASY) { if (gamemode == GM_EASY) {
player->permarmour = B_TRUE; player->permarmour = B_TRUE;
player->armour = B_TRUE; player->armour = B_TRUE;
player->id = P_ARMOUR; player->id = swapplayers ? P_ARMOUR2 : P_ARMOUR;
} else { } else {
player->permarmour = B_FALSE; player->permarmour = B_FALSE;
player->armour = B_FALSE; player->armour = B_FALSE;
player->id = P_PLAYER; player->id = swapplayers ? P_PLAYER2 : P_PLAYER;
} }
player->lives = INITPLAYERLIVES; player->lives = INITPLAYERLIVES;
@ -12341,7 +12352,7 @@ if (cheat) {
py = (curlevel->p2y * TILEH) + TILEH-2; py = (curlevel->p2y * TILEH) + TILEH-2;
want1up = B_TRUE; want1up = B_TRUE;
player2 = addsprite(P_PLAYER2, px, py, "Player 2" ); player2 = addsprite(swapplayers ? P_PLAYER : P_PLAYER2, px, py, "Player 2" );
setdefaults(player2); setdefaults(player2);
puffin(-1, px, py-TILEH, "nothing", 0); puffin(-1, px, py-TILEH, "nothing", 0);
puffin(-1, px, py, "nothing", 0); puffin(-1, px, py, "nothing", 0);
@ -12351,11 +12362,11 @@ if (cheat) {
if (gamemode == GM_EASY) { if (gamemode == GM_EASY) {
player2->permarmour = B_TRUE; player2->permarmour = B_TRUE;
player2->armour = B_TRUE; player2->armour = B_TRUE;
player2->id = P_ARMOUR2; player2->id = swapplayers ? P_ARMOUR : P_ARMOUR2;
} else { } else {
player2->permarmour = B_FALSE; player2->permarmour = B_FALSE;
player2->armour = B_FALSE; player2->armour = B_FALSE;
player2->id = P_PLAYER2; player2->id = swapplayers ? P_PLAYER : P_PLAYER2;
} }
player2->lives = INITPLAYERLIVES; player2->lives = INITPLAYERLIVES;
@ -12766,6 +12777,7 @@ void dotitlescreen(void) {
SDL_Surface *cointext, *text, *text2, *easy, *norm, *ver; SDL_Surface *cointext, *text, *text2, *easy, *norm, *ver;
SDL_Surface *help, *helpon, *helpoff; SDL_Surface *help, *helpon, *helpoff;
SDL_Surface *p1ready,*p2ready; SDL_Surface *p1ready,*p2ready;
SDL_Surface *p1readyalt,*p2readyalt;
SDL_Surface *ts; SDL_Surface *ts;
SDL_Event event; SDL_Event event;
SDL_Rect area; SDL_Rect area;
@ -12781,6 +12793,7 @@ void dotitlescreen(void) {
// clear all sprites!! // clear all sprites!!
want1up = B_FALSE; want1up = B_FALSE;
want2up = B_FALSE; want2up = B_FALSE;
swapplayers = initialswapplayers;
while (sprite) { while (sprite) {
killsprite(sprite); killsprite(sprite);
@ -12815,6 +12828,17 @@ void dotitlescreen(void) {
printf("cannot load p1 ready img (%s)\n",tempst); printf("cannot load p1 ready img (%s)\n",tempst);
exit(1); exit(1);
} }
sprintf(tempst, "%s/sprites/p1ready_alt.png",datadir);
ts = IMG_Load(tempst);
SDL_SetColorKey(ts, SDL_RLEACCEL, 0);
p1readyalt = SDL_DisplayFormat(ts);
SDL_FreeSurface(ts);
if (!p1readyalt) {
printf("cannot load p1 ready alt img (%s)\n",tempst);
exit(1);
}
sprintf(tempst, "%s/sprites/p2ready.png",datadir); sprintf(tempst, "%s/sprites/p2ready.png",datadir);
ts = IMG_Load(tempst); ts = IMG_Load(tempst);
SDL_SetColorKey(ts, SDL_RLEACCEL, 0); SDL_SetColorKey(ts, SDL_RLEACCEL, 0);
@ -12825,6 +12849,16 @@ void dotitlescreen(void) {
exit(1); exit(1);
} }
sprintf(tempst, "%s/sprites/p2ready_alt.png",datadir);
ts = IMG_Load(tempst);
SDL_SetColorKey(ts, SDL_RLEACCEL, 0);
p2readyalt = SDL_DisplayFormat(ts);
SDL_FreeSurface(ts);
if (!p2readyalt) {
printf("cannot load p2 ready alt img (%s)\n",tempst);
exit(1);
}
// set up text // set up text
cointext = TTF_RenderText_Solid(font[TEXTSIZE_TITLE], "Insert Coin", white); cointext = TTF_RenderText_Solid(font[TEXTSIZE_TITLE], "Insert Coin", white);
text = TTF_RenderText_Solid(font[TEXTSIZE_TITLE], "Press 1UP or 2UP to start", red); text = TTF_RenderText_Solid(font[TEXTSIZE_TITLE], "Press 1UP or 2UP to start", red);
@ -12950,7 +12984,7 @@ void dotitlescreen(void) {
area.y += (sin(bouncetimer * (M_PI/180)) * 20); area.y += (sin(bouncetimer * (M_PI/180)) * 20);
SDL_BlitSurface(p1ready, NULL, screen, &area); SDL_BlitSurface(swapplayers ? p1readyalt : p1ready, NULL, screen, &area);
} }
if (want2up) { if (want2up) {
area.x = 640 - p2ready->w - 10; area.x = 640 - p2ready->w - 10;
@ -12958,7 +12992,7 @@ void dotitlescreen(void) {
area.y -= (sin(bouncetimer * (M_PI/180)) * 20); area.y -= (sin(bouncetimer * (M_PI/180)) * 20);
SDL_BlitSurface(p2ready, NULL, screen, &area); SDL_BlitSurface(swapplayers ? p2readyalt : p2ready, NULL, screen, &area);
} }
@ -13208,13 +13242,13 @@ void startgame(void) {
// allocate player // allocate player
if (want1up) { if (want1up) {
if (player == NULL) { if (player == NULL) {
player = addsprite(P_PLAYER, 32, 450, "Player 1" ); player = addsprite(swapplayers ? P_PLAYER2 : P_PLAYER, 32, 450, "Player 1" );
setdefaults(player); setdefaults(player);
} }
} }
if (want2up) { if (want2up) {
if (player2 == NULL) { if (player2 == NULL) {
player2 = addsprite(P_PLAYER2, 32, 450, "Player 2" ); player2 = addsprite(swapplayers ? P_PLAYER : P_PLAYER2, 32, 450, "Player 2" );
setdefaults(player2); setdefaults(player2);
} }
} }
@ -13227,11 +13261,11 @@ void startgame(void) {
if (gamemode == GM_EASY) { if (gamemode == GM_EASY) {
player->permarmour = B_TRUE; player->permarmour = B_TRUE;
player->armour = B_TRUE; player->armour = B_TRUE;
player->id = P_ARMOUR; player->id = swapplayers ? P_ARMOUR2 : P_ARMOUR;
} else { } else {
player->permarmour = B_FALSE; player->permarmour = B_FALSE;
player->armour = B_FALSE; player->armour = B_FALSE;
player->id = P_PLAYER; player->id = swapplayers ? P_PLAYER2 : P_PLAYER;
} }
player->lives = INITPLAYERLIVES; player->lives = INITPLAYERLIVES;
} }
@ -13242,11 +13276,11 @@ void startgame(void) {
if (gamemode == GM_EASY) { if (gamemode == GM_EASY) {
player2->permarmour = B_TRUE; player2->permarmour = B_TRUE;
player2->armour = B_TRUE; player2->armour = B_TRUE;
player2->id = P_ARMOUR2; player2->id = swapplayers ? P_ARMOUR : P_ARMOUR2;
} else { } else {
player2->permarmour = B_FALSE; player2->permarmour = B_FALSE;
player2->armour = B_FALSE; player2->armour = B_FALSE;
player2->id = P_PLAYER2; player2->id = swapplayers ? P_PLAYER : P_PLAYER2;
} }
player2->lives = INITPLAYERLIVES; player2->lives = INITPLAYERLIVES;
} }
@ -13355,26 +13389,28 @@ void handletitleinput(int whichplayer, int key) {
gamemode = GM_NORM; gamemode = GM_NORM;
} }
} else if ((key == SDLK_1) || (key == SDLK_2) || (key == SDLK_RETURN)) { } else if ((key == SDLK_1) || (key == SDLK_2) || (key == SDLK_RETURN)) {
int usecredit = B_FALSE;
if (credits > 0) { if (credits > 0) {
int donesomething = B_FALSE;
if ((key == SDLK_1) || (key == SDLK_RETURN)) { if ((key == SDLK_1) || (key == SDLK_RETURN)) {
if (!want1up) { if (!want1up) {
// add player 1
want1up = B_TRUE; want1up = B_TRUE;
donesomething = B_TRUE; usecredit = B_TRUE;
} }
} else if (key == SDLK_2) { } else if (key == SDLK_2) {
if (!want2up) { if (!want2up) {
// add player 2
want2up = B_TRUE; want2up = B_TRUE;
donesomething = B_TRUE; usecredit = B_TRUE;
} }
} }
}
if (donesomething) { if (usecredit) {
playfx(FX_EXTRALIFE); playfx(FX_EXTRALIFE);
credits--; credits--;
titlemode = TS_SELECTMODE; titlemode = TS_SELECTMODE;
blinkspeed = 5; blinkspeed = 5;
}
} }
} }
} else if (titlemode == TS_SELECTMODE) { } else if (titlemode == TS_SELECTMODE) {
@ -13392,24 +13428,30 @@ void handletitleinput(int whichplayer, int key) {
titledone = B_TRUE; titledone = B_TRUE;
} else if ((key == SDLK_1) || (key == SDLK_2) || (key == SDLK_RETURN)) { } else if ((key == SDLK_1) || (key == SDLK_2) || (key == SDLK_RETURN)) {
// another player joining // another player joining
if (credits > 0) { int usecredit = B_FALSE;
int donesomething = B_FALSE; if ((key == SDLK_1) || (key == SDLK_RETURN)) {
if ((key == SDLK_1) || (key == SDLK_RETURN)) { if (want1up) {
if (!want1up) { // toggle players
want1up = B_TRUE; if (swapplayers) swapplayers = B_FALSE;
donesomething = B_TRUE; else swapplayers = B_TRUE;
} } else if (credits > 0) {
} else if (key == SDLK_2) { want1up = B_TRUE;
if (!want2up) { usecredit = B_TRUE;
want2up = B_TRUE;
donesomething = B_TRUE;
}
} }
if (donesomething) { } else if (key == SDLK_2) {
playfx(FX_EXTRALIFE); if (want2up) {
credits--; // toggle players
if (swapplayers) swapplayers = B_FALSE;
else swapplayers = B_TRUE;
} else {
want2up = B_TRUE;
usecredit = B_TRUE;
} }
} }
if (usecredit) {
playfx(FX_EXTRALIFE);
credits--;
}
} else if ((key == SDLK_5) || (key == SDLK_6)) { } else if ((key == SDLK_5) || (key == SDLK_6)) {
addcredit(); addcredit();
} }
@ -14644,10 +14686,10 @@ void dointroseq(void) {
} }
} else if (introstate == IS_YUM) { } else if (introstate == IS_YUM) {
if (player) { if (player) {
addoutlinetext(player->x,player->y - (player->img->h*1.5),TEXTSIZE_YUM,"Yum!",&red,&black,YUMDELAY, TT_INTROTEXT); addoutlinetext(player->x,player->y - (player->img->h*1.5),TEXTSIZE_YUM,"Yum!",getptextcol(player), &black,YUMDELAY, TT_INTROTEXT);
} }
if (player2) { if (player2) {
addoutlinetext(player2->x,player2->y - (player2->img->h*1.5),TEXTSIZE_YUM,"Yum!",&purple,&black,YUMDELAY, TT_INTROTEXT); addoutlinetext(player2->x,player2->y - (player2->img->h*1.5),TEXTSIZE_YUM,"Yum!",getptextcol(player2),&black,YUMDELAY, TT_INTROTEXT);
} }
introstate = IS_YUMWAIT; // exits when yum text is gone introstate = IS_YUMWAIT; // exits when yum text is gone
@ -14966,3 +15008,14 @@ void incfruittype(void) {
curfruittype = 0; curfruittype = 0;
} }
} }
SDL_Color *getptextcol(sprite_t *s) {
if (s == player) {
if (swapplayers) return &purple;
else return &red;
} else { // ie. player 2
if (swapplayers) return &red;
else return &purple;
}
return &red;
}

1
rc.h
View File

@ -147,3 +147,4 @@ int savebmp(SDL_Surface *which);
void melttile(int tx,int ty, int howlong); void melttile(int tx,int ty, int howlong);
void selectspell(sprite_t *s); void selectspell(sprite_t *s);
void incfruittype(void); void incfruittype(void);
SDL_Color *getptextcol(sprite_t *s);

View File

@ -2652,7 +2652,7 @@ void drawsprite(sprite_t *s) {
// anchor // anchor
if (globpowerup == PW_ANCHOR) { if (globpowerup == PW_ANCHOR) {
if (ismonster(s->id) && !s->caughtby && !s->dead) { if (ismonster(s->id) && (s->id != P_BLACKCLOUD) && !s->caughtby && !s->dead) {
SDL_Rect newarea; SDL_Rect newarea;
newarea = area; newarea = area;
newarea.y += (s->img->h / 3); newarea.y += (s->img->h / 3);
@ -2660,8 +2660,6 @@ void drawsprite(sprite_t *s) {
} }
} }
/* caughtby lines */ /* caughtby lines */
if ((s->caughtby) && (s->caughtstate == 2)){ if ((s->caughtby) && (s->caughtstate == 2)){
// only if we're on the screen // only if we're on the screen
@ -3906,7 +3904,7 @@ void setfruitinfo(void) {
setinfo(P_PILL, "Pill", "Eating this pill will cause you to enter a hyperactive state, moving at four times your standard speed!", "pill.png"); setinfo(P_PILL, "Pill", "Eating this pill will cause you to enter a hyperactive state, moving at four times your standard speed!", "pill.png");
setinfo(P_RAYGUN, "Ray Gun", "Alien in origin, the ray gun contains enough charge for five shots of burning plasma.", "raygun.png"); setinfo(P_RAYGUN, "Ray Gun", "Alien in origin, the ray gun contains enough charge for five shots of burning plasma.", "raygun.png");
setinfo(P_TOPHAT, "Top Hat", "Players wearing the top hat will find that every item which appears will now be a power-up!", "tophat.png"); setinfo(P_TOPHAT, "Top Hat", "Players wearing the top hat will find that every item which appears is now a power-up!", "tophat.png");
setinfo(P_LAMP, "Magic Lamp", "The magic lamp shifts you into an alternate dimension filled with gold! Collect it all for a kingly bonus...", "lamp.png"); setinfo(P_LAMP, "Magic Lamp", "The magic lamp shifts you into an alternate dimension filled with gold! Collect it all for a kingly bonus...", "lamp.png");
setinfo(P_BOXING, "Boxing Glove", "Your net will punch monsters, killing them instantly.", "boxing.png"); setinfo(P_BOXING, "Boxing Glove", "Your net will punch monsters, killing them instantly.", "boxing.png");
@ -3926,63 +3924,62 @@ void setfruitinfo(void) {
setinfo(P_STARPOWERUP, "Shuriken", "Shoots deadly razor blades in all directions.", "star.png"); setinfo(P_STARPOWERUP, "Shuriken", "Shoots deadly razor blades in all directions.", "star.png");
setinfo(P_LIFE, "Life", "Awards the player an extra life.", "extralife.png"); setinfo(P_LIFE, "Life", "Awards the player an extra life.", "extralife.png");
setinfo(P_UFO, "UFO", "Calls in a powerful meteor strike!", "ufo.png"); setinfo(P_UFO, "UFO", "Calls in a powerful meteor strike!", "ufo.png");
setinfo(P_TAP, "Tap", "The leaky tap will flood the level with water for 20 seconds, allowing you to access hard to reach areas.", "tap.png"); setinfo(P_TAP, "Leaky Tap", "The leaky tap will flood the level with water for 20 seconds, allowing you to access hard to reach areas.", "tap.png");
setinfo(P_ACCORDION, "Accordion", "Makes your nets enormous", "accordion.png"); setinfo(P_ACCORDION, "Accordion", "Makes your nets enormous.", "accordion.png");
setinfo(P_GUN, "Gunner", "Temporarily equips you with a super powerful machine gun!", "gunner.png"); setinfo(P_GUN, "Gunner", "Temporarily equips you with deadly machine gun!", "gunner.png");
setinfo(P_GNOME, "Garden Gnome", "This tricky little gnome has rigged explosive devices to all flowers on the level - when collected he will detonate them!", "gnome.png"); setinfo(P_GNOME, "Garden Gnome", "This tricky little gnome has rigged explosive devices to all flowers on the level - when collected he will detonate them!", "gnome.png");
setinfo(P_WAND, "Magic Wand", "A wave of the magic wand will magically polymorph all monsters into weaker ones. Anything which can't become weaker will be instantly destroyed!", "wand.png"); setinfo(P_WAND, "Magic Wand", "A wave of the magic wand will magically polymorph all monsters into weaker ones. Anything which can't become weaker will be instantly destroyed!", "wand.png");
setinfo(P_WHISTLE, "Whistle", "Produces an extremely loud, shrill whistling noise which wakes the black cloud of doom! In its angered state, the black cloud will slaughter both friend and foe alike.", "whistle.png"); setinfo(P_WHISTLE, "Whistle", "Produces an extremely loud, shrill whistling noise which wakes the black cloud of doom! In its angered state, the black cloud will slaughter both friend and foe alike.", "whistle.png");
setinfo(P_CANDLE, "Candle", "Once collected, the candle will cause all enemy corpses to burst into flames, igniting any other enemy which they touch.", "candle.png"); setinfo(P_CANDLE, "Candle", "Once collected, the candle will cause all enemy corpses to burst into flames, igniting any other enemy which they touch.", "candle.png");
setinfo(P_ANCHOR, "Anchor", "The extremely heavy anchor will weigh down enemies, preventing them from jumping or flying.", "anchor.png"); setinfo(P_ANCHOR, "Anchor", "The extremely heavy anchor will weigh down enemies, preventing them from jumping or flying.", "anchor.png");
setinfo(P_MAGNET, "Magnet", "Collecting this powerup will align the magnetic forces of the earth in your favour, attracting all nearby fruits towards you.", "magnet.png"); setinfo(P_MAGNET, "Magnet", "Collecting this powerup will align the magnetic forces of the earth in your favour, attracting all nearby fruits towards you.", "magnet.png");
setinfo(P_BADMAGNET, "Red Skull", "This skull curses you and will repel fruits away from you, denying you access to them!", "badmagnet.png"); setinfo(P_BADMAGNET, "Red Skull", "This skull curses you and will repel fruits away from you, denying you access to tasty treats!", "badmagnet.png");
setinfo(P_JETPACK, "Jetpack", "For the remainder of the current level, the jetpack's thrust will add to your jumping ability!", "jetpack.png"); setinfo(P_JETPACK, "Jetpack", "For the remainder of the current level, the jetpack's thrust will add to your jumping ability.", "jetpack.png");
setinfo(P_UMBRELLA, "Umbrella", "Slows your descent, giving you more time to contemplate your rat eradication quest. Activate this useful item by holding UP while falling.", "umbrella.png"); setinfo(P_UMBRELLA, "Umbrella", "Slows your descent, giving you more time to contemplate your rat eradication quest. Activate this useful item by holding UP while falling.", "umbrella.png");
setinfo(P_CAMERA, "Camera", "Creates a bright flash of light, blinding all enemies.", "camera.png"); setinfo(P_CAMERA, "Camera", "Creates a bright flash of light, blinding all enemies.", "camera.png");
setinfo(P_ZAPPOWERUP, "Bug Zapper", "Zaps nearby enemies with miniature bolts of lightning", "zapper.png"); setinfo(P_ZAPPOWERUP, "Bug Zapper", "Floats around your head and zaps nearby enemies with miniature bolts of lightning.", "zapper.png");
setinfo(P_SKULL, "Green Skull", "Avoid these at all costs! The green skull will shrink your net to miniscule proportions for the remainder of the level.", "skull.png"); setinfo(P_SKULL, "Green Skull", "Avoid these at all costs! The green skull will shrink your net to miniscule proportions for the remainder of the level.", "skull.png");
setinfo(P_CLOVER, "4-Leaf Clover", "Increases your luck...", "clover.png"); setinfo(P_CLOVER, "4-Leaf Clover", "Increases your luck...", "clover.png");
setinfo(P_RANDOM, "Random", "Gives you a random effect...", "random.png"); setinfo(P_RANDOM, "Random", "Gives you a random effect...", "random.png");
setinfo(P_PLAYER, "Mr. Dwarf", "Mr. Dwarf is currently highly disgruntled due to repeated burglaries of his hard-earned dinner. After one theft too many, he is now out for revenge! When encased in his shining suit of golden armour, Mr. Dwarf is bestowed with incredible powers of endurance, and is able to withstand any earthly threat. Once once, though.", "pdwarf.png"); setinfo(P_PLAYER, "Mr. Dwarf", "Mr. Dwarf is currently highly disgruntled due to repeated burglaries of his hard-earned dinner. After one theft too many, he is now out for revenge! When encased in his shining suit of golden armour, Mr. Dwarf is bestowed with incredible powers of endurance, and is able to withstand any earthly threat. Once.", "pdwarf.png");
setinfo(P_PLAYER2, "Mrs. Dwarf", "Mrs. Dwarf, being the loyal partner that she is, has become equally aggrieved by the constant re-appropriation of culinary treats and has joined Mr. Dwarf on his quest to end the rat menace forever. Her more feminine armour no less effective, just slightly more visually appealing with its convenient openings for lipstick and hair!", "p2dwarf.png"); setinfo(P_PLAYER2, "Mrs. Dwarf", "Mrs. Dwarf, being the loyal partner that she is, has become equally aggrieved by the constant re-appropriation of culinary treats and has joined Mr. Dwarf on his quest to end the rat menace forever. Her feminine armour is also slightly more visually appealing due to its convenient openings for lipstick and hair.", "p2dwarf.png");
setinfo(P_ARMOUR, "Armoured Mr. Dwarf", "", "armor.png"); setinfo(P_ARMOUR, "Armoured Mr. Dwarf", "", "armor.png");
setinfo(P_ARMOUR2, "Armoured Mrs. Dwarf", "", "armor2.png"); setinfo(P_ARMOUR2, "Armoured Mrs. Dwarf", "", "armor2.png");
setinfo(P_RAT, "Rat", "The weakest of the monsters, the rat will simply walk back and forth waiting to be caught. Beware an angry rat though, as it will try to fall or jump in order to catch you!", "rat.png"); setinfo(P_RAT, "Rat", "The weakest of the monsters, the rat will simply walk back and forth waiting to be caught. Beware an angry rat though, as it will try to fall or jump in order to catch you!", "rat.png");
setinfo(P_BEE, "Bee", "Bees, while still relatively weak, gain an advantage over rats in that they are able to fly. They move in a simple diagonal pattern, changing direction when they get near a wall or spikes. Bees will speed up when angry.", "newbee.png"); setinfo(P_BEE, "Bee", "Bees, while still relatively weak, gain an advantage over rats in that they are able to fly. They move in a simple diagonal pattern, changing direction when they get near a wall or spikes. Bees will speed up when angry.", "newbee.png");
setinfo(P_FISH, "Pirahna", "These fish at at home in the water and unhampered by slowness while swimming.", "fish.png"); setinfo(P_FISH, "Pirahna", "These deadly fish are at home in the water and unhampered by slowness while swimming.", "fish.png");
setinfo(P_SPIDER, "Redback", "Redback spiders will lurk quietly on the ceiling, crawling back and forth. If they notice a player nearby however they will swiftly pounce down onto their prey!", "spider.png"); setinfo(P_SPIDER, "Redback", "Redback spiders lurk quietly on the ceiling, crawling back and forth. If they notice a player nearby, they will swiftly pounce down onto their prey.", "spider.png");
setinfo(P_WSPIDER, "Whitetail", "Whitetail spiders are more intelligent than other monsters - they are aware of nearby players and will use the landscape to track them down!", "whitespider.png"); setinfo(P_WSPIDER, "Whitetail", "Whitetail spiders are more intelligent than other monsters - they are aware of nearby players and will use the landscape to track them down!", "whitespider.png");
setinfo(P_BAT, "Bat", "The bat moves in a straight line until it hits a wall. Although simplistic in their movement, bats have the ability to fire a burst of sonar to take out an unwary player!", "bat.png"); setinfo(P_BAT, "Bat", "The bat moves in a straight line until it hits a wall. Although simplistic in their movement, bats have the ability to emit a burst of sonar towards unwary players.", "bat.png");
setinfo(P_FROG, "Frog", "Green frogs will continually bounce around, making them more difficult to catch. They are also excellent swimmers.", "frog.png"); setinfo(P_FROG, "Frog", "Green frogs continually bounce around, making them quite difficult to catch. Unlike their other video game counterparts, they are also excellent swimmers.", "frog.png");
setinfo(P_ANT1, "Worker Ant", "Worker ants are relatively easy to avoid, but when fed will quickly grow into more dangerous soldier ants.", "ant1.png"); setinfo(P_ANT1, "Worker Ant", "Worker ants are relatively easy to avoid, but when fed will quickly grow into more dangerous soldier ants.", "ant1.png");
setinfo(P_ANT2, "Soldier Ant", "Soldiers move faster and are more intelligent than their worker siblings. In addition, with just a little food they will become queens.", "ant2.png"); setinfo(P_ANT2, "Soldier Ant", "Soldiers move faster and are more intelligent than their worker siblings. In addition, with just a little food they will become queens.", "ant2.png");
setinfo(P_ANT3, "Queen Ant", "After an ant has eaten enough, they become a Queen. Queens are just as fast as soldiers and can also breath fire. Furthermore, they are only one meal away from spawning additional ants!", "ant3.png"); setinfo(P_ANT3, "Queen Ant", "After an ant has eaten enough, it becomes a Queen. Queens are just as fast as soldiers and can also breath fire. If that wasn't enough, they are also only one meal away from spawning an additional ant!", "ant3.png");
setinfo(P_SNAKE, "Snake", "The snake moves in a similar fashion to the rat with one important exception - upon seeing a player they will spit a glob of deadly venom at them!", "snake.png"); setinfo(P_SNAKE, "Snake", "The snake moves in a similar fashion to the rat with one important exception - upon seeing a player it will spit a glob of deadly venom in their direction.", "snake.png");
setinfo(P_FLY, "Fly", "Annoying pests at the best of times, flies pose additional danger to dwarves. They fly around more erratically than bees and after landing can scurry quickly back and forth.", "fly.png"); setinfo(P_FLY, "Fly", "Annoying pests at the best of times, flies pose additional danger to dwarves. They move around more erratically than bees and after landing can scurry quickly back and forth.", "fly.png");
setinfo(P_TICK, "Tick", "The tick is small but intelligent. Even in its regular placid state it will move in the same manner as an angry rat. Because of their small size, they are also difficult to target with a slam.", "tick.png");
setinfo(P_TICK, "Tick", "The tick is small but intelligent. Even in its regular placid state it will move in the same manner as an angry rat. Because of their small size, they are also difficult to target with a slam!", "tick.png"); setinfo(P_PLANT, "Plant", "Evil venus fly trap plants lie in wait and devour any player foolish enough to wander into their clutches. They also belch red-hot balls of fire at anything above them.", "plant.png");
setinfo(P_PLANT, "Plant", "Evil venus fly trap plants will lie in wait and devour any player foolish enough to wander into their clutches.", "plant.png");
setinfo(P_BLACKCLOUD, "Cloud of Doom", "This unkillable cloud will appear if you spend too much time on one level. Beware, as the only way to defeat the cloud of doom is to complete the level before it grows too large to handle!", "cloud.png"); setinfo(P_BLACKCLOUD, "Cloud of Doom", "This unkillable cloud will appear if you spend too much time on one level. Beware, as the only way to defeat the cloud of doom is to complete the level before it grows too large to handle!", "cloud.png");
setinfo(P_KINGRAT, "King Rat", "This mighty creature is the ruler of the rats, and impervious to the player's net. It can only be harmed by slamming another monster into it! King Rat will roam the level searching for a player, and upon spotting them will charge at high speed.", "kingrat.png"); setinfo(P_KINGRAT, "King Rat", "This mighty creature is the ruler of the rats, and impervious to the player's net. It can only be harmed by slamming another monster into it. King Rat will roam the level searching for a player, and upon spotting one will charge at high speed.", "kingrat.png");
setinfo(P_KINGSNAIL, "King Snail", "The absolute ruler of the snail kingdom is far too large and heavy to catch in a net. In addition, its shell provides protection against all attacks, leaving only its head vulnerable. While King Snail is too proud to chase down enemies itself, it can use its snail army to destroy its foes.", "kingsnail.png"); setinfo(P_KINGSNAIL, "King Snail", "The absolute ruler of the snail kingdom is far too large and heavy to catch in a net. While King Snail is too proud to chase down enemies itself, it can use its snail army to destroy its foes.", "kingsnail.png");
setinfo(P_KINGFLY, "King Fly", "King Fly is quite literally the lord of the flies. Far from the timid garden-variety fly, King Fly will roam around with its entourage of underlings in tow, running down anything in its path!", "kingfly.png"); setinfo(P_KINGFLY, "King Fly", "King Fly is quite literally the lord of the flies. Far from the timid garden-variety fly, King Fly will roam around with its entourage of underlings in tow, running down anything in its path.", "kingfly.png");
setinfo(P_KINGANT, "King Ant", "All ants bow down to King Ant, the ultimate ant overlord. King Ant is an enormous fire ant, endlessly covered in flames and able to create ant sustenance from its body. Its flames are so intense that they can instantly melt through solid ice!", "kingant.png"); setinfo(P_KINGANT, "King Ant", "All ants bow down to King Ant, the ultimate ant overlord. King Ant is an enormous fire ant, endlessly covered in flames and able to create ant sustenance from its body. Its flames are so intense that they can instantly melt through solid ice.", "kingant.png");
setinfo(P_KINGCAT, "King Cat", "The elusive King Cat masterminded the great food heist, and is rumoured to weild powerful arcane magic...", "kingcat.png"); setinfo(P_KINGCAT, "King Cat", "The elusive King Cat masterminded the great food heist, and is rumoured to weild powerful arcane magic...", "kingcat.png");
setinfo(P_SNAIL, "Snail", "Snails are slow moving but tough. When attacked normally they will not die, but simply lose their shell and become a slug. The safest way to take them out is to slam another monster into them, thus killing them instantly.", "snail.png"); setinfo(P_SNAIL, "Snail", "Snails are slow moving but tough. Normal attacks will not harm them, instead simply destroying their shell and turning them into a slug. The safest way to take out a snail is to slam it with another monster, killing it instantly.", "snail.png");
setinfo(P_SLUG, "Slug", "Slugs are faster moving than snails and capable of launching themselves through the air at their prey!", "slug.png"); setinfo(P_SLUG, "Slug", "Without the burden of a heavy shell, slugs move much faster than snails, and are capable of launching themselves through the air at nearby players.", "slug.png");
} }
@ -4115,8 +4112,17 @@ void dumpinfo(void) {
if (count % 2 == 0) { if (count % 2 == 0) {
printf("<tr>"); printf("<tr>");
} }
printf("<td width=10%% align=center><img src=\"img/%s\"><br>%s</td><td width=40%%>Worth %d points.</td>\n", printf("<td width=10%% align=center><img src=\"img/%s\"><br>%s</td><td width=40%%>Worth %d points.",
spriteinfo[i].file, spriteinfo[i].name,getpoints(i)); spriteinfo[i].file, spriteinfo[i].name,getpoints(i));
if (i == P_FLOWERRED) {
printf(" Collect them all for a set of rubies.");
} else if (i == P_FLOWERYELLOW) {
printf(" Collect them all for a set of topaz stones.");
} else if (i == P_FLOWERPURPLE) {
printf(" Collect them all for a set of amethysts.");
}
printf("</td>\n");
if (count % 2 == 1) { if (count % 2 == 1) {
printf("</tr>"); printf("</tr>");
} }