diff --git a/data/levels/level99.dat b/data/levels/level99.dat
index 9575eeb..eb74d8e 100644
--- a/data/levels/level99.dat
+++ b/data/levels/level99.dat
@@ -11,6 +11,7 @@ monsters
1 29 6
7 34 14
171 12 15
+172 3 10
endmonsters
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,
diff --git a/data/sprites/bat.png b/data/sprites/bat.png
new file mode 100644
index 0000000..c342a47
Binary files /dev/null and b/data/sprites/bat.png differ
diff --git a/data/sprites/bat1.png b/data/sprites/bat1.png
new file mode 100644
index 0000000..4d92515
Binary files /dev/null and b/data/sprites/bat1.png differ
diff --git a/data/sprites/batcaught.png b/data/sprites/batcaught.png
new file mode 100644
index 0000000..dbc58c7
Binary files /dev/null and b/data/sprites/batcaught.png differ
diff --git a/data/sprites/batdead.png b/data/sprites/batdead.png
new file mode 100644
index 0000000..c6bfd59
Binary files /dev/null and b/data/sprites/batdead.png differ
diff --git a/data/sprites/moth.png b/data/sprites/moth.png
deleted file mode 100644
index 014f2a6..0000000
Binary files a/data/sprites/moth.png and /dev/null differ
diff --git a/data/sprites/moth1.png b/data/sprites/moth1.png
deleted file mode 100644
index ab5a22a..0000000
Binary files a/data/sprites/moth1.png and /dev/null differ
diff --git a/data/sprites/mothcaught.png b/data/sprites/mothcaught.png
deleted file mode 100644
index 7e48caa..0000000
Binary files a/data/sprites/mothcaught.png and /dev/null differ
diff --git a/data/sprites/mothdead.png b/data/sprites/mothdead.png
deleted file mode 100644
index da43aa2..0000000
Binary files a/data/sprites/mothdead.png and /dev/null differ
diff --git a/data/sprites/mothfire0.png b/data/sprites/sonar0.png
similarity index 100%
rename from data/sprites/mothfire0.png
rename to data/sprites/sonar0.png
diff --git a/data/sprites/mothfire1.png b/data/sprites/sonar1.png
similarity index 100%
rename from data/sprites/mothfire1.png
rename to data/sprites/sonar1.png
diff --git a/data/sprites/mothfire2.png b/data/sprites/sonar2.png
similarity index 100%
rename from data/sprites/mothfire2.png
rename to data/sprites/sonar2.png
diff --git a/data/sprites/mothfire3.png b/data/sprites/sonar3.png
similarity index 100%
rename from data/sprites/mothfire3.png
rename to data/sprites/sonar3.png
diff --git a/data/sprites/mothfire4.png b/data/sprites/sonar4.png
similarity index 100%
rename from data/sprites/mothfire4.png
rename to data/sprites/sonar4.png
diff --git a/data/sprites/mothfire5.png b/data/sprites/sonar5.png
similarity index 100%
rename from data/sprites/mothfire5.png
rename to data/sprites/sonar5.png
diff --git a/defs.h b/defs.h
index 803a714..16456dc 100644
--- a/defs.h
+++ b/defs.h
@@ -289,12 +289,12 @@
#define KAS_JUMP2 7
// moth
-#define MOTH_PAUSE 20
-#define MOTH_FIRESPACE 3 // space between shots
+#define BAT_PAUSE 20
+#define BAT_FIRESPACE 3 // space between shots
// moth states
-#define MS_FLY 0
-#define MS_PAUSE1 1
-#define MS_PAUSE2 2
+#define BS_FLY 0
+#define BS_PAUSE1 1
+#define BS_PAUSE2 2
// bell states
@@ -427,7 +427,7 @@
#define FX_CHOMP 61
#define FX_GROWL 62
#define FX_LAMP 63
-#define FX_MOTHFIRE 64
+#define FX_SONAR 64
// card suits
#define CS_HEART 1
@@ -631,8 +631,8 @@
#define P_LAMP 169
#define P_GOLDBAR 170
#define P_WSPIDER 171
-#define P_MOTH 172
-#define P_MOTHFIRE 173
+#define P_BAT 172
+#define P_SONAR 173
#define FLY_FLYTIME 150
diff --git a/rc.c b/rc.c
index 0e229e5..672ab37 100644
--- a/rc.c
+++ b/rc.c
@@ -5033,11 +5033,11 @@ int movesprite(sprite_t *s) {
movex(s, s->jumpdir*getspeed(s), B_TRUE);
faceplayer(s);
}
- } else if (s->id == P_MOTH) {
+ } else if (s->id == P_BAT) {
/* timer1 tracks state, timer2 tracks previous direction
timer3 is current direction
*/
- if (s->timer1 == MS_FLY) {
+ if (s->timer1 == BS_FLY) {
if (s->timer3 == D_NONE) {
int tx,ty;
int d;
@@ -5098,9 +5098,9 @@ int movesprite(sprite_t *s) {
tt = gettileat(s->x, s->y - s->img->h - getspeed(s), NULL, NULL);
if (tt->solid) {
// hit a wall
- s->timer1 = MS_PAUSE1;
+ s->timer1 = BS_PAUSE1;
s->timer2 = s->timer3; // old dir
- s->timer3 = MOTH_PAUSE;
+ s->timer3 = BAT_PAUSE;
} else {
s->moved = MV_FLY;
s->y -= getspeed(s);
@@ -5109,9 +5109,9 @@ int movesprite(sprite_t *s) {
tt = gettileat(s->x, s->y + getspeed(s), NULL, NULL);
if (tt->solid) {
// hit a wall
- s->timer1 = MS_PAUSE1;
+ s->timer1 = BS_PAUSE1;
s->timer2 = s->timer3; // old dir
- s->timer3 = MOTH_PAUSE;
+ s->timer3 = BAT_PAUSE;
} else {
s->moved = MV_FLY;
s->y += getspeed(s);
@@ -5120,19 +5120,19 @@ int movesprite(sprite_t *s) {
s->dir = s->timer3;
if (movex(s, s->dir * getspeed(s), B_TRUE)) {
// hit a wall
- s->timer1 = MS_PAUSE1;
+ s->timer1 = BS_PAUSE1;
s->timer2 = s->timer3; // old dir
- s->timer3 = MOTH_PAUSE;
+ s->timer3 = BAT_PAUSE;
} else {
s->moved = MV_FLY;
}
}
}
- } else if (s->timer1 == MS_PAUSE1) {
+ } else if (s->timer1 == BS_PAUSE1) {
s->moved = MV_FLY;
// wait for countdown...
s->timer3--;
- if ((s->timer3 == MOTH_FIRESPACE*2) || (s->timer3 == MOTH_FIRESPACE) || (s->timer3 == 0)) {
+ if ((s->timer3 == BAT_FIRESPACE*2) || (s->timer3 == BAT_FIRESPACE) || (s->timer3 == 0)) {
sprite_t *ss,*target = NULL;
// closest player
target = getclosestplayer(s);
@@ -5141,8 +5141,8 @@ int movesprite(sprite_t *s) {
// get angle towards target
ang = atan2(target->y - s->y, target->x - s->x);
// shoot
- playfx(FX_MOTHFIRE);
- ss = addsprite(P_MOTHFIRE,s->x,s->y - s->img->h/2,"mothfire" );
+ playfx(FX_SONAR);
+ ss = addsprite(P_SONAR,s->x,s->y - s->img->h/2,"bat_sonar" );
ss->xs = cos(ang) * getspeed(ss);
ss->ys = sin(ang) * getspeed(ss);
ss->timer1 = 0;
@@ -5150,15 +5150,15 @@ int movesprite(sprite_t *s) {
}
if (s->timer3 == 0) {
// go to next state
- s->timer1 = MS_PAUSE2;
- s->timer3 = MOTH_PAUSE;
+ s->timer1 = BS_PAUSE2;
+ s->timer3 = BAT_PAUSE;
}
- } else if (s->timer1 == MS_PAUSE2) {
+ } else if (s->timer1 == BS_PAUSE2) {
s->moved = MV_FLY;
s->timer3--;
if (s->timer3 == 0) {
// go to next state
- s->timer1 = MS_FLY;
+ s->timer1 = BS_FLY;
s->timer3 = D_NONE;
}
}
@@ -5761,12 +5761,12 @@ int movesprite(sprite_t *s) {
} else if (s->x <= TILEW) {
s->dead = D_FINAL;
}
- } else if (s->id == P_MOTHFIRE) {
+ } else if (s->id == P_SONAR) {
// timer1 = frame
// update frame
if ((timer % 5) == 0) {
s->timer1++;
- if (s->timer1 >= imageset[P_MOTHFIRE].numimages) {
+ if (s->timer1 >= imageset[P_SONAR].numimages) {
s->timer1 = 0;
}
}
@@ -5776,11 +5776,11 @@ int movesprite(sprite_t *s) {
// die if it leaves screen
if (s->x >= (640-TILEW)) {
s->dead = D_FINAL;
- } else if (s->x <= (-(s->img->w/2))) {
+ } else if (s->x <= TILEW) {
s->dead = D_FINAL;
} else if (s->y >= (480+(s->img->h))) {
s->dead = D_FINAL;
- } else if (s->y <= 0) {
+ } else if (s->y <= TILEH) {
s->dead = D_FINAL;
}
} else if (s->id == P_RAYGUNBULLET) {
@@ -6917,10 +6917,10 @@ double getspeed(sprite_t *s ) {
} else if (id == P_SPIDER) {
if (s->angry) speed = 2;
else speed = 1.5;
- } else if (id == P_MOTH) {
+ } else if (id == P_BAT) {
if (s->angry) speed = 3;
else speed = 2.5;
- } else if (id == P_MOTHFIRE) {
+ } else if (id == P_SONAR) {
speed = 2.5;
} else if (id == P_KINGRAT) {
speed = 1.5;
@@ -9762,7 +9762,7 @@ int initsound(void) {
loadfx(FX_CHOMP, "chomp.wav");
loadfx(FX_GROWL, "growl.wav");
loadfx(FX_LAMP, "lamp.wav");
- loadfx(FX_MOTHFIRE, "pea.wav");
+ loadfx(FX_SONAR, "pea.wav");
// load sound effects
for (i = 0; i < MAXFX; i++) {
diff --git a/shared.c b/shared.c
index 49ebfb9..b8e7283 100644
--- a/shared.c
+++ b/shared.c
@@ -862,8 +862,8 @@ void setdefaults(sprite_t *s) {
s->timer1 = KAS_WALK1;
s->timer2 = KA_WALKTIME;
s->timer3 = KA_SHOOTTIME;
- } else if (s->id == P_MOTH) {
- s->timer1 = MS_FLY;
+ } else if (s->id == P_BAT) {
+ s->timer1 = BS_FLY;
s->timer2 = D_NONE;
s->timer3 = D_NONE;
}
@@ -879,7 +879,7 @@ void setdefaults(sprite_t *s) {
case P_BLACKCLOUD:
case P_SPIDER:
case P_KINGFLY:
- case P_MOTH:
+ case P_BAT:
s->flies = B_TRUE;
break;
case P_FLY:
@@ -1452,13 +1452,13 @@ int loadimagesets(void) {
loadspriteimage(P_WSPIDER,F_CLIMB2, "sprites/whitespiderclimb1.png");
imageset[P_WSPIDER].numimages = 10;
- loadspriteimage(P_MOTH,F_WALK1, "sprites/moth.png");
- loadspriteimage(P_MOTH,F_JUMP, "sprites/moth1.png");
- loadspriteimage(P_MOTH,F_FALL, "sprites/moth1.png");
- loadspriteimage(P_MOTH,F_CAUGHT, "sprites/mothcaught.png");
- loadspriteimage(P_MOTH,F_DEAD, "sprites/mothdead.png");
+ loadspriteimage(P_BAT,F_WALK1, "sprites/bat.png");
+ loadspriteimage(P_BAT,F_JUMP, "sprites/bat1.png");
+ loadspriteimage(P_BAT,F_FALL, "sprites/bat1.png");
+ loadspriteimage(P_BAT,F_CAUGHT, "sprites/batcaught.png");
+ loadspriteimage(P_BAT,F_DEAD, "sprites/batdead.png");
/* next 3 are auto generated */
- imageset[P_MOTH].numimages = 8;
+ imageset[P_BAT].numimages = 8;
loadspriteimage(P_SPIDER,F_WALK1, "sprites/newspider.png");
@@ -1949,17 +1949,17 @@ int loadimagesets(void) {
loadspriteimage(P_BIGFIREBALL,1, "sprites/bigfire2.png");
imageset[P_BIGFIREBALL].numimages = 2;
- loadspriteimage(P_MOTHFIRE,0, "sprites/mothfire0.png");
- loadspriteimage(P_MOTHFIRE,1, "sprites/mothfire1.png");
- loadspriteimage(P_MOTHFIRE,2, "sprites/mothfire2.png");
- loadspriteimage(P_MOTHFIRE,3, "sprites/mothfire3.png");
- loadspriteimage(P_MOTHFIRE,4, "sprites/mothfire4.png");
- loadspriteimage(P_MOTHFIRE,5, "sprites/mothfire5.png");
- loadspriteimage(P_MOTHFIRE,6, "sprites/mothfire4.png");
- loadspriteimage(P_MOTHFIRE,7, "sprites/mothfire3.png");
- loadspriteimage(P_MOTHFIRE,8, "sprites/mothfire2.png");
- loadspriteimage(P_MOTHFIRE,9, "sprites/mothfire1.png");
- imageset[P_MOTHFIRE].numimages = 10;
+ loadspriteimage(P_SONAR,0, "sprites/sonar0.png");
+ loadspriteimage(P_SONAR,1, "sprites/sonar1.png");
+ loadspriteimage(P_SONAR,2, "sprites/sonar2.png");
+ loadspriteimage(P_SONAR,3, "sprites/sonar3.png");
+ loadspriteimage(P_SONAR,4, "sprites/sonar4.png");
+ loadspriteimage(P_SONAR,5, "sprites/sonar5.png");
+ loadspriteimage(P_SONAR,6, "sprites/sonar4.png");
+ loadspriteimage(P_SONAR,7, "sprites/sonar3.png");
+ loadspriteimage(P_SONAR,8, "sprites/sonar2.png");
+ loadspriteimage(P_SONAR,9, "sprites/sonar1.png");
+ imageset[P_SONAR].numimages = 10;
// manual angry image for black cloud
@@ -2122,7 +2122,7 @@ void drawsprite(sprite_t *s) {
if (isfruit(s->id)) {
frame = F_WALK1;
} else if (isbullet(s->id)) {
- if (s->id == P_MOTHFIRE) {
+ if (s->id == P_SONAR) {
frame = s->timer1;
} else {
if ((timer/6) % 2 == 0) {
@@ -2846,7 +2846,7 @@ int isbullet(int id) {
if (id == P_SPIT) return B_TRUE;
if (id == P_FIREBALL) return B_TRUE;
if (id == P_BIGFIREBALL) return B_TRUE;
- if (id == P_MOTHFIRE) return B_TRUE;
+ if (id == P_SONAR) return B_TRUE;
return B_FALSE;
}
@@ -3306,7 +3306,7 @@ int ismonster(int id) {
case P_ANT1:
case P_ANT2:
case P_ANT3:
- case P_MOTH:
+ case P_BAT:
return MT_MONSTER;
case P_BLACKCLOUD:
case P_KINGRAT:
@@ -3822,7 +3822,7 @@ void setfruitinfo(void) {
setinfo(P_SPIDER, "Redback", "Redback spiders will lurk quietly on the ceiling, crawling back and forth. If they notice a player nearby however they will swiftly pounce down onto their prey!", "spider.png");
setinfo(P_WSPIDER, "Whitetail", "Whitetail spiders are more intelligent than other monsters - they are aware of nearby players and will use the landscape to track them down!", "whitespider.png");
- setinfo(P_MOTH, "Moth", "The moth moves in straight lines until it hits a wall. Although simplistic in their movement, moths have the ability to fire a burst of hypno-rays to take out an unwary player!", "moth.png");
+ setinfo(P_BAT, "Bat", "The bat moves in a straight line until it hits a wall. Although simplistic in their movement, bats have the ability to fire a burst of sonar to take out an unwary player!", "bat.png");
setinfo(P_FROG, "Frog", "Green frogs will continually bounce around, making them more difficult to catch. They are also excellent swimmers.", "frog.png");
@@ -3909,8 +3909,8 @@ void dumpinfo(void) {
printf("");
} else if (i == P_WSPIDER) {
printf("");
- } else if (i == P_MOTH) {
- printf("");
+ } else if (i == P_BAT) {
+ printf("");
}
printf("
%s