diff --git a/data/sounds/boom2.wav b/data/sounds/boom2.wav new file mode 100644 index 0000000..3c813a4 Binary files /dev/null and b/data/sounds/boom2.wav differ diff --git a/data/sprites/exp0.png b/data/sprites/exp0.png new file mode 100644 index 0000000..2350af8 Binary files /dev/null and b/data/sprites/exp0.png differ diff --git a/data/sprites/exp1.png b/data/sprites/exp1.png new file mode 100644 index 0000000..1a5ad0c Binary files /dev/null and b/data/sprites/exp1.png differ diff --git a/data/sprites/exp2.png b/data/sprites/exp2.png new file mode 100644 index 0000000..b05f00a Binary files /dev/null and b/data/sprites/exp2.png differ diff --git a/data/sprites/exp3.png b/data/sprites/exp3.png new file mode 100644 index 0000000..b05f00a Binary files /dev/null and b/data/sprites/exp3.png differ diff --git a/data/sprites/exp4.png b/data/sprites/exp4.png new file mode 100644 index 0000000..72ed7f6 Binary files /dev/null and b/data/sprites/exp4.png differ diff --git a/data/sprites/exp5.png b/data/sprites/exp5.png new file mode 100644 index 0000000..a063eab Binary files /dev/null and b/data/sprites/exp5.png differ diff --git a/data/sprites/exp6.png b/data/sprites/exp6.png new file mode 100644 index 0000000..9e2cdbe Binary files /dev/null and b/data/sprites/exp6.png differ diff --git a/data/sprites/gnome.png b/data/sprites/gnome.png new file mode 100644 index 0000000..5717a56 Binary files /dev/null and b/data/sprites/gnome.png differ diff --git a/defs.h b/defs.h index 84c946a..4eb2405 100644 --- a/defs.h +++ b/defs.h @@ -26,6 +26,9 @@ #define PUFFSPEED 4 // how fast it animates (smaller = faster) #define PUFFAPPEAR 4 // frame at which puff will turn into a gem +// explosion +#define EXPFRAMES 7 + // shuriken #define STARFRAMES 5 #define STARSPEED 3 @@ -249,7 +252,7 @@ /* enums */ /* sounds */ -#define MAXFX 50 +#define MAXFX 51 #define FX_SHOOT 0 #define FX_SLAM 1 #define FX_KILL 2 @@ -300,6 +303,7 @@ #define FX_ZAP 47 #define FX_SNAILPREPARE 48 #define FX_WHOOSH 49 +#define FX_BOOM2 50 // card suits #define CS_HEART 1 @@ -325,7 +329,7 @@ #define S_SLOPE 2 // Sprite types -#define MAXPTYPES 136 +#define MAXPTYPES 137 #define P_PLAYER 0 #define P_RAT 1 #define P_CHEESE 2 @@ -467,6 +471,7 @@ #define P_FLY 133 #define P_PLAYER2 134 #define P_ARMOUR2 135 // player 2 wearing armour +#define P_GNOME 136 #define FLY_FLYTIME 150 diff --git a/rc.c b/rc.c index 03eaca3..f1008fd 100644 --- a/rc.c +++ b/rc.c @@ -2224,7 +2224,40 @@ int movesprite(sprite_t *s) { s->dir = -s->dir; } } - } else if ((s->id == P_PUFF) || (s->id == P_SMASH) || (s->id == P_SPARKLE)) { + } else if (s->id == P_SMASH) { + // still delaying + if (s->timer1 < 0) { + // increment "frame" + s->timer1++; + } else { + // increment frame at a slower pace + if (++s->timer2 >= 10) { + s->timer2 = 0; + } + if (timer % PUFFSPEED == 0) { + s->timer1++; + // finished animating + if (s->timer1 == imageset[s->id].numimages) { + s->timer1 = 999; // for debugging + s->dead = D_FINAL; + } + } + } + } else if (s->id == P_MOVINGCARD) { + // timer1 is the actual cardid + // timer2 is the target x position + // timer3 is the target y position + // + + // move towards end position + moveto(s, s->timer2, s->timer3, CARDSPEED, CARDSPEED); + + // are we there yet? + if ((s->x == s->timer2) && (s->y == s->timer3)) { + gaincard(s->owner, s->timer1); + s->dead = D_FINAL; + } + } else if ((s->id == P_PUFF) || (s->id == P_SPARKLE)) { /* SUMMARY: timer1: indicates current frame. if < 0, don't draw. @@ -6859,6 +6892,22 @@ int dofruiteffect(sprite_t *pp, sprite_t *s) { gunorigx[1] = player2->x; gunorigy[1] = player2->y; } + return B_TRUE; + } else if (s->id == P_GNOME) { + sprite_t *s2; + playfx(FX_BOOM2); + sprintf(tempm, "Exploding Flowers!"); + addoutlinetext(s->x,s->y - s->img->h/2, TEXTSIZE_POINTS, tempm,&white,&black,POINTSDELAY, TT_NORM); + puffin(-1, s->x, s->y, "gnomepuff", 0); + // turn all flowers into explosions + for (s2 = sprite; s2 ; s2 = s2->next) { + if (isflower(s2->id)) { + // replace with an explosion + s2->dead = D_FINAL; + addsprite(P_SMASH, s2->x, s2->y, "gnom_exp"); + } + } + return B_TRUE; } else if (s->id == P_ZAPPOWERUP) { sprite_t *newsp; @@ -7079,6 +7128,7 @@ int initsound(void) { loadfx(FX_ZAP, "zap.wav"); loadfx(FX_SNAILPREPARE, "longdrum.wav"); loadfx(FX_WHOOSH, "whoosh.wav"); + loadfx(FX_BOOM2, "boom2.wav"); // load sound effects for (i = 0; i < MAXFX; i++) { diff --git a/shared.c b/shared.c index a39b189..2e83266 100644 --- a/shared.c +++ b/shared.c @@ -1489,6 +1489,9 @@ int loadimagesets(void) { loadspriteimage(P_GUN,F_WALK1, "sprites/gunner.png"); imageset[P_GUN].numimages = 1; + loadspriteimage(P_GNOME,F_WALK1, "sprites/gnome.png"); + imageset[P_GNOME].numimages = 1; + loadspriteimage(P_ZAPPOWERUP,F_WALK1, "sprites/zapper.png"); imageset[P_ZAPPOWERUP].numimages = 1; @@ -1538,11 +1541,16 @@ int loadimagesets(void) { char name[SMALLBUFLEN]; sprintf(name, "sprites/puff%d.png",i); loadspriteimage(P_PUFF,i, name); - sprintf(name, "sprites/puff%d.png",i); - loadspriteimage(P_SMASH,i, name); } imageset[P_PUFF].numimages = PUFFFRAMES; - imageset[P_SMASH].numimages = PUFFFRAMES; + + for (i = 0; i < EXPFRAMES; i++) { + char name[SMALLBUFLEN]; + sprintf(name, "sprites/exp%d.png",i); + loadspriteimage(P_SMASH,i, name); + } + + imageset[P_SMASH].numimages = EXPFRAMES; // playing card bonuses //loadspriteimage(P_CARDHK,F_WALK1, "sprites/cardhk.png"); @@ -2327,6 +2335,7 @@ int isfruit(int id) { case P_GUN: case P_ZAPPOWERUP: case P_SKULL: + case P_GNOME: case P_RANDOM: return FT_TEMP; /* flowers */ @@ -2958,7 +2967,7 @@ int loadlevellist(void) { int randompowerup(void) { int num; - num = rand() % 34; + num = rand() % 35; switch (num) { case 0: @@ -3035,6 +3044,8 @@ int randompowerup(void) { return P_ZAPPOWERUP; case 33: return P_RANDOM; + case 34: + return P_GNOME; } } @@ -3172,6 +3183,7 @@ void setfruitinfo(void) { setinfo(P_TAP, "Tap", "The leaky tap will flood the level with water for 20 seconds, allowing you to access hard to reach areas.", "tap.png"); 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_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/gnome.png b/website/img/gnome.png new file mode 100644 index 0000000..7268022 Binary files /dev/null and b/website/img/gnome.png differ diff --git a/website/info.html b/website/info.html index f256704..103fa9a 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 ?
RandomGives you a random effect... +
Garden GnomeThis tricky little gnome has rigged explosive devices to all flowers on the level - when collected he will detonate them! Super Powerups
Big Speed UpMakes you walk faster, permenantly!
Big Scuba MaskPermenantly gives you fast underwater movement.