Modified gunner powerup to exit as soon as you kill the last un-caught
monster
This commit is contained in:
parent
6094920eab
commit
3c3d6b3b89
26
rc.c
26
rc.c
|
@ -460,10 +460,15 @@ int main (int argc, char **argv) {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (player->powerup == PW_GUNNER) { // red overlay for machine gunner
|
||||
// gunner effect - red overlay
|
||||
if (player->powerup == PW_GUNNER) {
|
||||
if (levelcomplete != LV_DOPOKER) {
|
||||
SDL_BlitSurface(redbox,NULL,screen,NULL);
|
||||
}
|
||||
if (uncaughtmonsters() <= 0) {
|
||||
// finish if no monsters are left alive & uncaught
|
||||
losepowerup(player);
|
||||
}
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
|
@ -885,6 +890,8 @@ void tick(void) {
|
|||
// never reach hurryup time
|
||||
resethurryup(curlevel);
|
||||
|
||||
|
||||
|
||||
// decrement counter
|
||||
guntime--;
|
||||
if (guntime < 0) {
|
||||
|
@ -1443,6 +1450,23 @@ int countmonsters(int montype) {
|
|||
return mcount;
|
||||
}
|
||||
|
||||
// count of monsters left alive and uncaught
|
||||
int uncaughtmonsters(void) {
|
||||
sprite_t *s2;
|
||||
int mcount;
|
||||
mcount = 0;
|
||||
/* any monsters left? */
|
||||
for (s2 = sprite->next ; s2 ; s2 = s2->next) {
|
||||
if (ismonster(s2->id) && !s2->dead && !s2->caughtby) {
|
||||
if (s2->id != P_BLACKCLOUD) {
|
||||
mcount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return mcount;
|
||||
}
|
||||
|
||||
void cleanup(void) {
|
||||
int i;
|
||||
printf("commencing cleanup routine....\n");
|
||||
|
|
Loading…
Reference in New Issue