Added new powerup: anchor

This commit is contained in:
Rob Pearce 2008-11-22 00:21:22 +00:00
parent 06805044e8
commit a67b8515c7
8 changed files with 97 additions and 39 deletions

View File

@ -4,29 +4,33 @@ hurryup 30
help
endhelp
monsters
0 19 22
1 26 22
1 10 22
1 10 21
1 12 22
1 12 21
1 37 9
1 26 9
1 30 9
1 33 9
1 20 9
1 11 9
1 16 9
1 7 9
1 3 9
134 4 22
1 36 27
1 30 27
1 17 27
1 13 27
1 8 27
0 4 18
134 27 17
23 8 18
6 28 5
6 15 8
6 6 5
7 15 1
7 22 1
7 34 1
18 21 28
18 21 28
18 21 28
18 21 28
18 21 28
18 21 28
18 9 28
18 9 28
18 9 28
18 9 28
18 9 28
18 32 28
18 32 28
18 32 28
18 32 28
endmonsters
exitdir 1
44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
@ -35,26 +39,25 @@ exitdir 1
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
52,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,0,0,0,0,0,0,52,0,0,0,0,0,52,0,0,0,0,0,0,0,0,0,44,0,0,0,0,0,52,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,44,0,0,0,0,0,52,0,0,0,0,0,0,0,0,0,44,0,0,0,52,0,44,0,0,0,0,0,0,0,0,4,
4,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,0,0,44,44,44,44,44,44,44,69,68,68,68,68,68,68,70,4,
4,0,0,0,0,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,4,
4,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,4,
4,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,
layer2

BIN
data/sprites/anchor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 593 B

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 775 B

7
defs.h
View File

@ -361,7 +361,7 @@
#define S_SLOPE 2
// Sprite types
#define MAXPTYPES 144
#define MAXPTYPES 146
#define P_PLAYER 0
#define P_RAT 1
#define P_CHEESE 2
@ -511,6 +511,8 @@
#define P_SUNDAE 141
#define P_CAKE 142
#define P_CHOCOLATE 143
#define P_ANCHOR 144
#define P_SMALLANCHOR 145
#define FLY_FLYTIME 150
@ -570,6 +572,7 @@
#define PW_GUNNER 13 // machine gunner
#define PW_WHISTLE 14 // whistle
#define PW_CANDLE 15 // candle
#define PW_ANCHOR 16 // anchor
// "virtual" powerup for bosses
#define PW_RATSHAKE 20 // shake screen horizontally
#define PW_SNAILSHAKE 21 // shake screen vertically
@ -981,6 +984,8 @@ extern int deck[];
extern int forcegoodcard;
extern int nextforcegoodcard;
extern int globpowerup;
extern char *datadir;
#endif

View File

@ -11,6 +11,8 @@ int maxlevid;
int want1up,want2up;
int globpowerup;
int gamemode; // easy or hard?
int showhelp; // show help text?

31
rc.c
View File

