diff --git a/data/sounds/wand.wav b/data/sounds/wand.wav new file mode 100644 index 0000000..15b0671 Binary files /dev/null and b/data/sounds/wand.wav differ diff --git a/data/sprites/wand.png b/data/sprites/wand.png new file mode 100644 index 0000000..0b06c7c Binary files /dev/null and b/data/sprites/wand.png differ diff --git a/defs.h b/defs.h index 4eb2405..7647541 100644 --- a/defs.h +++ b/defs.h @@ -252,7 +252,7 @@ /* enums */ /* sounds */ -#define MAXFX 51 +#define MAXFX 52 #define FX_SHOOT 0 #define FX_SLAM 1 #define FX_KILL 2 @@ -304,6 +304,7 @@ #define FX_SNAILPREPARE 48 #define FX_WHOOSH 49 #define FX_BOOM2 50 +#define FX_WAND 51 // card suits #define CS_HEART 1 @@ -329,7 +330,7 @@ #define S_SLOPE 2 // Sprite types -#define MAXPTYPES 137 +#define MAXPTYPES 138 #define P_PLAYER 0 #define P_RAT 1 #define P_CHEESE 2 @@ -472,6 +473,7 @@ #define P_PLAYER2 134 #define P_ARMOUR2 135 // player 2 wearing armour #define P_GNOME 136 +#define P_WAND 137 #define FLY_FLYTIME 150 diff --git a/rc.c b/rc.c index 0f8eb12..0ebe3bf 100644 --- a/rc.c +++ b/rc.c @@ -6911,6 +6911,48 @@ int dofruiteffect(sprite_t *pp, sprite_t *s) { } } + return B_TRUE; + } else if (s->id == P_WAND) { + sprite_t *s2; + + playfx(FX_WAND); + sprintf(tempm, "Polymorph monsters!"); + addoutlinetext(s->x,s->y - s->img->h/2, TEXTSIZE_POINTS, tempm,&white,&black,POINTSDELAY, TT_NORM); + // turn all flowers into explosions + for (s2 = sprite; s2 ; s2 = s2->next) { + if (ismonster(s2->id)) { + int newtype = -1; + + // make it non-angry + if (s2->angry) s2->angry = B_FALSE; + + // change to a weaker version + switch (s2->id) { + case P_SNAKE: + case P_TICK: + case P_SNAIL: + case P_SLUG: + newtype = P_RAT; + break; + case P_FISH: + case P_FLY: + newtype = P_BEE; + break; + } + + if (newtype != -1) { + // morph + s2->dead = D_FINAL; + addsprite(newtype, s2->x, s2->y, "created_mon"); + } + //puffs anyway + puffin(-1, s2->x - (s2->img->w/2), s2->y, "wandpuff", rand() % 5); + puffin(-1, s2->x + (s2->img->w/2), s2->y, "wandpuff", rand() % 5); + puffin(-1, s2->x, s2->y - (s2->img->h/2), "wandpuff", rand() % 5); + puffin(-1, s2->x, s2->y + (s2->img->h/2), "wandpuff", rand() % 5); + } + } + return B_TRUE; } else if (s->id == P_ZAPPOWERUP) { sprite_t *newsp; @@ -7132,6 +7174,7 @@ int initsound(void) { loadfx(FX_SNAILPREPARE, "longdrum.wav"); loadfx(FX_WHOOSH, "whoosh.wav"); loadfx(FX_BOOM2, "boom2.wav"); + loadfx(FX_WAND, "wand.wav"); // load sound effects for (i = 0; i < MAXFX; i++) { diff --git a/shared.c b/shared.c index 88808e9..2f5adb8 100644 --- a/shared.c +++ b/shared.c @@ -1492,6 +1492,9 @@ int loadimagesets(void) { loadspriteimage(P_GNOME,F_WALK1, "sprites/gnome.png"); imageset[P_GNOME].numimages = 1; + loadspriteimage(P_WAND,F_WALK1, "sprites/wand.png"); + imageset[P_WAND].numimages = 1; + loadspriteimage(P_ZAPPOWERUP,F_WALK1, "sprites/zapper.png"); imageset[P_ZAPPOWERUP].numimages = 1; @@ -2336,6 +2339,7 @@ int isfruit(int id) { case P_ZAPPOWERUP: case P_SKULL: case P_GNOME: + case P_WAND: case P_RANDOM: return FT_TEMP; /* flowers */ @@ -2967,7 +2971,7 @@ int loadlevellist(void) { int randompowerup(void) { int num; - num = rand() % 35; + num = rand() % 36; switch (num) { case 0: @@ -3046,6 +3050,8 @@ int randompowerup(void) { return P_RANDOM; case 34: return P_GNOME; + case 35: + return P_WAND; } } @@ -3184,6 +3190,7 @@ void setfruitinfo(void) { setinfo(P_ACCORDION, "Accordion", "Makes your nets enormous", "accordion.png"); setinfo(P_GUN, "Gunner", "Temporarily equips you with a super powerful machine gun!", "gunner.png"); setinfo(P_GNOME, "Garden Gnome", "This tricky little gnome has rigged explosive devices to all flowers on the level - when collected he will detonate them!", "gnome.png"); + setinfo(P_WAND, "Magic Wand", "A wave of the magic wand will magically polymorph all monsters into weaker ones.", "wand.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"); diff --git a/website/img/wand.png b/website/img/wand.png new file mode 100644 index 0000000..6eb657c Binary files /dev/null and b/website/img/wand.png differ diff --git a/website/info.html b/website/info.html index fb1edb5..330da60 100644 --- a/website/info.html +++ b/website/info.html @@ -70,6 +70,7 @@
GunnerTemporarily equips you with a super powerful machine gun!
Bug ZapperZaps nearby enemies with miniature bolts of lightning
Garden GnomeThis tricky little gnome has rigged explosive devices to all flowers on the level - when collected he will detonate them! +
Magic WandA wave of the magic wand will magically polymorph all monsters into weaker ones. ?
RandomGives you a random effect... Super Powerups
Big Speed UpMakes you walk faster, permenantly!