Added powerup: phone (skips 2 levels)
This commit is contained in:
parent
3ba0f582ac
commit
3f0346dafe
Binary file not shown.
7
defs.h
7
defs.h
|
@ -171,7 +171,7 @@
|
|||
/* enums */
|
||||
|
||||
/* sounds */
|
||||
#define MAXFX 34
|
||||
#define MAXFX 35
|
||||
#define FX_SHOOT 0
|
||||
#define FX_SLAM 1
|
||||
#define FX_KILL 2
|
||||
|
@ -206,6 +206,7 @@
|
|||
#define FX_SPRAY 31
|
||||
#define FX_CANNON 32
|
||||
#define FX_CRACK 33
|
||||
#define FX_PHONE 34
|
||||
|
||||
// Slope types
|
||||
#define S_NOTSOLID 0
|
||||
|
@ -213,7 +214,7 @@
|
|||
#define S_SLOPE 2
|
||||
|
||||
// Sprite types
|
||||
#define MAXPTYPES 52
|
||||
#define MAXPTYPES 53
|
||||
#define P_PLAYER 0
|
||||
#define P_RAT 1
|
||||
#define P_CHEESE 2
|
||||
|
@ -266,6 +267,7 @@
|
|||
#define P_SNAIL 49
|
||||
#define P_SLUG 50
|
||||
#define P_BUBBLE 51
|
||||
#define P_PHONE 52
|
||||
|
||||
// powerups
|
||||
#define PW_NONE 0
|
||||
|
@ -279,6 +281,7 @@
|
|||
#define PW_SPRAYDOWN 8 // fly spray
|
||||
#define PW_CANNON 9 // fusion cannon
|
||||
#define PW_CANNONFIRE 10 // fusion cannon firing
|
||||
#define PW_PHONE 11 // skip level
|
||||
// "virtual" powerup for bosses
|
||||
#define PW_RATSHAKE 20 // shake screen horizontally
|
||||
|
||||
|
|
6
edit.c
6
edit.c
|
@ -193,7 +193,7 @@ int main (int argc, char **argv) {
|
|||
|
||||
state = LS_EDIT;
|
||||
|
||||
if (loadlevel(curworld,curlevelnum)) {
|
||||
if (loadlevel(curworld,curlevelnum, B_TRUE)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -523,7 +523,7 @@ int main (int argc, char **argv) {
|
|||
if (toggletimer == 0) {
|
||||
if (curlevelnum < (numlevels-1)) {
|
||||
curlevelnum++;
|
||||
loadlevel(curworld, curlevelnum);
|
||||
loadlevel(curworld, curlevelnum, B_TRUE);
|
||||
draweditorlevel();
|
||||
drawsprites();
|
||||
toggletimer = 30;
|
||||
|
@ -537,7 +537,7 @@ int main (int argc, char **argv) {
|
|||
if (toggletimer == 0) {
|
||||
if (curlevelnum > 1) {
|
||||
curlevelnum--;
|
||||
loadlevel(curworld, curlevelnum);
|
||||
loadlevel(curworld, curlevelnum, B_TRUE);
|
||||
draweditorlevel();
|
||||
drawsprites();
|
||||
toggletimer = 30;
|
||||
|
|
41
rc.c
41
rc.c
|
@ -216,7 +216,7 @@ int main (int argc, char **argv) {
|
|||
}
|
||||
|
||||
playmusic(normalmusic);
|
||||
if (loadlevel(curworld,curlevelnum)) {
|
||||
if (loadlevel(curworld,curlevelnum, B_TRUE)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -994,8 +994,13 @@ void nextlevel(void) {
|
|||
// don't want the player flashing while scrolling
|
||||
player->invuln = 0;
|
||||
|
||||
// these two handle the scroll effect to the next level
|
||||
loadlevel(curworld,curlevelnum);
|
||||
// load next level data
|
||||
if (player->powerup == PW_PHONE) {
|
||||
// don't add monsters
|
||||
loadlevel(curworld,curlevelnum, B_FALSE);
|
||||
} else {
|
||||
loadlevel(curworld,curlevelnum, B_TRUE);
|
||||
}
|
||||
|
||||
// do the moving to next level animation
|
||||
drawlevel();
|
||||
|
@ -1004,8 +1009,12 @@ void nextlevel(void) {
|
|||
player->invuln = INVULNTIME;
|
||||
|
||||
/* reset game stats */
|
||||
if (player->powerup == PW_PHONE) {
|
||||
levelcomplete = LV_CLOUD;
|
||||
} else {
|
||||
levelcomplete = LV_INIT;
|
||||
levelcompletetime = -1;
|
||||
}
|
||||
|
||||
/* reset level stats */
|
||||
level->gotpowerup = B_FALSE;
|
||||
|
@ -1041,8 +1050,8 @@ void nextlevel(void) {
|
|||
player->netting = B_FALSE;
|
||||
player->slamming = B_FALSE;
|
||||
player->jumping = B_FALSE;
|
||||
player->powerup = B_FALSE;
|
||||
player->netcaught = 0;
|
||||
player->powerup = B_FALSE;
|
||||
|
||||
|
||||
// add initial fading cloud
|
||||
|
@ -2520,7 +2529,6 @@ if (s->id == P_PUFF) printf("PUFF WITH DOOMCOUNT!\n");
|
|||
levelcomplete = LV_CLOUDLOOP;
|
||||
}
|
||||
|
||||
printf("init angle = %0.2f\n", s->angle / (M_PI/180));
|
||||
} else {
|
||||
|
||||
// calculate distance to player
|
||||
|
@ -4554,6 +4562,28 @@ int dofruiteffect(sprite_t *s) {
|
|||
player->powerup = PW_CANNON;
|
||||
puffin(P_CANNON, player->x, player->y,"cannon", 0);
|
||||
return B_TRUE;
|
||||
} else if (s->id == P_PHONE) {
|
||||
sprite_t *s2, *nexts;
|
||||
playfx(FX_PHONE);
|
||||
sprintf(tempm, "Telephone!");
|
||||
addoutlinetext(s->x,s->y - s->img->h/2, TEXTSIZE_POINTS, tempm,&white,&black,POINTSDELAY);
|
||||
// set powerup
|
||||
player->powerup = PW_PHONE;
|
||||
// kill all enemies
|
||||
for (s2 = sprite; s2 ; s2 = nexts) {
|
||||
nexts = s2->next;
|
||||
if (isbullet(s2->id) || ismonster(s2->id)) {
|
||||
s2->dead = D_FINAL;
|
||||
|
||||
if (s2->caughtby) {
|
||||
s2->caughtby = NULL;
|
||||
player->netcaught--;
|
||||
}
|
||||
}
|
||||
}
|
||||
// call in cloud immediately
|
||||
levelcomplete = LV_FINAL;
|
||||
return B_TRUE;
|
||||
} else if (s->id == P_BOMB) {
|
||||
sprite_t *s2, *nexts;
|
||||
|
||||
|
@ -4735,6 +4765,7 @@ int initsound(void) {
|
|||
loadfx(FX_SPRAY, "spray.wav");
|
||||
loadfx(FX_CANNON, "fusion.wav");
|
||||
loadfx(FX_CRACK, "crack.wav");
|
||||
loadfx(FX_PHONE, "phone.wav");
|
||||
|
||||
|
||||
// load sound effects
|
||||
|
|
20
shared.c
20
shared.c
|
@ -20,7 +20,7 @@
|
|||
#include "shared.h"
|
||||
|
||||
|
||||
int loadlevel(int wnum, int lnum) {
|
||||
int loadlevel(int wnum, int lnum, int wantmonsters) {
|
||||
FILE *f;
|
||||
int x,y;
|
||||
int xx,yy;
|
||||
|
@ -514,6 +514,7 @@ int loadlevel(int wnum, int lnum) {
|
|||
|
||||
|
||||
/* add monsters */
|
||||
if (wantmonsters) {
|
||||
for (i = 0; i < level->nummonsters; i++) {
|
||||
char name[MIDBUFLEN];
|
||||
int delay;
|
||||
|
@ -530,13 +531,14 @@ int loadlevel(int wnum, int lnum) {
|
|||
delay = 0;
|
||||
}
|
||||
|
||||
#ifdef __EDITOR
|
||||
#ifdef __EDITOR
|
||||
addsprite(level->initm[i].id,
|
||||
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 );
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
gtime = 0;
|
||||
|
@ -1145,6 +1147,9 @@ int loadimagesets(void) {
|
|||
loadspriteimage(P_BOMB,F_WALK1, "sprites/bomb.png");
|
||||
imageset[P_BOMB].numimages = 1;
|
||||
|
||||
loadspriteimage(P_PHONE,F_WALK1, "sprites/phone.png");
|
||||
imageset[P_PHONE].numimages = 1;
|
||||
|
||||
loadspriteimage(P_SHIELD,F_WALK1, "sprites/shield.png");
|
||||
imageset[P_SHIELD].numimages = 1;
|
||||
|
||||
|
@ -1661,6 +1666,7 @@ int isfruit(int id) {
|
|||
case P_FTODIAMOND:
|
||||
case P_FTOGEM:
|
||||
case P_BOMB:
|
||||
case P_PHONE:
|
||||
case P_HELMET:
|
||||
case P_SHIELD:
|
||||
case P_RINGSILVER:
|
||||
|
@ -2235,8 +2241,7 @@ int loadlevellist(void) {
|
|||
|
||||
int randompowerup(void) {
|
||||
int num;
|
||||
num = rand() % 19;
|
||||
|
||||
num = rand() % 20;
|
||||
|
||||
switch (num) {
|
||||
case 0:
|
||||
|
@ -2278,6 +2283,8 @@ int randompowerup(void) {
|
|||
return P_SPRAY;
|
||||
case 18:
|
||||
return P_CANNONPOWERUP;
|
||||
case 19:
|
||||
return P_PHONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2395,6 +2402,7 @@ void setfruitinfo(void) {
|
|||
setinfo(P_SNOWMAN, "Snowman", "Freezes the level, turning everything to ice - touch a monster to shatter it!", "snowman.png");
|
||||
setinfo(P_SPRAY, "Fly Spray", "Sickens all monsters, causing them to slow down to half speed.","spray.png");
|
||||
setinfo(P_CANNONPOWERUP, "Fusion Cannon", "A powerful weapon which will shoot out laser beams in all directions!", "cannonpowerup.png");
|
||||
setinfo(P_PHONE, "Phone", "Calls in your helper cloud and immediately skips two levels.", "phone.png");
|
||||
|
||||
setinfo(P_RAT, "Rat", "The weakest of the monsters, the rat will simply walk back and forth waiting to be caught. Beward an angry rat though, as it will try to fall or jump in order to catch you!", "rat.png");
|
||||
setinfo(P_BEE, "Bee", "Bees, while still relatively weak, gain an advantage over bats in that they are able to fly. They move in a simple diagonal pattern, changing direction when they get near a wall or spikes. Bees will speed up when angry.", "newbee.png");
|
||||
|
|
Loading…
Reference in New Issue