@ -35,7 +35,6 @@ SDL_Surface *credittext;
int lockcredits = B_FALSE;
int globpowerup;
int globtimer;
int introstate;
@ -463,7 +462,7 @@ int main (int argc, char **argv) {
if (!paused) {
/**********************************************
* Special effects #1 - ones which change the level by
* modifiying tiles, etc.
* modifiying tiles, etc, or by moving sprites.
*/
if (globpowerup != PW_CLOCK) {
// for each animated tile on the level...
@ -1812,6 +1811,12 @@ void checkfruitcollide (sprite_t *s) {
s2->id = fruittypes[curfruittype];
s2->score = getpoints(s2->id);
// stop jumping etc
s2->jumping = B_FALSE;
s2->jumpspeed = 0;
s2->antigrav = 0;
s2->falling = 0;
/* increment fruit type */
curfruittype++;
if (fruittypes[curfruittype] == -1) {
@ -2191,6 +2196,17 @@ int movesprite(sprite_t *s) {
s->invuln--;
}
// anchor weighs down flying enemies
if (ismonster(s->id) && s->flies && !s->dead && (globpowerup == PW_ANCHOR)) {
if (s->id != P_BLACKCLOUD) {
if (!isonground(s)) {
// move down
s->y += 3;
}
}
}
if (s->caughtby) {
if (s->caughtby->slamming) {
@ -2403,7 +2419,12 @@ int movesprite(sprite_t *s) {
s->jumptimer--;
if (s->jumptimer == 0) {
s->jumping = 1;
if (globpowerup == PW_ANCHOR) {
// jump very low
s->jumpspeed = 1;
} else {
s->jumpspeed = s->willjumpspeed;
}
if (s->jumpdir != 0) s->dir = s->jumpdir;
return B_FALSE;
} else if (s->jumptimer % 20 == 0) {
@ -7223,6 +7244,12 @@ int dofruiteffect(sprite_t *pp, sprite_t *s) {
addoutlinetext(s->x,s->y - s->img->h/2, TEXTSIZE_POINTS, tempm,&white,&black,POINTSDELAY, TT_NORM);
globpowerup = PW_CANDLE;
return B_TRUE;
} else if (s->id == P_ANCHOR) {
playfx(FX_MORPH);
sprintf(tempm, "Anchor!");
addoutlinetext(s->x,s->y - s->img->h/2, TEXTSIZE_POINTS, tempm,&white,&black,POINTSDELAY, TT_NORM);
globpowerup = PW_ANCHOR;
return B_TRUE;
} else if (s->id == P_WAND) {
sprite_t *s2;

View File

@ -1538,6 +1538,12 @@ int loadimagesets(void) {
loadspriteimage(P_WHISTLE,F_WALK1, "sprites/whistle.png");
imageset[P_WHISTLE].numimages = 1;
loadspriteimage(P_ANCHOR,F_WALK1, "sprites/anchor.png");
imageset[P_ANCHOR].numimages = 1;
loadspriteimage(P_SMALLANCHOR,F_WALK1, "sprites/smallanchor.png");
imageset[P_SMALLANCHOR].numimages = 1;
loadspriteimage(P_ZAPPOWERUP,F_WALK1, "sprites/zapper.png");
imageset[P_ZAPPOWERUP].numimages = 1;
@ -2212,6 +2218,16 @@ void drawsprite(sprite_t *s) {
}
// anchor
if (globpowerup == PW_ANCHOR) {
if (ismonster(s->id) && !s->caughtby && !s->dead) {
SDL_Rect newarea;
newarea = area;
newarea.y += (s->img->h / 3);
SDL_BlitSurface(imageset[P_SMALLANCHOR].img[0], NULL, screen, &newarea);
}
}
/* caughtby lines */
@ -2414,6 +2430,7 @@ int isfruit(int id) {
case P_SKULL:
case P_GNOME:
case P_WAND:
case P_ANCHOR:
case P_CANDLE:
case P_WHISTLE:
case P_RANDOM:
@ -2471,10 +2488,11 @@ int iseffect(int id) {
case P_MASK:
case P_MOVINGCARD:
case P_FIVECARDS:
// these last two aren't REALLY effects since they never have a sprite allocated
case P_PLATFORM:
// these last ones aren't REALLY effects since they never have a sprite allocated
case P_WINGLEFT:
case P_WINGRIGHT:
case P_PLATFORM:
case P_SMALLANCHOR:
return B_TRUE;
}
@ -3144,6 +3162,8 @@ int randompowerup(void) {
return P_WHISTLE;
case 37:
return P_CANDLE;
case 38:
return P_ANCHOR;
}
}
@ -3291,6 +3311,7 @@ void setfruitinfo(void) {
setinfo(P_WAND, "Magic Wand", "A wave of the magic wand will magically polymorph all monsters into weaker ones. Anything which can't become weaker will be instantly destroyed!", "wand.png");
setinfo(P_WHISTLE, "Whistle", "Produces an extremely loud, shrill whistling noise which wakes the black cloud of doom! In its angered state, the black cloud will slaughter both friend and foe alike.", "whistle.png");
setinfo(P_CANDLE, "Candle", "Once collected, the candle will cause all enemy corpses to burst into flames, igniting any other enemy which they touch.", "candle.png");
setinfo(P_ANCHOR, "Anchor", "The extremely heavy anchor will weigh down enemies, preventing them from jumping or flying.", "anchor.png");
setinfo(P_ZAPPOWERUP, "Bug Zapper", "Zaps nearby enemies with miniature bolts of lightning", "zapper.png");
setinfo(P_SKULL, "Skull", "Avoid these at all costs! The skull will cause you to lose all net powerups.", "skull.png");
setinfo(P_CLOVER, "4-Leaf Clover", "Increases your luck...", "clover.png");