From 9949690935759da4bca33b12e71eb7f8a9a6a24d Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Fri, 10 Oct 2008 05:29:35 +0000 Subject: [PATCH] - 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 --- data/sprites/cloud.png | Bin 538 -> 5590 bytes defs.h | 5 ++++- rc.c | 37 +++++++++++++++++++++++++++++++++---- shared.c | 21 ++++++++++++++++++--- 4 files changed, 55 insertions(+), 8 deletions(-) diff --git a/data/sprites/cloud.png b/data/sprites/cloud.png index b125e144610e072315bc7a52b8b877b166370fc4..8590e1e7e813edc2cb660fc6705b875e09ad011f 100644 GIT binary patch literal 5590 zcmV;{6)Eb8P)900009a7bBm000XU z000XU0RWnu7ytkO2XskIMF-dl3I`}J2kg^Y zr~HE9Hdv1VBF;TNmHK}&n`K!uO;;L;zaG?{H!KR`z!nUa1@`KX_YKQ1LaBPc7lP}@ zc)uUx#$FL#!R&tnTc75FlV1SP9FPJLm;rKN7icvS|Lb#k_RCXgnhUZL)IMX_62_ci zUErvhEh=~bC%grm0X9Vp$umXsP8JxtdWiVZDiUrljyCJ@Z*K(0}`u^N6ko_!y$+W24ZFl zwRH`iOPt7&)VULV=bl#8|49`$KQ${%{)*zhuUoq^R-Cpq)@ZMi{7oG+lno5&nXJ%WX za7o~V8jq>jV}?zv$*cme#$^N~P{s&AFh%N=j2VdFMG&ceO}$GR-e1`jc?h!)>v;RA zxzf+ubuXleKYn($wTQTXV8*Yh*;T_%m{nG%HU^&Az>>x+uySEDL(Paf`nkHsMkXd; z&=BERKgJKD+BZWY{*nO8YD$vSE_>8_cixQYxjg+l^Nq&e6k*xS+#sIY1VAGOg%z1E|RH2G5Q{ZpxTOJ?*FCr9$cFYWY;H@YFd zRYrYXRo?<`)Zl;W0A|235jo*Rj%41Q%DjIh^X?0I;x7O(b$(HV+{|Rcl2nIoIWRgA z2O6HMWJyHCYJi5o zjm0rl9VQH{0>U|mxXMTexDI^T_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NEu`0N<$F!z+}~+sqLhq1;MQ7N4-_X z_%BWE59-3hQ#Gz~M4lAk3doZpoOdE;>%paujb-vNuQo=V2I^QM4kx3?Al074+WX#C zv-ef)RW*AFvp0eE&pM&16E#jX#q?C}{c)|_oS-_aR-&=5C>l0nNUDr$(X8DI@q1;| zZ({ahU9k<0H*0@;&5R6e$wZzp$3Jx z?wfJPuY&#TZ^BR+<&?eU$g#Rh%Yx2{Rns>s!1Hw%7bZuvD>-&0jhCZ(V%*} zQ-=Q#RlkYx{vj?gZ2s402eSvJw9WCmBJ%jKNq30#jfV^ct*TMO28Lj^5~5uEB3rY{#U{z>NjMek$=b;H=?MDS*mwFEVw0#1nisMp$M`Fp1J z-+((GH!^$3(Z%c~HF?1cm!uj$JJglykQdBYSF=AeY@@EmI`#K_2e@0G#aQzC`3;$C zwB4U8arzC0%rdevlpla4&qoS>hUQ~=>M!!`q5P1>V^2NMiM_GB9{^oQDnsADz`H8uY;Jy0-R32K^o ze@P)2w&|UaCmw;7P8q)4DZ@Wg)$ahS|Ih!mKu{5RMns+j-T+=V;~MaRn*Mv#ekb+r kkB`r`9_;oD<>z$#Ur8cZLSvsii2wiq07*qoM6N<$f^=-!IsgCw delta 507 zcmV<{924YJ` zL;(K){{a7>y{D4^000SaNLh0L01m_e01m_fl`9S#00007bV*G`2iOV$2>}4se?jPx zNh^N=en~_@R9M5!SX&OlKnUC=y^b-Sq)B_Aav@DTi7_6ier$8M)7rP|-JB-^=EW!wM9he|a-dSs9IbXMM+IDC zj1j&!X+1aK+7VStQl2BNt;b(~HR~4=F>ih14@`O3ynp}z002ovPDHLkV1h-U*7N`X diff --git a/defs.h b/defs.h index 02f5bcd..21cdbd0 100644 --- a/defs.h +++ b/defs.h @@ -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; // diff --git a/rc.c b/rc.c index b818995..12ade76 100644 --- a/rc.c +++ b/rc.c @@ -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) { diff --git a/shared.c b/shared.c index 45f13df..3f50d2c 100644 --- a/shared.c +++ b/shared.c @@ -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");