Added powerup: accordion (makes net super-super long)

This commit is contained in:
Rob Pearce 2008-10-18 04:16:06 +00:00
parent 17dfeed71e
commit ea3cf4e16b
3 changed files with 35 additions and 6 deletions

6
defs.h
View File

@ -108,6 +108,8 @@
#define SHIELDTIME 500 // how long a shield lasts #define SHIELDTIME 500 // how long a shield lasts
#define FALLSPEED 4 // terminal velocity of falling sprites #define FALLSPEED 4 // terminal velocity of falling sprites
#define NETSPEED 9 // how fast the player's net moves #define NETSPEED 9 // how fast the player's net moves
#define BIGNETSPEED 12 // how fast the player's net moves with bignet
#define ACCNETSPEED 28 // how fast the player's net moves with accordion
#define POWERUPTIME 15 // # secs before a powerup appears #define POWERUPTIME 15 // # secs before a powerup appears
#define PLAYERFAST 2 // how fast player goes with speed powerup #define PLAYERFAST 2 // how fast player goes with speed powerup
@ -283,7 +285,7 @@
#define S_SLOPE 2 #define S_SLOPE 2
// Sprite types // Sprite types
#define MAXPTYPES 119 #define MAXPTYPES 120
#define P_PLAYER 0 #define P_PLAYER 0
#define P_RAT 1 #define P_RAT 1
#define P_CHEESE 2 #define P_CHEESE 2
@ -408,6 +410,7 @@
#define P_MOVINGCARD 116 #define P_MOVINGCARD 116
#define P_FIVECARDS 117 #define P_FIVECARDS 117
#define P_CLOVER 118 #define P_CLOVER 118
#define P_ACCORDION 119
// cards // cards
#define CARDFONTX 4 #define CARDFONTX 4
@ -440,6 +443,7 @@
#define PW_CANNON 9 // fusion cannon #define PW_CANNON 9 // fusion cannon
#define PW_CANNONFIRE 10 // fusion cannon firing #define PW_CANNONFIRE 10 // fusion cannon firing
#define PW_PHONE 11 // skip level #define PW_PHONE 11 // skip level
#define PW_ACCORDION 12 // super long net
// "virtual" powerup for bosses // "virtual" powerup for bosses
#define PW_RATSHAKE 20 // shake screen horizontally #define PW_RATSHAKE 20 // shake screen horizontally

26
rc.c
View File

@ -4181,9 +4181,19 @@ void dogravity(sprite_t *s) {
} }
if (s->netting) { if (s->netting) {
s->netlen += s->netspeed; if (s->powerup == PW_ACCORDION) {
if (s->netspeed > 0) {
s->netlen += s->netspeed;
} else {
s->netlen += (s->netspeed*2);
}
} else {
s->netlen += s->netspeed;
}
s->netting++; s->netting++;
if (s->netting % 2 == 0) {
if ((s->powerup == PW_ACCORDION) || (s->netting % 2 == 0)) {
if (s->netspeed > -NETSPEED) { if (s->netspeed > -NETSPEED) {
s->netspeed--; s->netspeed--;
} else { } else {
@ -4988,6 +4998,12 @@ int dofruiteffect(sprite_t *s) {
nextforcegoodcard = B_TRUE; nextforcegoodcard = B_TRUE;
forcegoodcard = B_TRUE; forcegoodcard = B_TRUE;
return B_TRUE; return B_TRUE;
} else if (s->id == P_ACCORDION) {
playfx(FX_POWERUP);
sprintf(tempm, "Extra Long Net!");
addoutlinetext(s->x,s->y - s->img->h/2, TEXTSIZE_POINTS, tempm,&white,&black,POINTSDELAY, TT_NORM);
player->powerup = PW_ACCORDION;
return B_TRUE;
} else if (s->id == P_HELP) { } else if (s->id == P_HELP) {
playfx(FX_POWERUP); playfx(FX_POWERUP);
// TODO: move other HELP text around if need be! // TODO: move other HELP text around if need be!
@ -6765,8 +6781,10 @@ void trytoshoot(sprite_t *pl) {
pl->netting = 1; pl->netting = 1;
adjustx(pl, F_SHOOT); adjustx(pl, F_SHOOT);
if (pl->netbig) { if (pl->powerup == PW_ACCORDION) {
pl->netspeed = NETSPEED+3; pl->netspeed = ACCNETSPEED;
} else if (pl->netbig) {
pl->netspeed = BIGNETSPEED;
} else { } else {
pl->netspeed = NETSPEED; pl->netspeed = NETSPEED;
} }

View File

@ -1271,6 +1271,9 @@ int loadimagesets(void) {
loadspriteimage(P_CLOVER,F_WALK1, "sprites/clover.png"); loadspriteimage(P_CLOVER,F_WALK1, "sprites/clover.png");
imageset[P_CLOVER].numimages = 1; imageset[P_CLOVER].numimages = 1;
loadspriteimage(P_ACCORDION,F_WALK1, "sprites/accordion.png");
imageset[P_ACCORDION].numimages = 1;
loadspriteimage(P_BIGSPEED,F_WALK1, "sprites/bigspeed.png"); loadspriteimage(P_BIGSPEED,F_WALK1, "sprites/bigspeed.png");
imageset[P_BIGSPEED].numimages = 1; imageset[P_BIGSPEED].numimages = 1;
@ -1883,6 +1886,7 @@ int isfruit(int id) {
case P_SPRAY: case P_SPRAY:
case P_CANNONPOWERUP: case P_CANNONPOWERUP:
case P_CLOVER: case P_CLOVER:
case P_ACCORDION:
return FT_TEMP; return FT_TEMP;
/* flowers */ /* flowers */
case P_FLOWERYELLOW: case P_FLOWERYELLOW:
@ -2492,7 +2496,7 @@ int loadlevellist(void) {
int randompowerup(void) { int randompowerup(void) {
int num; int num;
num = rand() % 28; num = rand() % 29;
switch (num) { switch (num) {
case 0: case 0:
@ -2552,6 +2556,8 @@ int randompowerup(void) {
return getrandomcard(); return getrandomcard();
case 27: case 27:
return P_CLOVER; return P_CLOVER;
case 28:
return P_ACCORDION;
} }
} }
@ -2680,6 +2686,7 @@ void setfruitinfo(void) {
setinfo(P_LIFE, "Life", "Awards the player an extra life.", "extralife.png"); setinfo(P_LIFE, "Life", "Awards the player an extra life.", "extralife.png");
setinfo(P_UFO, "UFO", "Calls in a powerful meteor strike!", "ufo.png"); setinfo(P_UFO, "UFO", "Calls in a powerful meteor strike!", "ufo.png");
setinfo(P_TAP, "Tap", "The leaky tap will flood the level with water, allowing you to acces hard to reach areas.", "tap.png"); setinfo(P_TAP, "Tap", "The leaky tap will flood the level with water, allowing you to acces hard to reach areas.", "tap.png");
setinfo(P_ACCORDION, "Accordion", "Makes your nets enormous", "accordion.png");
setinfo(P_CLOVER, "4-Leaf Clover", "Increases your luck...", "clover.png"); setinfo(P_CLOVER, "4-Leaf Clover", "Increases your luck...", "clover.png");