- whitetail spider is now more intelligent (will turn to face player after

climbing a ladder and while falling)
- added whitetail climb image to web site
This commit is contained in:
Rob Pearce 2009-03-11 02:26:19 +00:00
parent 186d4aa387
commit 9c00e4d21b
8 changed files with 158 additions and 52 deletions

View File

@ -10,8 +10,6 @@ monsters
49 26 14 49 26 14
6 35 3 6 35 3
6 8 26 6 8 26
18 26 24
18 14 2
1 19 20 1 19 20
1 25 7 1 25 7
49 15 14 49 15 14
@ -37,6 +35,8 @@ monsters
17 17 2 17 17 2
17 22 2 17 22 2
17 22 14 17 22 14
171 14 2
171 22 24
endmonsters endmonsters
exitdir -2 exitdir -2
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,

View File

@ -4,10 +4,9 @@ hurryup 10
help help
endhelp endhelp
monsters monsters
0 38 28
134 18 15 134 18 15
171 3 25 0 17 15
171 16 20 171 4 7
endmonsters endmonsters
exitdir 1 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,
@ -18,14 +17,14 @@ exitdir 1
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,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,1,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,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, 4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0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,4, 4,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,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, 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 layer2
8,8,8
36,13,8 36,13,8
20,16,8 20,16,8
26,21,8 26,21,8

4
defs.h
View File

