Added new powerup: top hat

This commit is contained in:
Rob Pearce 2009-01-30 03:30:38 +00:00
parent 7b0a859fe6
commit 9868a0f105
4 changed files with 41 additions and 11 deletions

6
defs.h
View File

@ -423,7 +423,7 @@
#define S_SLOPE 2 #define S_SLOPE 2
// Sprite types // Sprite types
#define MAXPTYPES 162 #define MAXPTYPES 163
#define P_PLAYER 0 #define P_PLAYER 0
#define P_RAT 1 #define P_RAT 1
#define P_CHEESE 2 #define P_CHEESE 2
@ -591,6 +591,7 @@
#define P_ANT2 159 #define P_ANT2 159
#define P_ANT3 160 #define P_ANT3 160
#define P_FIREBALL 161 #define P_FIREBALL 161
#define P_TOPHAT 162
#define FLY_FLYTIME 150 #define FLY_FLYTIME 150
@ -657,7 +658,8 @@
#define PW_CAMERA 20 // camera #define PW_CAMERA 20 // camera
#define PW_SMALLNET 21 // skull #define PW_SMALLNET 21 // skull
#define PW_PILL 22 // pill #define PW_PILL 22 // pill
#define PW_RAYGUN 23 // pill #define PW_RAYGUN 23 // ray gun
#define PW_TOPHAT 24 // top hat
// "virtual" powerup for bosses // "virtual" powerup for bosses
#define PW_RATSHAKE 50 // shake screen horizontally #define PW_RATSHAKE 50 // shake screen horizontally
#define PW_SNAILSHAKE 51 // shake screen vertically #define PW_SNAILSHAKE 51 // shake screen vertically

33
rc.c
View File

