Initial work for new boss: King Ant

This commit is contained in:
Rob Pearce 2009-03-04 21:22:28 +00:00
parent 8c31b2eb26
commit 6175ce4859
8 changed files with 213 additions and 3 deletions

159
data/levels/level620.dat Normal file
View File

@ -0,0 +1,159 @@
bgfile snow2.png
bg 0
hurryup 30
help
endhelp
monsters
0 2 16
134 37 16
163 7 28
163 7 28
163 7 28
163 7 28
endmonsters
exitdir 1
91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,
91,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,91,
91,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,91,
91,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,91,
91,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,91,
91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,
90,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,90,
90,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,90,
90,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,90,
90,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,90,
90,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,90,
90,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,90,
90,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,90,
90,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,90,
90,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,90,
90,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,90,
90,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,90,
90,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,90,
90,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,90,
90,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,90,
90,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,90,
90,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,90,
90,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,90,
90,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,90,
90,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,90,
91,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,91,
91,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,91,
91,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,91,
91,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,91,
91,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,91,
layer2
1,1,95,layer3
3,1,95,layer3
5,1,95,layer3
7,1,95,layer3
9,1,95,layer3
11,1,95,layer3
13,1,95,layer3
15,1,95,layer3
17,1,95,layer3
19,1,95,layer3
21,1,95,layer3
23,1,95,layer3
25,1,95,layer3
27,1,95,layer3
29,1,95,layer3
31,1,95,layer3
33,1,95,layer3
35,1,95,layer3
37,1,95,layer3
1,2,95,layer3
3,2,95,layer3
5,2,95,layer3
7,2,95,layer3
9,2,95,layer3
11,2,95,layer3
13,2,95,layer3
15,2,95,layer3
17,2,95,layer3
19,2,95,layer3
21,2,95,layer3
23,2,95,layer3
25,2,95,layer3
27,2,95,layer3
29,2,95,layer3
31,2,95,layer3
33,2,95,layer3
35,2,95,layer3
37,2,95,layer3
1,3,95,layer3
3,3,95,layer3
5,3,95,layer3
7,3,95,layer3
9,3,95,layer3
11,3,95,layer3
13,3,95,layer3
15,3,95,layer3
17,3,95,layer3
19,3,95,layer3
21,3,95,layer3
23,3,95,layer3
25,3,95,layer3
27,3,95,layer3
29,3,95,layer3
31,3,95,layer3
33,3,95,layer3
35,3,95,layer3
37,3,95,layer3
1,26,95,layer3
3,26,95,layer3
5,26,95,layer3
7,26,95,layer3
9,26,95,layer3
11,26,95,layer3
13,26,95,layer3
15,26,95,layer3
17,26,95,layer3
19,26,95,layer3
21,26,95,layer3
23,26,95,layer3
25,26,95,layer3
27,26,95,layer3
29,26,95,layer3
31,26,95,layer3
33,26,95,layer3
35,26,95,layer3
37,26,95,layer3
1,27,95,layer3
3,27,95,layer3
5,27,95,layer3
7,27,95,layer3
9,27,95,layer3
11,27,95,layer3
13,27,95,layer3
15,27,95,layer3
17,27,95,layer3
19,27,95,layer3
21,27,95,layer3
23,27,95,layer3
25,27,95,layer3
27,27,95,layer3
29,27,95,layer3
31,27,95,layer3
33,27,95,layer3
35,27,95,layer3
37,27,95,layer3
1,28,95,layer3
3,28,95,layer3
5,28,95,layer3
7,28,95,layer3
9,28,95,layer3
11,28,95,layer3
13,28,95,layer3
15,28,95,layer3
17,28,95,layer3
19,28,95,layer3
21,28,95,layer3
23,28,95,layer3
25,28,95,layer3
27,28,95,layer3
29,28,95,layer3
31,28,95,layer3
33,28,95,layer3
35,28,95,layer3
37,28,95,layer3

View File

@ -76,6 +76,7 @@
615,level615.dat,Raaa!
618,level618.dat,Secret Exit
619,level619.dat,Slow and steady...
620,level620.dat,King Ant
109,level109.dat,THE END SO FAR
99,level99.dat,TEST LEVEL
0,intro.dat,INTRO

BIN
data/sprites/kingant.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

9
defs.h
View File

@ -269,6 +269,11 @@
#define KFS_VERTPUSH 7
#define KFS_VERT 8
// king ant
#define KA_WALKTIME 200
// king ant stats
#define KAS_WALK1 0
// bell states
#define BELL_DONESOUND 1
#define BELL_DONEFLASH 2
@ -423,7 +428,7 @@
#define S_SLOPE 2
// Sprite types
#define MAXPTYPES 163
#define MAXPTYPES 165
#define P_PLAYER 0
#define P_RAT 1
#define P_CHEESE 2
@ -592,6 +597,8 @@
#define P_ANT3 160
#define P_FIREBALL 161
#define P_TOPHAT 162
#define P_KINGANT 163
#define P_FLAME 164 // like mace smash but harmless
#define FLY_FLYTIME 150

19
rc.c
View File

