diff --git a/defs.h b/defs.h index b01c789..f1058d7 100644 --- a/defs.h +++ b/defs.h @@ -1043,6 +1043,8 @@ extern int nextforcegoodcard; extern int globpowerup; +extern int curlevelnum; + extern char *datadir; #endif diff --git a/globals.h b/globals.h index dba3cd5..8905492 100644 --- a/globals.h +++ b/globals.h @@ -7,6 +7,8 @@ int musicplaying; levelentry_t levelentry[MAXLEVELS]; // level filenames etc int numlevels; +int curlevelnum; + int maxlevid; int want1up,want2up; diff --git a/rc.c b/rc.c index f0e14fd..59f46fc 100644 --- a/rc.c +++ b/rc.c @@ -142,7 +142,6 @@ int gtime = 0; int fpsticks = 0; int fpsstart = 0; -int curlevelnum; int skipto = -1; // which level to skip to level_t *curlevel; int levelcompletetime; @@ -9920,6 +9919,7 @@ if (cheat) { double px,py; // lose credit and come back to life credits--; + setdefaults(player); player->lives = INITPLAYERLIVES; player->score = 0; playfx(FX_EXTRALIFE); @@ -9971,6 +9971,7 @@ if (cheat) { double px,py; // lose credit and come back to life credits--; + setdefaults(player2); player2->lives = INITPLAYERLIVES; player2->score = 0; playfx(FX_EXTRALIFE); diff --git a/shared.c b/shared.c index 6edc999..585c2cd 100644 --- a/shared.c +++ b/shared.c @@ -629,6 +629,24 @@ printf(".\n"); void setdefaults(sprite_t *s) { if (isplayer(s)) { + + // set permenant powerups based on level + if (curlevelnum > 20) { + s->permspeed = B_TRUE; + } else { + s->permspeed = B_FALSE; + } + if (curlevelnum > 40) { + s->permmask = B_TRUE; + } else { + s->permmask = B_FALSE; + } + if (curlevelnum > 60) { + s->permumbrella = B_TRUE; + } else { + s->permumbrella = B_FALSE; + } + // player powerup stats if (s->permspeed) { s->speed = 2; @@ -900,13 +918,13 @@ sprite_t *addsprite(int id, int x, int y, char *name ) { // don't set these in setdefaults() as setdefaults() is called after each player death s->permspeed = B_FALSE; + s->permmask = B_FALSE; + s->permumbrella = B_FALSE; s->permbignet = B_FALSE; s->permnumnets = B_FALSE; s->permsticky = B_FALSE; s->permdoublejump = B_FALSE; s->permarmour = B_FALSE; - s->permmask = B_FALSE; - s->permumbrella = B_FALSE; s->lostlife = B_FALSE;