Tweak magic lamp powerup - all initial fruits on next level

are now gold bars as well.
This commit is contained in:
Rob Pearce 2013-08-14 11:49:24 +00:00
parent 7937c776bc
commit 95087435ae
3 changed files with 12 additions and 12 deletions

3
defs.h
View File

@ -3,7 +3,6 @@
#include <SDL_mixer.h> #include <SDL_mixer.h>
/* files */ /* files */
#define FILE_LEVELMAP "map.dat" #define FILE_LEVELMAP "map.dat"
#define FILE_TILEDEFS "tiledefs.dat" #define FILE_TILEDEFS "tiledefs.dat"
@ -1195,6 +1194,8 @@ extern int deck[];
extern int forcegoodcard; extern int forcegoodcard;
extern int nextforcegoodcard; extern int nextforcegoodcard;
extern int forcegold;
extern int globpowerup; extern int globpowerup;
extern int globtimer; extern int globtimer;

3
rc.c
View File

@ -12155,11 +12155,12 @@ if (cheat) {
} }
if (keydown(0, SDLK_v)) { // cheat if (keydown(0, SDLK_v)) { // cheat
if (toggletimer == 0) { if (toggletimer == 0) {
addsprite(P_BIGCHEST, (640/2), 0, "bigchest"); // addsprite(P_BIGCHEST, (640/2), 0, "bigchest");
// all powerups // all powerups
playfx(FX_POWERUP); playfx(FX_POWERUP);
sprintf(tempm, "Cheat!"); sprintf(tempm, "Cheat!");
if (player) { if (player) {
player->powerup = PW_MAGNET;
player->netmax = 4; // all nets player->netmax = 4; // all nets
player->netbig = B_TRUE; // big net player->netbig = B_TRUE; // big net
player->speed = 2; // fast player->speed = 2; // fast

View File

@ -19,7 +19,6 @@
#include "globals.h" #include "globals.h"
#include "shared.h" #include "shared.h"
int loadlevel(int lnum, int wantmonsters) { int loadlevel(int lnum, int wantmonsters) {
FILE *f; FILE *f;
int x,y; int x,y;
@ -111,8 +110,6 @@ int loadlevel(int lnum, int wantmonsters) {
level->powerupy = -1; level->powerupy = -1;
/* remove all onscreen text */ /* remove all onscreen text */
while (text) { while (text) {
killtext(text); killtext(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].wayy[0] = y*TILEH+(TILEH-2)+2;
level->initm[level->nummonsters].numwaypoints = 1; level->initm[level->nummonsters].numwaypoints = 1;
// read waypoints // read waypoints
p = strtok(NULL, " "); p = strtok(NULL, " ");
while (p) { while (p) {
@ -667,10 +662,15 @@ int loadlevel(int lnum, int wantmonsters) {
} }
newsp->curwaypoint = 1; newsp->curwaypoint = 1;
} else { } else {
int thisid;
thisid = level->initm[i].id;
#ifdef __EDITOR #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 #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 #endif
} }
} }
@ -953,8 +953,6 @@ sprite_t *addsprite(int id, int x, int y, char *name ) {
s = s->next; s = s->next;
} }
s->id = id; s->id = id;
s->x = x; s->x = x;
s->y = y; s->y = y;
@ -1019,12 +1017,12 @@ sprite_t *addsprite(int id, int x, int y, char *name ) {
setdefaults(s); setdefaults(s);
// initial fruits don't time out // initial fruits don't time out
#ifndef __EDITOR #ifndef __EDITOR
if ((levelcomplete != LV_NEXTLEV) && (levelcomplete != LV_INIT)) { if ((levelcomplete != LV_NEXTLEV) && (levelcomplete != LV_INIT)) {
int ftype; int ftype;
ftype = isfruit(s->id); ftype = isfruit(s->id);
if (ftype == FT_SUPER) { if (ftype == FT_SUPER) {
// super powerups never time out. // super powerups never time out.
s->doomcount = 0; s->doomcount = 0;