diff --git a/defs.h b/defs.h index 28e49d7..4c6387b 100644 --- a/defs.h +++ b/defs.h @@ -423,7 +423,7 @@ #define S_SLOPE 2 // Sprite types -#define MAXPTYPES 162 +#define MAXPTYPES 163 #define P_PLAYER 0 #define P_RAT 1 #define P_CHEESE 2 @@ -591,6 +591,7 @@ #define P_ANT2 159 #define P_ANT3 160 #define P_FIREBALL 161 +#define P_TOPHAT 162 #define FLY_FLYTIME 150 @@ -657,7 +658,8 @@ #define PW_CAMERA 20 // camera #define PW_SMALLNET 21 // skull #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 #define PW_RATSHAKE 50 // shake screen horizontally #define PW_SNAILSHAKE 51 // shake screen vertically diff --git a/rc.c b/rc.c index 736aa47..5a70d7a 100644 --- a/rc.c +++ b/rc.c @@ -7713,6 +7713,12 @@ void dogravity(sprite_t *s) { /* will become a fruit when it finishes dying */ if (boss) { 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 { s2->willbecome = fruittypes[curfruittype]; /* increment fruit type */ @@ -7861,14 +7867,20 @@ void dogravity(sprite_t *s) { } else if (s->powerup == PW_MACE) { s2->willbecome = P_DIAMOND; } else { // should never happen - - /* will become a fruit when it finishes dying */ - s2->willbecome = fruittypes[curfruittype]; - /* increment fruit type */ - if (fruittypes[++curfruittype] == -1) { - curfruittype = 0; + if (s->powerup == PW_TOPHAT) { + s2->willbecome = poweruptypes[curpoweruptype[getpnum(s)]]; + if (poweruptypes[++(curpoweruptype[getpnum(s)])] == -1) { + curpoweruptype[getpnum(s)] = 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) { // 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->timer1 = 5; // # of shots 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) { sprite_t *newsp; // cannon diff --git a/shared.c b/shared.c index 0509d95..4df7958 100644 --- a/shared.c +++ b/shared.c @@ -1659,6 +1659,9 @@ int loadimagesets(void) { loadspriteimage(P_RAYGUN,F_WALK1, "sprites/raygun.png"); 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"); imageset[P_GUN].numimages = 1; @@ -2593,6 +2596,7 @@ int isabilitypowerup(int id) { case P_JETPACK: case P_PILL: case P_RAYGUN: + case P_TOPHAT: return B_TRUE; } return B_FALSE; @@ -2690,6 +2694,7 @@ int isfruit(int id) { case P_CAMERA: case P_PILL: case P_RAYGUN: + case P_TOPHAT: return FT_TEMP; /* flowers */ case P_FLOWERYELLOW: @@ -3487,6 +3492,8 @@ int randompowerup(void) { return P_PILL; case 45: 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_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_MACEPOWERUP, "Mace", "Slamming your net will cause a lethal explosion!", "macepowerup.png"); diff --git a/website/info.html b/website/info.html index 1ee2da1..06adf4c 100644 --- a/website/info.html +++ b/website/info.html @@ -104,8 +104,9 @@