From 95087435aeaffd51b1ffad6b28237cf261e33e81 Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Wed, 14 Aug 2013 11:49:24 +0000 Subject: [PATCH] Tweak magic lamp powerup - all initial fruits on next level are now gold bars as well. --- defs.h | 3 ++- rc.c | 3 ++- shared.c | 18 ++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/defs.h b/defs.h index 4ee2a27..7b48780 100644 --- a/defs.h +++ b/defs.h @@ -3,7 +3,6 @@ #include - /* files */ #define FILE_LEVELMAP "map.dat" #define FILE_TILEDEFS "tiledefs.dat" @@ -1195,6 +1194,8 @@ extern int deck[]; extern int forcegoodcard; extern int nextforcegoodcard; +extern int forcegold; + extern int globpowerup; extern int globtimer; diff --git a/rc.c b/rc.c index 3efb9ae..38628bc 100644 --- a/rc.c +++ b/rc.c @@ -12155,11 +12155,12 @@ if (cheat) { } if (keydown(0, SDLK_v)) { // cheat if (toggletimer == 0) { - addsprite(P_BIGCHEST, (640/2), 0, "bigchest"); + // addsprite(P_BIGCHEST, (640/2), 0, "bigchest"); // all powerups playfx(FX_POWERUP); sprintf(tempm, "Cheat!"); if (player) { + player->powerup = PW_MAGNET; player->netmax = 4; // all nets player->netbig = B_TRUE; // big net player->speed = 2; // fast diff --git a/shared.c b/shared.c index 0117fcd..83adc1a 100644 --- a/shared.c +++ b/shared.c @@ -19,7 +19,6 @@ #include "globals.h" #include "shared.h" - int loadlevel(int lnum, int wantmonsters) { FILE *f; int x,y; @@ -109,8 +108,6 @@ int loadlevel(int lnum, int wantmonsters) { level->p1y = 0; level->powerupx = -1; level->powerupy = -1; - - /* remove all onscreen text */ @@ -292,8 +289,6 @@ int loadlevel(int lnum, int wantmonsters) { level->initm[level->nummonsters].wayy[0] = y*TILEH+(TILEH-2)+2; level->initm[level->nummonsters].numwaypoints = 1; - - // read waypoints p = strtok(NULL, " "); while (p) { @@ -667,10 +662,15 @@ int loadlevel(int lnum, int wantmonsters) { } newsp->curwaypoint = 1; } else { + int thisid; + thisid = level->initm[i].id; #ifdef __EDITOR - addsprite(level->initm[i].id, level->initm[i].startx, level->initm[i].starty, name ); + addsprite(thisid, level->initm[i].startx, level->initm[i].starty, name ); #else - puffin(level->initm[i].id, level->initm[i].startx, level->initm[i].starty, name, delay ); + if (forcegold && isfruit(level->initm[i].id)) { + thisid = P_GOLDBAR; + } + puffin(thisid, level->initm[i].startx, level->initm[i].starty, name, delay ); #endif } } @@ -953,8 +953,6 @@ sprite_t *addsprite(int id, int x, int y, char *name ) { s = s->next; } - - s->id = id; s->x = x; s->y = y; @@ -1019,12 +1017,12 @@ sprite_t *addsprite(int id, int x, int y, char *name ) { setdefaults(s); - // initial fruits don't time out #ifndef __EDITOR if ((levelcomplete != LV_NEXTLEV) && (levelcomplete != LV_INIT)) { int ftype; ftype = isfruit(s->id); + if (ftype == FT_SUPER) { // super powerups never time out. s->doomcount = 0;