- Changed cloud.png to be small version of blackcloud.png (for use in doco)

- Music now dims when you enter the water
- You now get permenant shoes when you beat king rat
This commit is contained in:
Rob Pearce 2008-10-10 05:29:35 +00:00
parent 89c4bec31e
commit 9949690935
4 changed files with 55 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 538 B

After

Width:  |  Height:  |  Size: 5.5 KiB

5
defs.h
View File

@ -227,7 +227,7 @@
#define S_SLOPE 2
// Sprite types
#define MAXPTYPES 59
#define MAXPTYPES 60
#define P_PLAYER 0
#define P_RAT 1
#define P_CHEESE 2
@ -287,6 +287,7 @@
#define P_STAR 56
#define P_UFO 57
#define P_METEOR 58
#define P_BIGSPEED 59
// powerups
#define PW_NONE 0
@ -513,6 +514,8 @@ typedef struct sprite_s {
int netsticky; // can net pick up powerups?
int powerup; // what temp powerup does the player have?
int permspeed; // got the permenant speed powerup?
int ontramp; // on a trampoline?
int trampx; // x,y coords for trampoline we are/were on
int trampy; //

37
rc.c
View File

@ -1232,6 +1232,13 @@ void die(sprite_t *s) {
s->timer2 = 0;
// death timer
s->timer3 = BOSSDIETIME;
// give a permenant powerup!
switch (s->id) {
case P_KINGRAT:
addsprite(P_BIGSPEED, (640/2), 0, "bigspeed");
break;
}
}
@ -3869,11 +3876,17 @@ void dogravity(sprite_t *s) {
if (s == player || ismonster(s->id)) {
if (isinwater(s)) {
if (!s->swimming) {
// we just entered the water
s->swimming = B_TRUE;
s->watertimer = rand() % BUBBLETIME;
playfx(FX_SPLASH);
if (s == player) adjustx(s, F_SWIM1);
else adjustx(s, F_WALK1);
if (s == player) {
// dim the music
Mix_VolumeMusic(MIX_MAX_VOLUME/3);
}
}
// generate bubbles
// just use s->x and s->y to add randomness, so that
@ -3885,7 +3898,11 @@ void dogravity(sprite_t *s) {
}
} else {
if (s->swimming) {
// exitted the water
s->swimming = B_FALSE;
if (s == player) {
Mix_VolumeMusic(MIX_MAX_VOLUME);
}
}
}
}
@ -3958,7 +3975,12 @@ void dogravity(sprite_t *s) {
} else { // not jumping
int ontheground;
ontheground = isonground(s);
if ((s->id == P_BIGSPEED) && (s->y < 480/2)) {
ontheground = B_FALSE;
} else {
ontheground = isonground(s);
}
if (ontheground) {
if (s->falling && s->iced) {
// when an iced monster hits the ground, it smashes
@ -4446,6 +4468,12 @@ int dofruiteffect(sprite_t *s) {
player->speed = PLAYERFAST;
addoutlinetext(s->x,s->y - s->img->h/2, TEXTSIZE_POINTS, "Speed up!", &white,&black,POINTSDELAY);
return B_TRUE;
} else if (s->id == P_BIGSPEED) {
playfx(FX_POWERUP);
player->permspeed = B_TRUE;
player->speed = PLAYERFAST;
addoutlinetext(s->x,s->y - s->img->h/2, TEXTSIZE_LIFE, "SUPER SPEED UP!", &cyan,&black,POINTSDELAY);
return B_TRUE;
} else if (s->id == P_NUMNETS) {
playfx(FX_POWERUP);
if (player->netmax < 4) {
@ -5340,17 +5368,18 @@ void togglepause(void) {
void togglefullscreen(void) {
// close window
SDL_Quit();
//SDL_Quit();
// set fullscreen variable
/*
if (fullscreen) {
fullscreen = B_FALSE;
} else {
fullscreen = B_TRUE;
}
*/
// re-open screen
initsdl();
screen=SDL_SetVideoMode(screen->w,screen->h,screen->format->BitsPerPixel,SDL_HWSURFACE|(screen->flags&SDL_FULLSCREEN?0:SDL_FULLSCREEN));
}
void initsdl(void) {

View File

@ -561,7 +561,11 @@ printf(".\n");
void setdefaults(sprite_t *s) {
// player powerup stats
s->speed = 1;
if (s->permspeed) {
s->speed = 2;
} else {
s->speed = 1;
}
s->hasbell = B_FALSE;
s->armour = B_FALSE;
s->gemboost = 1;
@ -707,8 +711,12 @@ sprite_t *addsprite(int id, int x, int y, char *name ) {
}
s->iceimg = NULL;
// don't set this in setdefaults as it is called after player death
s->permspeed = B_FALSE;
setdefaults(s);
// initial fruits don't time out
#ifndef __EDITOR
if ((levelcomplete != LV_NEXTLEV) && (levelcomplete != LV_INIT)) {
@ -1208,6 +1216,9 @@ int loadimagesets(void) {
loadspriteimage(P_CANNON,F_WALK1, "sprites/cannon.png");
imageset[P_CANNON].numimages = 1;
loadspriteimage(P_BIGSPEED,F_WALK1, "sprites/bigspeed.png");
imageset[P_BIGSPEED].numimages = 1;
// puffs and mace smashes
for (i = 0; i < PUFFFRAMES; i++) {
char name[SMALLBUFLEN];
@ -1688,6 +1699,7 @@ int isfruit(int id) {
case P_BELL:
case P_TROPHY:
case P_HONEY:
case P_BIGSPEED:
return FT_PERM;
/* one-off level only powerups */
case P_BOXING:
@ -2457,7 +2469,7 @@ int isnettable(int monid) {
int getbosshealth(int mid) {
switch (mid) {
case P_KINGRAT:
return 8;
return 1;
}
return 0;
}
@ -2506,6 +2518,7 @@ void setfruitinfo(void) {
setinfo(P_BELL, "Powerup Bell", "Rings if a permenant powerup is going to appear on the level", "bell.png");
setinfo(P_TROPHY, "Trophy", "Gives the player all powerups", "trophy.png");
setinfo(P_HELMET, "Helmet","Gives you a suit of armour which will protect you from death.", "helmet.png");
setinfo(P_BIGSPEED, "Big Speed Up", "Makes you walk faster, permenantly!", "bigspeed.png");
setinfo(P_BOXING, "Boxing Glove", "Your net will punch monsters, killing them instantly.", "glove.png");
@ -2522,7 +2535,9 @@ void setfruitinfo(void) {
setinfo(P_CANNONPOWERUP, "Fusion Cannon", "A powerful weapon which will shoot out laser beams in all directions!", "cannonpowerup.png");
setinfo(P_PHONE, "Phone", "Calls in your helper cloud and immediately skips two levels.", "phone.png");
setinfo(P_HONEY, "Honey", "Coats your net in a layer of sticky honey, allowing it to pick up fruits from afar.", "honey.png");
setinfo(P_STAR, "Shuriken", "Shoots deadly razor blades in all directions.", "star.png");
setinfo(P_STARPOWERUP, "Shuriken", "Shoots deadly razor blades in all directions.", "star.png");
setinfo(P_LIFE, "Life", "Awards the player an extra life.", "extralife.png");
setinfo(P_UFO, "UFO", "Calls in a powerful meteor strike!", "ufo.png");
setinfo(P_RAT, "Rat", "The weakest of the monsters, the rat will simply walk back and forth waiting to be caught. Beward an angry rat though, as it will try to fall or jump in order to catch you!", "rat.png");