@ -2736,7 +2736,7 @@ int movesprite(sprite_t *s) {
s->dir = -s->dir;
}
}
} else if (s->id == P_SMASH) {
} else if ((s->id == P_SMASH) || (s->id == P_FLAME)) {
// still delaying
if (s->timer1 < 0) {
// increment "frame"
@ -4446,6 +4446,23 @@ printf("setting target to y = %d\n",ss->timer2);
s->timer2 = KF_FLYTIME;
}
}
} else if (s->id == P_KINGANT) {
/*
- Move back and forth for a while
- spawn out ants if not enough
- Jump to top, destroying platforms
- Move back and forth for a while
- spawn out ant food
- Jump to bottom, destroying platforms
*/
// add flames on it
if (( timer % 2) == 0) {
addsprite(P_FLAME, s->x + (rand() % s->img->w) - (s->img->w/2),
s->y - (s->img->h/2) + (rand() % s->img->h/2), "antflame");
}
} else if (s->id == P_PLATFORM) { // moving platform
// timer1 tells whether we are at top speed
double dstx,dsty;

View File

@ -856,6 +856,10 @@ void setdefaults(sprite_t *s) {
s->timer3 = 0;
s->xs = -99;
s->ys = -99;
} else if (s->id == P_KINGANT) {
s->timer1 = KAS_WALK1;
s->timer2 = KA_WALKTIME;
s->timer3 = 0;
}
if (isboss(s->id)) {
s->lives = getbosshealth(s->id); // health
@ -1461,6 +1465,13 @@ int loadimagesets(void) {
imageset[P_KINGFLY].numimages = 8;
loadspriteimage(P_KINGANT,F_WALK1, "sprites/kingant.png");
loadspriteimage(P_KINGANT,F_JUMP, "sprites/kingantjump.png");
loadspriteimage(P_KINGANT,F_FALL, "sprites/kingantjump.png");
loadspriteimage(P_KINGANT,F_CAUGHT, "sprites/kingant.png");
loadspriteimage(P_KINGANT,F_DEAD, "sprites/kingantdead.png");
/* next 3 are auto generated */
imageset[P_KINGANT].numimages = 8;
loadspriteimage(P_KSSHELL,F_WALK1, "sprites/kingsnail_shell.png");
imageset[P_KSSHELL].numimages = 1;
@ -1772,6 +1783,14 @@ int loadimagesets(void) {
imageset[P_SMASH].numimages = EXPFRAMES;
for (i = 0; i < EXPFRAMES; i++) {
char name[SMALLBUFLEN];
sprintf(name, "sprites/exp%d.png",i);
loadspriteimage(P_FLAME,i, name);
}
imageset[P_FLAME].numimages = EXPFRAMES;
// playing card bonuses
//loadspriteimage(P_CARDHK,F_WALK1, "sprites/cardhk.png");
@ -2020,7 +2039,7 @@ void drawsprite(sprite_t *s) {
frame = F_JUMP;
}
} else if (iseffect(s->id)) {
if ((s->id == P_PUFF) || (s->id == P_SMASH) || (s->id == P_SPARKLE)) {
if ((s->id == P_PUFF) || (s->id == P_SMASH) || (s->id == P_SPARKLE) || (s->id == P_FLAME) ) {
if (s->timer1 >= imageset[s->id].numimages) {
frame = imageset[s->id].numimages - 1;
} else if (s->timer1 < 0) {
@ -2744,6 +2763,7 @@ int iseffect(int id) {
case P_PUFF:
case P_SPARKLE:
case P_SMASH:
case P_FLAME:
case P_KSSHELL:
case P_POWERUPPOS:
case P_GLOVE:
@ -3188,6 +3208,7 @@ int ismonster(int id) {
case P_KINGRAT:
case P_KINGSNAIL:
case P_KINGFLY:
case P_KINGANT:
return MT_BOSS;
}
@ -3536,6 +3557,7 @@ int isboss(int monid) {
case P_KINGRAT:
case P_KINGSNAIL:
case P_KINGFLY:
case P_KINGANT:
return B_TRUE;
default:
return B_FALSE;
@ -3550,6 +3572,7 @@ int isnettable(sprite_t *s) {
case P_KINGRAT:
case P_KINGSNAIL:
case P_KINGFLY:
case P_KINGANT:
return B_FALSE;
default:
return B_TRUE;
@ -3571,6 +3594,8 @@ int getbosshealth(int mid) {
return 8;
case P_KINGFLY:
return 8;
case P_KINGANT:
return 8;
}
return 0;
}
@ -3702,6 +3727,7 @@ void setfruitinfo(void) {
setinfo(P_KINGSNAIL, "King Snail", "The absolute ruler of the snail kingdom is far too large and heavy to catch in a net. In addition, its shell provides protection against all attacks, leaving only its head vulnerable. While King Snail is too proud to chase down enemies itself, it can use its snail army to destroy its foes.", "kingsnail.png");
setinfo(P_KINGFLY, "King Fly", "King Fly is quite literally the lord of the flies. Far from the timid garden-variety fly, King Fly will roam around with its entourage of underlings in tow, running down anything in its path!", "kingfly.png");
setinfo(P_KINGANT, "King Ant", "All ants bow down to King Ant, the ultimate ant overlord. King Ant is an anormous fire ant, endlessly covered in flames and able to create ant sustenance from its body. In addition, it can transform itself into a flying ball of fire, instantly melting through any nearby ice.", "kingant.png");
setinfo(P_SNAIL, "Snail", "Snails are slow moving but tough. When attacked normally they will not die, but simply lose their shell and become a slug. The safest way to take them out is to slam another monster into them, thus killing them instantly.", "snail.png");
setinfo(P_SLUG, "Slug", "Slugs are faster moving than snails and capable of launching themselves through the air at their prey!", "slug.png");