@ -7713,6 +7713,12 @@ void dogravity(sprite_t *s) {
/* will become a fruit when it finishes dying */ /* will become a fruit when it finishes dying */
if (boss) { if (boss) {
s2->willbecome = -1; s2->willbecome = -1;
} else if (s->powerup == PW_TOPHAT) {
/* all fruits are powerups! */
s2->willbecome = poweruptypes[curpoweruptype[getpnum(s)]];
if (poweruptypes[++(curpoweruptype[getpnum(s)])] == -1) {
curpoweruptype[getpnum(s)] = 0;
}
} else { } else {
s2->willbecome = fruittypes[curfruittype]; s2->willbecome = fruittypes[curfruittype];
/* increment fruit type */ /* increment fruit type */
@ -7861,14 +7867,20 @@ void dogravity(sprite_t *s) {
} else if (s->powerup == PW_MACE) { } else if (s->powerup == PW_MACE) {
s2->willbecome = P_DIAMOND; s2->willbecome = P_DIAMOND;
} else { // should never happen } else { // should never happen
if (s->powerup == PW_TOPHAT) {
/* will become a fruit when it finishes dying */ s2->willbecome = poweruptypes[curpoweruptype[getpnum(s)]];
s2->willbecome = fruittypes[curfruittype]; if (poweruptypes[++(curpoweruptype[getpnum(s)])] == -1) {
/* increment fruit type */ curpoweruptype[getpnum(s)] = 0;
if (fruittypes[++curfruittype] == -1) { }
curfruittype = 0; } else {
/* will become a fruit when it finishes dying */
s2->willbecome = fruittypes[curfruittype];
/* increment fruit type */
if (fruittypes[++curfruittype] == -1) {
curfruittype = 0;
}
fruittime = gtime;
} }
fruittime = gtime;
} }
if (s2->id == P_SNAIL) { if (s2->id == P_SNAIL) {
// turn into a slug so that it really dies // turn into a slug so that it really dies
@ -8390,6 +8402,13 @@ int dofruiteffect(sprite_t *pp, sprite_t *s) {
pp->powerup = PW_RAYGUN; pp->powerup = PW_RAYGUN;
pp->timer1 = 5; // # of shots pp->timer1 = 5; // # of shots
return B_TRUE; return B_TRUE;
} else if (s->id == P_TOPHAT) {
// Top Hat
playfx(FX_POWERUP);
sprintf(tempm, "Top Hat!");
addoutlinetext(s->x,s->y - s->img->h/2, TEXTSIZE_POINTS, tempm,&white,&black,POINTSDELAY, TT_NORM);
pp->powerup = PW_TOPHAT;
return B_TRUE;
} else if (s->id == P_CANNONPOWERUP) { } else if (s->id == P_CANNONPOWERUP) {
sprite_t *newsp; sprite_t *newsp;
// cannon // cannon

View File

@ -1659,6 +1659,9 @@ int loadimagesets(void) {
loadspriteimage(P_RAYGUN,F_WALK1, "sprites/raygun.png"); loadspriteimage(P_RAYGUN,F_WALK1, "sprites/raygun.png");
imageset[P_RAYGUN].numimages = 1; imageset[P_RAYGUN].numimages = 1;
loadspriteimage(P_TOPHAT,F_WALK1, "sprites/tophat.png");
imageset[P_TOPHAT].numimages = 1;
loadspriteimage(P_GUN,F_WALK1, "sprites/gunner.png"); loadspriteimage(P_GUN,F_WALK1, "sprites/gunner.png");
imageset[P_GUN].numimages = 1; imageset[P_GUN].numimages = 1;
@ -2593,6 +2596,7 @@ int isabilitypowerup(int id) {
case P_JETPACK: case P_JETPACK:
case P_PILL: case P_PILL:
case P_RAYGUN: case P_RAYGUN:
case P_TOPHAT:
return B_TRUE; return B_TRUE;
} }
return B_FALSE; return B_FALSE;
@ -2690,6 +2694,7 @@ int isfruit(int id) {
case P_CAMERA: case P_CAMERA:
case P_PILL: case P_PILL:
case P_RAYGUN: case P_RAYGUN:
case P_TOPHAT:
return FT_TEMP; return FT_TEMP;
/* flowers */ /* flowers */
case P_FLOWERYELLOW: case P_FLOWERYELLOW:
@ -3487,6 +3492,8 @@ int randompowerup(void) {
return P_PILL; return P_PILL;
case 45: case 45:
return P_RAYGUN; return P_RAYGUN;
case 46:
return P_TOPHAT;
} }
} }
@ -3617,6 +3624,7 @@ void setfruitinfo(void) {
setinfo(P_PILL, "Pill", "Eating this pill will cause you to enter a hyperactive state, moving at four times your standard speed!", "pill.png"); setinfo(P_PILL, "Pill", "Eating this pill will cause you to enter a hyperactive state, moving at four times your standard speed!", "pill.png");
setinfo(P_RAYGUN, "Ray Gun", "Alien in origin, the ray gun contains enough charge for five shots of burning plasma.", "raygun.png"); setinfo(P_RAYGUN, "Ray Gun", "Alien in origin, the ray gun contains enough charge for five shots of burning plasma.", "raygun.png");
setinfo(P_TOPHAT, "Top Hat", "Players wearing the top hat will find that every itam which appears will now be a power-up!", "tophat.png");
setinfo(P_BOXING, "Boxing Glove", "Your net will punch monsters, killing them instantly.", "boxing.png"); setinfo(P_BOXING, "Boxing Glove", "Your net will punch monsters, killing them instantly.", "boxing.png");
setinfo(P_MACEPOWERUP, "Mace", "Slamming your net will cause a lethal explosion!", "macepowerup.png"); setinfo(P_MACEPOWERUP, "Mace", "Slamming your net will cause a lethal explosion!", "macepowerup.png");

View File

@ -104,8 +104,9 @@
</tr><tr><td align=center><img src="img/camera.png"><br>Camera</td><td>Creates a bright flash of light, blinding all enemies.</td> </tr><tr><td align=center><img src="img/camera.png"><br>Camera</td><td>Creates a bright flash of light, blinding all enemies.</td>
<td align=center><img src="img/pill.png"><br>Pill</td><td>Eating this pill will cause you to enter a hyperactive state, moving at four times your standard speed!</td> <td align=center><img src="img/pill.png"><br>Pill</td><td>Eating this pill will cause you to enter a hyperactive state, moving at four times your standard speed!</td>
</tr><tr><td align=center><img src="img/raygun.png"><br>Ray Gun</td><td>Alien in origin, the ray gun contains enough charge for five shots of burning plasma.</td> </tr><tr><td align=center><img src="img/raygun.png"><br>Ray Gun</td><td>Alien in origin, the ray gun contains enough charge for five shots of burning plasma.</td>
<td align=center><font color="ff00ff"><b><big>?</big></b></font><br>Random</td><td>Gives you a random effect...</td> <td align=center><img src="img/tophat.png"><br>Top Hat</td><td>Players wearing the top hat will find that every itam which appears will now be a power-up!</td>
</tr><tr bgcolor="#ffff00"><th colspan=4>Super Powerups</th></tr> </tr><tr><td align=center><font color="ff00ff"><b><big>?</big></b></font><br>Random</td><td>Gives you a random effect...</td>
<td colspan=2>&nbsp;</td></tr><tr bgcolor="#ffff00"><th colspan=4>Super Powerups</th></tr>
<tr><td align=center><img src="img/bigspeed.png"><br>Big Speed Up</td><td>Makes you walk faster, permenantly!</td> <tr><td align=center><img src="img/bigspeed.png"><br>Big Speed Up</td><td>Makes you walk faster, permenantly!</td>
<td align=center><img src="img/bigscuba.png"><br>Big Scuba Mask</td><td>Permenantly gives you fast underwater movement.</td> <td align=center><img src="img/bigscuba.png"><br>Big Scuba Mask</td><td>Permenantly gives you fast underwater movement.</td>
</tr><tr><td align=center><img src="img/superumbrella.png"><br>Big Umbrella</td><td>Bestows you with an umbrella which can survive death!</td> </tr><tr><td align=center><img src="img/superumbrella.png"><br>Big Umbrella</td><td>Bestows you with an umbrella which can survive death!</td>