diff --git a/data/sprites/dwarfhead-small.png b/data/sprites/extralife.png similarity index 100% rename from data/sprites/dwarfhead-small.png rename to data/sprites/extralife.png diff --git a/data/world1/level11.5.dat b/data/world1/level11.5.dat index 0a0b279..688a504 100644 --- a/data/world1/level11.5.dat +++ b/data/world1/level11.5.dat @@ -1,6 +1,6 @@ bgfile backgrounds/forest2.png bg 0 -hurryup 136 +hurryup 45 help endhelp monsters diff --git a/data/world1/level11.dat b/data/world1/level11.dat index 4bff2e3..fba0a37 100644 --- a/data/world1/level11.dat +++ b/data/world1/level11.dat @@ -1,6 +1,6 @@ bgfile backgrounds/forest2.png bg 0 -hurryup 328 +hurryup 30 help Jump onto trampolines to bounce high... endhelp diff --git a/data/world1/level12.dat b/data/world1/level12.dat index fc06d6e..f786a04 100644 --- a/data/world1/level12.dat +++ b/data/world1/level12.dat @@ -1,6 +1,6 @@ bgfile backgrounds/forest2.png bg 0 -hurryup 60 +hurryup 30 help endhelp monsters diff --git a/data/world1/level13.dat b/data/world1/level13.dat index 4031a22..0706350 100644 --- a/data/world1/level13.dat +++ b/data/world1/level13.dat @@ -1,6 +1,6 @@ bgfile bg 0 -hurryup 232 +hurryup 30 help endhelp monsters diff --git a/data/world1/level14.dat b/data/world1/level14.dat index bc62cef..15cc376 100644 --- a/data/world1/level14.dat +++ b/data/world1/level14.dat @@ -1,6 +1,6 @@ bgfile bg 0 -hurryup 232 +hurryup 45 help endhelp monsters diff --git a/data/world1/level21.dat b/data/world1/level21.dat index e8180e0..153b32c 100644 --- a/data/world1/level21.dat +++ b/data/world1/level21.dat @@ -1,6 +1,6 @@ bgfile backgrounds/beach1.png bg 0 -hurryup 136 +hurryup 30 help Drop through the bottom of this level endhelp diff --git a/data/world1/level3.dat b/data/world1/level3.dat index 8ce885b..20494af 100644 --- a/data/world1/level3.dat +++ b/data/world1/level3.dat @@ -1,6 +1,6 @@ bgfile backgrounds/forest2.png bg 0 -hurryup 40 +hurryup 30 help You can walk through spikes safely. But don't fall on them! diff --git a/data/world1/level4.dat b/data/world1/level4.dat index 61f50e1..06d85aa 100644 --- a/data/world1/level4.dat +++ b/data/world1/level4.dat @@ -1,6 +1,6 @@ bgfile backgrounds/forest2.png bg 0 -hurryup 120 +hurryup 30 help Drop through bridges with Down+X endhelp diff --git a/data/world1/level6.dat b/data/world1/level6.dat index bd9101d..35c4961 100644 --- a/data/world1/level6.dat +++ b/data/world1/level6.dat @@ -1,6 +1,6 @@ bgfile bg 0 -hurryup 248 +hurryup 30 help Rolling logs will push you along. endhelp diff --git a/data/world1/level9.dat b/data/world1/level9.dat index 4769bef..16e972a 100644 --- a/data/world1/level9.dat +++ b/data/world1/level9.dat @@ -1,6 +1,6 @@ bgfile backgrounds/forest2.png bg 0 -hurryup 616 +hurryup 30 help endhelp monsters diff --git a/defs.h b/defs.h index d109391..3d7d9b7 100644 --- a/defs.h +++ b/defs.h @@ -38,6 +38,7 @@ #define TEXTSIZE_DEATH 20 #define TEXTSIZE_LEVEL2 22 #define TEXTSIZE_BIFF 26 +#define TEXTSIZE_MULTI 26 #define TEXTSIZE_LEVEL 32 #define TEXTSIZE_LIFE 36 #define TEXTSIZE_BOMB 36 @@ -51,6 +52,7 @@ // how long to keep various text on the screen #define POINTSDELAY 40 #define BONUSDELAY 50 +#define MULTIDELAY 50 #define HURRYDELAY 50 #define LIFEDELAY 50 #define LEVELWINDELAY 80 @@ -158,7 +160,8 @@ #define FT_FRUIT 1 #define FT_PERM 2 #define FT_TEMP 3 -#define FT_OTHER 4 +#define FT_GEM 4 +#define FT_OTHER 5 // monster types #define MT_MONSTER 1 @@ -571,7 +574,7 @@ imageset_t imageset[MAXPTYPES]; /* external globals */ extern SDL_Color black; -extern SDL_Surface *screen, *temps, *levelbg, *head, *headsmall, *icecube; +extern SDL_Surface *screen, *temps, *levelbg, *head, *icecube; extern SDL_Surface *healthbar[]; extern SDL_Surface *greenbox; extern sprite_t *sprite, *lastsprite, *player, *boss; diff --git a/edit.c b/edit.c index c61ede6..81a7b62 100644 --- a/edit.c +++ b/edit.c @@ -1210,6 +1210,10 @@ void newlevel(void) { levelentry[curlevelnum].id = maxlevid; + // default + curlevel->hurryuptime = 30; + curlevel->exitdir = D_RIGHT; + sprintf(tempm,"Made new level '%s'\n",levelentry[curlevelnum].filename); setstatustext(tempm, &green); diff --git a/globals.h b/globals.h index b68e44c..7471b35 100644 --- a/globals.h +++ b/globals.h @@ -17,7 +17,7 @@ char *datadir; SDL_Surface *levelbg; // level background image SDL_Surface *temps; // temporary surface SDL_Surface *screen; // the actual video screen -SDL_Surface *head,*headsmall; // img in corner showing number of lives +SDL_Surface *head; // img in corner showing number of lives SDL_Surface *icecube; // overlaid on frozen monsters SDL_Surface *greenbox; // for fly spray effect SDL_Surface *healthbar[HEALTHFRAMES]; // for boss health diff --git a/rc.c b/rc.c index bf5e894..8f855a4 100644 --- a/rc.c +++ b/rc.c @@ -330,8 +330,8 @@ int main (int argc, char **argv) { if (!paused) { if (keys[SDLK_q]) { - //gtime = nexthurryup-1; - gtime = nexthurryup+14; + gtime = nexthurryup-1; + //gtime = nexthurryup+14; } if (keys[SDLK_l]) { if (toggletimer == 0) { @@ -901,12 +901,20 @@ void tick(void) { if (!isbosslevel(curlevelnum)) { if (gtime == nexthurryup) { if (!levelcomplete) { + // all sprites get angry and un-iced for (s = sprite; s; s = s->next) { if ((s != player) && (ismonster(s->id))) { s->angry = B_TRUE; s->iced = B_FALSE; } } + + // rings are disabled + if ((player->powerup == PW_RINGWALK) || (player->powerup == PW_RINGJUMP)) { + player->powerup = B_FALSE; + } + + addoutlinetext(320,240,TEXTSIZE_HURRY, "Hurry up!", &yellow,&black,HURRYDELAY); stopmusic(); @@ -1360,7 +1368,7 @@ void checkcollide(sprite_t *s) { // we hit something! if (s->netsticky && isfruit(s2->id)) { - getfruit(s, s2); + getfruit(s, s2, 1); } else { // Otherwise, it must be a monster @@ -1429,7 +1437,7 @@ void checkcollide(sprite_t *s) { if (s == player) { //if (isfruit(s2->id) && (s2->teleporting == 0)) { if (isfruit(s2->id)) { - getfruit(player, s2); + getfruit(player, s2, 1); } else if (ismonster(s2->id) || isbullet(s2->id)) { if (s2->iced) { // monster dies @@ -1769,6 +1777,24 @@ if (s->id == P_PUFF) printf("PUFF WITH DOOMCOUNT!\n"); newsp->watertimer = rand() % BUBBLETIME; } + // is it a points fruit appearing on top of us? + if (isfruit(newsp->id) == FT_FRUIT) { + int xdiff,ydiff; + /* now check for collision with us */ + xdiff = player->x - newsp->x; + if (xdiff < 0) xdiff = -xdiff; + ydiff = (player->y-(player->img->h/2)) - (newsp->y-(newsp->img->h/2)); + if (ydiff < 0) ydiff = -ydiff; + + // appeared on top of us + if ((xdiff <= player->img->w/2 + newsp->img->w/2) && + (ydiff <= player->img->h/2 + newsp->img->h/2)) { + // bonus! + getfruit(player, newsp, 4); + addoutlinetext(player->x,player->y - (player->img->h*1.5), TEXTSIZE_MULTI, "Nice catch!", &green,&black,MULTIDELAY); + } + + } } } @@ -3873,7 +3899,7 @@ void dogravity(sprite_t *s) { addsprite(P_SPARKLE, xx, yy, "sparkle"); // gain points - addscore(player, 20); + addscore(player, 65); } } } @@ -4331,7 +4357,7 @@ int movex(sprite_t *s,double amt) { addsprite(P_SPARKLE, xx, yy, "sparkle"); // gain points - addscore(player, 3); + addscore(player, 15); } } } @@ -5265,18 +5291,24 @@ void initsdl(void) { } // player collects the given fruit -void getfruit(sprite_t *giveto, sprite_t *fruit) { +void getfruit(sprite_t *giveto, sprite_t *fruit, int multiplier) { char tempm[MIDBUFLEN]; int gotscore = fruit->score; /* kill the fruit */ fruit->dead = D_FINAL; /* give points to the player */ - addscore(giveto, gotscore); + addscore(giveto, gotscore*multiplier); + /* handle fruit effects */ if (!dofruiteffect(fruit)) { playfx(FX_FRUIT); - sprintf(tempm, "%d", gotscore); - addoutlinetext(fruit->x,fruit->y - fruit->img->h/2, TEXTSIZE_POINTS, tempm, &white,&black,POINTSDELAY); + if (multiplier <= 1) { + sprintf(tempm, "%d", gotscore); + addoutlinetext(fruit->x,fruit->y - fruit->img->h/2, TEXTSIZE_POINTS, tempm, &white,&black,POINTSDELAY); + } else { + sprintf(tempm, "%d x %d" , gotscore,multiplier); + addoutlinetext(fruit->x,fruit->y - fruit->img->h/2, TEXTSIZE_POINTS + 2*multiplier, tempm, &white,&black,POINTSDELAY); + } } } diff --git a/rc.h b/rc.h index b02bb94..3f2ff5e 100644 --- a/rc.h +++ b/rc.h @@ -65,4 +65,4 @@ int getjumpdelay(int mid); void togglepause(void); void togglefullscreen(void); void initsdl(void); -void getfruit(sprite_t *giveto, sprite_t *fruit); +void getfruit(sprite_t *giveto, sprite_t *fruit, int multiplier); diff --git a/shared.c b/shared.c index fe34f51..3db2299 100644 --- a/shared.c +++ b/shared.c @@ -945,8 +945,6 @@ int loadimagesets(void) { sprintf(tempfile, "%s/sprites/dwarfhead.png",datadir); head = IMG_Load(tempfile); - sprintf(tempfile, "%s/sprites/dwarfhead-small.png",datadir); - headsmall = IMG_Load(tempfile); sprintf(tempfile, "%s/sprites/icecube.png",datadir); icecube = IMG_Load(tempfile); @@ -1148,7 +1146,7 @@ int loadimagesets(void) { loadspriteimage(P_BOMB,F_WALK1, "sprites/bomb.png"); imageset[P_BOMB].numimages = 1; - loadspriteimage(P_LIFE,F_WALK1, "sprites/dwarfhead-small.png"); + loadspriteimage(P_LIFE,F_WALK1, "sprites/extralife.png"); imageset[P_LIFE].numimages = 1; loadspriteimage(P_PHONE,F_WALK1, "sprites/phone.png"); @@ -1693,7 +1691,7 @@ int isfruit(int id) { case P_GEMYELLOW: case P_GEMRED: case P_GEMPURPLE: - return FT_FRUIT; + return FT_GEM; /* misc */ case P_POWERUPPOS: return FT_OTHER; @@ -2326,6 +2324,9 @@ int randompowerup(void) { int num; num = rand() % 22; + return P_RINGGOLD; + + switch (num) { case 0: default: @@ -2527,7 +2528,7 @@ void dumpinfo(void) { // fruits printf("