@ -822,6 +822,10 @@
#define HF_RED 2 #define HF_RED 2
// white spider timers
#define WS_DROPDELAY 40 // how long whitetail pauses before dropping
/* data structures */ /* data structures */
typedef struct mapping_s { typedef struct mapping_s {
char ch; char ch;

104
rc.c
View File

@ -2254,6 +2254,12 @@ void checkcollide(sprite_t *s) {
s2->caughtstate = C_NETTING; s2->caughtstate = C_NETTING;
s->netcaught++; s->netcaught++;
// special case for whitetail
if (s2->id == P_WSPIDER) {
s2->timer2 = 0;
}
// special case for bosses // special case for bosses
if (isbosslevel(curlevelnum)) { if (isbosslevel(curlevelnum)) {
if (s2->owner) { if (s2->owner) {
@ -4828,11 +4834,32 @@ printf("setting target to y = %d\n",ss->timer2);
} }
} else if (s->id == P_WSPIDER) { // white spider - very intelligent! } else if (s->id == P_WSPIDER) { // white spider - very intelligent!
// timer3 is climb direction // timer3 is climb direction
// timer2 is drop countdown
if (!s->falling) { if (!s->falling) {
int move = B_FALSE; int move = B_FALSE;
int xdiff, absxdiff; int xdiff, absxdiff;
int ladderx = isladderabove(s); int ladderx = isladderabove(s);
if (s->timer2) {
int mod,mod2;
mod = (s->timer2 / (WS_DROPDELAY/2));
s->timer2--;
if (s->timer2 == 0) {
// drop!
/* drop down */
s->dropping = B_TRUE;
s->dropx = s->x / TILEW;
s->dropy = s->y / TILEH;
} else {
mod2 = (s->timer2 / (WS_DROPDELAY/2));
if (mod2 != mod) {
// change direction
if (s->dir == D_RIGHT) s->dir = D_LEFT;
else if (s->dir == D_LEFT) s->dir = D_RIGHT;
}
}
}
/* distance to closest player */ /* distance to closest player */
xdiff = getxdisttoplayer(s, NULL); xdiff = getxdisttoplayer(s, NULL);
@ -4859,6 +4886,10 @@ printf("setting target to y = %d\n",ss->timer2);
s->falling = 0; s->falling = 0;
s->climbing = B_TRUE; s->climbing = B_TRUE;
s->moved = MV_WALK; s->moved = MV_WALK;
} else {
s->climbing = B_FALSE;
// face a player
faceplayer(s);
} }
} else { // down } else { // down
if (isonladder(s)) { if (isonladder(s)) {
@ -4871,10 +4902,11 @@ printf("setting target to y = %d\n",ss->timer2);
s->moved = MV_WALK; s->moved = MV_WALK;
} else { } else {
s->climbing = B_FALSE; s->climbing = B_FALSE;
faceplayer(s);
} }
} }
} }
} else if (ladderx && isplayerabove(s)) { // if we are at the bottom of a ladder } else if (ladderx && isplayerabovedis(s,TILEW)) { // if we are at the bottom of a ladder
// start climbing // start climbing
s->x = ladderx; // lock to ladder s->x = ladderx; // lock to ladder
s->y -= getspeed(s); s->y -= getspeed(s);
@ -4883,7 +4915,7 @@ printf("setting target to y = %d\n",ss->timer2);
s->climbing = B_TRUE; s->climbing = B_TRUE;
s->moved = MV_WALK; s->moved = MV_WALK;
s->timer3 = D_UP; s->timer3 = D_UP;
} else if (isonladder(s) && isplayerbelow(s)) { // is we are at top of ladder } else if (isonladder(s) && isplayerbelowdis(s,TILEW)) { // are we at top of ladder
int ladderx = isonladder(s); int ladderx = isonladder(s);
if (isladderbelow(s)) { if (isladderbelow(s)) {
s->y += getspeed(s); s->y += getspeed(s);
@ -4897,8 +4929,31 @@ printf("setting target to y = %d\n",ss->timer2);
} else { } else {
s->climbing = B_FALSE; s->climbing = B_FALSE;
} }
} else { } else if (!s->dropping && (s->timer2 == 0)) {
/// not climbing - walk or drop down
int willdrop = B_FALSE;
s->climbing = B_FALSE; s->climbing = B_FALSE;
// drop down?
if (isonbridge(s) && !s->falling) {
int dist = 9999;
/* player below (get the one with closest x distance)? */
if (player && !player->dead && player->y > s->y) dist = abs(player->x - s->x);
if (player2 && !player2->dead && player2->y > s->y) {
int dist2;
dist2 = abs(player2->x - s->x);
if (dist2 < dist) dist = dist2;
}
if (dist <= (TILEW*3)) {
willdrop = B_TRUE;
}
}
if (willdrop) {
s->timer2 = WS_DROPDELAY;
} else {
// walk // walk
tt = gettileat(s->x + s->dir+getspeed(s),s->y,NULL,NULL); tt = gettileat(s->x + s->dir+getspeed(s),s->y,NULL,NULL);
/* if there's a hole in front of us */ /* if there's a hole in front of us */
@ -4942,6 +4997,7 @@ printf("setting target to y = %d\n",ss->timer2);
} }
} }
}
/* moves like an angry rat all the time */ /* moves like an angry rat all the time */
@ -4971,6 +5027,7 @@ printf("setting target to y = %d\n",ss->timer2);
} }
} else { // falling } else { // falling
movex(s, s->jumpdir*getspeed(s), B_TRUE); movex(s, s->jumpdir*getspeed(s), B_TRUE);
faceplayer(s);
} }
} else if (s->id == P_SNAKE) { } else if (s->id == P_SNAKE) {
/* timer1 loopsfrom 0 - 19 /* timer1 loopsfrom 0 - 19
@ -13510,6 +13567,16 @@ sprite_t *isplayerbelow(sprite_t *s) {
return NULL; return NULL;
} }
// is there a player more than "dis" pixels below?
sprite_t *isplayerbelowdis(sprite_t *s,int dis) {
if (globpowerup == PW_CAMERA) return NULL;
if (player && !player->dead && (player->y - s->y) >= dis ) return player;
if (player2 && !player2->dead && (player2->y - s->y) >= dis) return player2;
return NULL;
}
sprite_t *isplayerabove(sprite_t *s) { sprite_t *isplayerabove(sprite_t *s) {
if (globpowerup == PW_CAMERA) return NULL; if (globpowerup == PW_CAMERA) return NULL;
@ -13519,6 +13586,18 @@ sprite_t *isplayerabove(sprite_t *s) {
return NULL; return NULL;
} }
// is there a player more than "dis" pixels above?
sprite_t *isplayerabovedis(sprite_t *s,int dis) {
if (globpowerup == PW_CAMERA) return NULL;
if (player && !player->dead && (s->y - player->y) >= dis ) return player;
if (player2 && !player2->dead && (s->y - player2->y) >= dis) return player2;
return NULL;
}
sprite_t *isplayerright(sprite_t *s) { sprite_t *isplayerright(sprite_t *s) {
if (globpowerup == PW_CAMERA) return NULL; if (globpowerup == PW_CAMERA) return NULL;
@ -13528,6 +13607,15 @@ sprite_t *isplayerright(sprite_t *s) {
return NULL; return NULL;
} }
sprite_t *isplayerleft(sprite_t *s) {
if (globpowerup == PW_CAMERA) return NULL;
if (player && !player->dead && player->x < s->x) return player;
if (player2 && !player2->dead && player2->x < s->x) return player2;
return NULL;
}
sprite_t *isplayerahead(sprite_t *s) { sprite_t *isplayerahead(sprite_t *s) {
sprite_t *seen = NULL; sprite_t *seen = NULL;
int ydis; int ydis;
@ -13559,6 +13647,16 @@ sprite_t *isplayerahead(sprite_t *s) {
return seen; return seen;
} }
// turn to face a player
void faceplayer(sprite_t *s) {
// face a player
if ((s->dir == D_RIGHT) && !isplayerright(s) && isplayerleft(s)) {
s->dir = D_LEFT;
} else if ((s->dir == D_LEFT) && !isplayerleft(s) && isplayerright(s)) {
s->dir = D_RIGHT;
}
}
SDL_Color *getcolour(int id) { SDL_Color *getcolour(int id) {
switch (id) { switch (id) {

4
rc.h
View File

@ -117,9 +117,13 @@ double getxdisttoplayer(sprite_t *s, sprite_t **pl);
double getydisttoplayer(sprite_t *s); double getydisttoplayer(sprite_t *s);
int playersalive(void); int playersalive(void);
int inintro(void); int inintro(void);
void faceplayer(sprite_t *s);
sprite_t *isplayerbelow(sprite_t *s); sprite_t *isplayerbelow(sprite_t *s);
sprite_t *isplayerbelowdis(sprite_t *s,int dis);
sprite_t *isplayerabove(sprite_t *s); sprite_t *isplayerabove(sprite_t *s);
sprite_t *isplayerabovedis(sprite_t *s,int dis);
sprite_t *isplayerright(sprite_t *s); sprite_t *isplayerright(sprite_t *s);
sprite_t *isplayerleft(sprite_t *s);
sprite_t *isplayerahead(sprite_t *s); sprite_t *isplayerahead(sprite_t *s);
SDL_Color *getcolour(int id); SDL_Color *getcolour(int id);
SDL_Color *getbgcolour(int id); SDL_Color *getbgcolour(int id);

View File

@ -3843,6 +3843,8 @@ void dumpinfo(void) {
printf("<img src=\"img/fire1.png\">"); printf("<img src=\"img/fire1.png\">");
} else if (i == P_SPIDER) { } else if (i == P_SPIDER) {
printf("<img src=\"img/newspiderfall.png\">"); printf("<img src=\"img/newspiderfall.png\">");
} else if (i == P_WSPIDER) {
printf("<img src=\"img/whitespiderclimb1.png\">");
} }
printf("<br>%s</td><td>%s</td>\n", printf("<br>%s</td><td>%s</td>\n",

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -33,7 +33,7 @@
<td width=10% align=center><img src="img/ant3.png"> <td width=10% align=center><img src="img/ant3.png">
<img src="img/fire1.png"><br>Queen Ant</td><td>After an ant has eaten enough, they become a Queen. Queens are just as fast as soldiers and can also breath fire. Furthermore, they are only one meal away from spawning additional ants!</td> <img src="img/fire1.png"><br>Queen Ant</td><td>After an ant has eaten enough, they become a Queen. Queens are just as fast as soldiers and can also breath fire. Furthermore, they are only one meal away from spawning additional ants!</td>
</tr><tr><td width=10% align=center><img src="img/whitespider.png"> </tr><tr><td width=10% align=center><img src="img/whitespider.png">
<br>Whitetail</td><td>Whitetail spiders are more intelligent than other monsters - they are aware of nearby players and will use the landscape to track them down!</td> <img src="img/whitespiderclimb1.png"><br>Whitetail</td><td>Whitetail spiders are more intelligent than other monsters - they are aware of nearby players and will use the landscape to track them down!</td>
<td colspan=2>&nbsp;</td></tr><tr bgcolor="#ffff00"><th colspan=4>Bosses</th></tr> <td colspan=2>&nbsp;</td></tr><tr bgcolor="#ffff00"><th colspan=4>Bosses</th></tr>
<tr><td align=center><img src="img/cloud.png"><br>Cloud of Doom</td><td>This unkillable cloud will appear if you spend too much time on one level. Beware, as the only way to defeat the cloud of doom is to complete the level before it grows too large to handle!</td> <tr><td align=center><img src="img/cloud.png"><br>Cloud of Doom</td><td>This unkillable cloud will appear if you spend too much time on one level. Beware, as the only way to defeat the cloud of doom is to complete the level before it grows too large to handle!</td>
<td align=center><img src="img/kingrat.png"><br>King Rat</td><td>This mighty creature is the ruler of the rats, and impervious to the player's net. It can only be harmed by slamming another monster into it! King Rat will roam the level searching for a player, and upon spotting them will charge at high speed.</td> <td align=center><img src="img/kingrat.png"><br>King Rat</td><td>This mighty creature is the ruler of the rats, and impervious to the player's net. It can only be harmed by slamming another monster into it! King Rat will roam the level searching for a player, and upon spotting them will charge at high speed.</td>