From 79ac13691ae70655a95f749bc9a9daae9dc99a65 Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Fri, 17 Oct 2008 02:05:54 +0000 Subject: [PATCH] - Added black border around cards - Flood effect (tap) now times out after 20 seconds to avoid getting stuck - Clock timer now does not display during poker effect --- data/sprites/cardc.png | Bin 251 -> 267 bytes data/sprites/cardd.png | Bin 224 -> 242 bytes data/sprites/cardh.png | Bin 225 -> 233 bytes data/sprites/cards.png | Bin 236 -> 252 bytes rc.c | 96 +++++++++++++++++++++++++++++++++-------- rc.h | 1 + shared.c | 7 +++ 7 files changed, 86 insertions(+), 18 deletions(-) diff --git a/data/sprites/cardc.png b/data/sprites/cardc.png index 799f38ba13f748545ac7f62449ce8ed766a89d70..55936fc14fd5a5a0e72b84d434f98e543152ff6f 100644 GIT binary patch literal 267 zcmeAS@N?(olHy`uVBq!ia0vp^LO?9V!3HFE&E>HIQfx`y?k)`fL2$v|<&%LToCO|{ z#S9F5M?jcysy3fAP>{XE)7O>#2A3d%AxDJPWJ{pX3{Mxw5R21qryk^MQQ&b&U-ke0 z_Bb1Z>H_hL4Z2z178NVBOqgD#p}Wz`Lj4(Q!;)f|qK6UOpY}e;ny1Dfki9_Yk?X1{ z35OXDyIvG)d8@2AbMb^J=WQZ&=ic8}_N>WE|5V4KxL)bUTGJP&UNqUgeVyL^TijJV zFJ8=!&|kv(J3i~;wWL7*J=cmjUS;Yoo*uPj>m9Scit7!37&h+mSIG0+DgbmNgQu&X J%Q~loCICIEWJ3S| literal 251 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRm!3HEhFR0}KQfx`y?k+$Y2!1;6t_M<_1s;*b z3=DinK$vl=HlH+5kiEpy*OmPS7aya5z_~=@BA`%*r;B5V#p$P6fGlUh2A}hL%NE)FDV;F$sL`$xlOvBF@DyqoH19vKn5F8zZQ2RliPh03*8I?$ rn3lx*!urIzA4bwjrDwyFVkg~q$qWDDw?04$=q3hFS3j3^P6HIQfx`y?k)`fL2$v|<&%LToCO|{ z#S9F5M?jcysy3fAP>{XE)7O>#2A3d%0rw4y&xe3Q^`0({Ar`0KPCdxipuppN`_upV zua7o=PFSRokgzE3Mq>-JeyqFIBaPinG8Y zvY3H^?+6GpPSxg<1`4v5c>21s-{9h7urRzg{rN_qP_CzoV~EA+w^KH9H5dpuPyX}& zd0CMGUs%Rcr}rYu(_T-QF7V=_8G{68?$Us{GkF*_X08*p+WefW@_r$c+sVlS50{$w zY;JD2mZC1DGRgj40;8D1s@vy7Pu+2t;=Avjecp!x<0M`-b7zJbO;=R;)W2*0EnIPu Q186aWr>mdKI;Vst0B3wk3IG5A diff --git a/data/sprites/cardh.png b/data/sprites/cardh.png index 1981b7c9f4738d83efde971cb8d691b806510250..65f6f24eaa8148fffb1eb1adad6b8a737d0ca26a 100644 GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^LO?9V!3HFE&E>HIQfx`y?k)`fL2$v|<&%LToCO|{ z#S9F5M?jcysy3fAP>{XE)7O>#2A3d%zEu6CyX$~LWu7jMAr`0KPTk9OK!K;_{iEOZ z>%7@7D=ygbV>VZ;O#sVB?>!HlL^NxX?lG)b)$c6jZq%|Rb^BAB3!=&l8uAOatL?fn zMM2TwL!gMW$L3#)(t~Q>7{uA^JJUGFY5}v=g1jF;tyZ->@Q;7pa=*&G_rqP Z_pWWx750|m*aCC`gQu&X%Q~loCIEfFR1N?D literal 225 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRm!3HEhFR0}KQfx`y?k)`ffh-1N^_tH>inG8Y zvY3H^?+6GpPSxg<1`4v5c>21s-{9h7U=~@ac;_5YD9_WyF~s8Z+bJ8l8Vm%S<3IhM z|N2RS%o~NMi(vvSXjclWm$Buhx_e R+kiGRc)I$ztaD0e0su(&NZ|kg diff --git a/data/sprites/cards.png b/data/sprites/cards.png index 16e0093c927601fa4b32c57e9e9afe16ef691a9c..71129d56cbf36cb0b5e83eb987016773b323986a 100644 GIT binary patch delta 212 zcmV;_04x9O0sH|WiBL{Q4GJ0x0000DNk~Le0000I0000Q2nGNE0J@zFI*}nVe-QvM zC+gszApigXiAh93R5;7+mAwvtAPj`Bh4+737YFKqe?hFJX&j6>oc27$0a5BlNDeJI*;N5WV^0nAv?u#DJ vfBpH#vo6eb&VlH!BBoWQQs-)3GwfhmrDDlef52@k&=m}xu6{1-oD!M<35!WM diff --git a/rc.c b/rc.c index 5b92bb9..8564223 100644 --- a/rc.c +++ b/rc.c @@ -32,6 +32,10 @@ Mix_Music *curmusic = NULL; // pointer to currently playing music char tempm[BUFLEN]; +// used to remember old level if we flood it +int savemap[LEVELW*LEVELH]; +int watertime; + int playedbell; int clocktime; @@ -285,10 +289,13 @@ int main (int argc, char **argv) { addoutlinetext(320,240,TEXTSIZE_LEVEL,"Level Complete!",&green,&black,LEVELWINDELAY); levelcomplete = LV_WAIT; playfx(FX_WINLEVEL); - // turn off clock powerup + // turn off clock and water powerups if (player->powerup == PW_CLOCK) { Mix_ResumeMusic(); player->powerup = B_FALSE; + } else if ((curlevel->iced == WATER_INPROGRESS) || (curlevel->iced == WATER_COMPLETE)) { + curlevel->iced = B_FALSE; + undoflood(); } } else if (levelcomplete == LV_WAIT) { int mcount = 0; @@ -642,27 +649,49 @@ void tick(void) { gtime++; // handle clock effect - if (player->powerup == PW_CLOCK) { - char tempm[SMALLBUFLEN]; - // text - if (clocktime > 0) { - sprintf(tempm, "%d",clocktime); - addoutlinetext(320,120,TEXTSIZE_LEVEL, tempm, &yellow,&black,15); - // sound effect - playfx(FX_CLOCK); + if (levelcomplete == LV_INPROGRESS) { + if (player->powerup == PW_CLOCK) { + char tempm[SMALLBUFLEN]; + // text + if (clocktime > 0) { + sprintf(tempm, "%d",clocktime); + addoutlinetext(320,120,TEXTSIZE_LEVEL, tempm, &yellow,&black,15); + // sound effect + playfx(FX_CLOCK); + } + // never reach hurryup time + nexthurryup++; + // decrement counter + clocktime--; + if (clocktime < 0) { + // finished! + Mix_ResumeMusic(); + player->powerup = B_FALSE; + } } - // never reach hurryup time - nexthurryup++; - // decrement counter - clocktime--; - if (clocktime < 0) { - // finished! - Mix_ResumeMusic(); - player->powerup = B_FALSE; + + // handle flood effect + if (curlevel->iced == WATER_COMPLETE) { + char tempm[SMALLBUFLEN]; + // text + if (watertime > 0) { + sprintf(tempm, "%d",watertime); + addoutlinetext(320,120,TEXTSIZE_LEVEL, tempm, &cyan,&black,15); + } + // never reach hurryup time + nexthurryup++; + // decrement counter + watertime--; + if (watertime < 0) { + // finished! + curlevel->iced = B_FALSE; + undoflood(); + } } } + /* check for hurryup*/ if (!isbosslevel(curlevelnum)) { if (gtime == nexthurryup) { @@ -755,6 +784,7 @@ void tick(void) { void nextlevel(void) { char msg[SMALLBUFLEN]; sprite_t *cloudp; + int x,y; // remove the player removesprite(player); @@ -779,6 +809,14 @@ void nextlevel(void) { loadlevel(curworld,curlevelnum, B_TRUE); } + // remmeber layer 2 in case we replace it with water + for (y = 0 ; y < LEVELH; y++) { + for (x = 0 ; x < LEVELW; x++) { + savemap[y*LEVELW+x] = curlevel->map2[y*LEVELW+x]; + } + } + watertime = -1; + // do the moving to next level animation drawlevel(); @@ -1014,6 +1052,14 @@ void die(sprite_t *s) { } } + // undo water effect + if (s == player) { + if (curlevel->iced == WATER_COMPLETE) { + undoflood(); + curlevel->iced = B_FALSE; + } + } + // boss effects if (s == boss) { // stop screen shaking @@ -4712,6 +4758,8 @@ int dofruiteffect(sprite_t *s) { if (!curlevel->iced) { curlevel->iced = WATER_INPROGRESS; curlevel->icey = LEVELH-1; + // water for 20 seconds + watertime = 20; } return B_TRUE; } else if (s->id == P_SNOWMAN) { @@ -5597,7 +5645,7 @@ void getfruit(sprite_t *giveto, sprite_t *fruit, int multiplier) { } } -// slowly change leve to water +// slowly change level to water void doflood(void) { int yy,xx,changed; int l2id; @@ -5661,6 +5709,18 @@ void doflood(void) { } } +// put flood effect back to normal +void undoflood(void) { + int x,y; + for (y = 0 ; y < LEVELH; y++) { + for (x = 0 ; x < LEVELW; x++) { + curlevel->map2[y*LEVELW+x] = savemap[y*LEVELW+x]; + drawtile(temps, x, y); + } + } + +} + int haspowerup(sprite_t *s, int pid) { switch (pid) { diff --git a/rc.h b/rc.h index 34a6895..92c642a 100644 --- a/rc.h +++ b/rc.h @@ -53,6 +53,7 @@ void addscore(sprite_t *s, int amt); void extralife(sprite_t *s); void doice(void); void doflood(void); +void undoflood(void); void checklevelend(void); void checksprites(void); void moveallsprites(void); diff --git a/shared.c b/shared.c index ee78dae..d5dd6d4 100644 --- a/shared.c +++ b/shared.c @@ -2641,6 +2641,8 @@ void setfruitinfo(void) { setinfo(P_GEMRED, "Red Gem", "", "gem-red.png"); setinfo(P_GEMPURPLE, "Purple Gem", "", "gem-purple.png"); + setinfo(P_FIRSTCARD, "Card", "Keep a look out for these useful items. Collect a full poker hand for a secret bonus!", "cardh.png"); + setinfo(P_SPEED, "Speed Up", "Makes you walk faster.", "speed.png"); setinfo(P_NUMNETS, "More Nets", "Increases the number of monsters you can catch simultaneously.", "numnets.png"); @@ -2724,6 +2726,11 @@ void dumpinfo(void) { spriteinfo[i].file, spriteinfo[i].name,spriteinfo[i].desc); } } + // card + printf("
%s%s\n", + spriteinfo[P_FIRSTCARD].file, spriteinfo[P_FIRSTCARD].name,spriteinfo[P_FIRSTCARD].desc); + + // temp powerup printf("Temporary Powerups\n"); for (i = 0; i < MAXPTYPES; i++) {