- Game now drops to title screen after game over

- Fixed freeze bug if you got luckiness without having any cards
- Luckiness is now done via the 4-leaf clover object, and visually displayed
  by flashing the score
This commit is contained in:
Rob Pearce 2008-10-18 03:18:24 +00:00
parent c4b48e993d
commit cdf82e72e6
6 changed files with 503 additions and 400 deletions

BIN
data/sprites/clover.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -2,6 +2,7 @@ bgfile forest.png
bg 0
hurryup 30
help
Jump in the direction of the logs...
endhelp
monsters
0 2 22
@ -39,6 +40,7 @@ monsters
16 23 4
18 20 8
18 32 8
14 6 22
endmonsters
exitdir 1
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
@ -55,15 +57,15 @@ exitdir 1
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,1,1,1,1,1,1,1,1,1,1,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,20,20,20,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,20,20,20,20,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,9,9,9,1,0,0,0,0,0,0,0,0,4,
4,0,0,0,0,0,0,0,0,0,0,0,0,0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+61,9 @@
#define TT_NORM 0
#define TT_HELP 1
#define TT_HELPSHADOW 2
#define TT_GAMEOVER 3
#define GAMEOVERWAIT 5 // # of seconds to wait before going back to title
// text delays
#define TEXTSPEED 2 // how fast text zooms in
@ -70,6 +74,7 @@
#define MULTIDELAY 50
#define HURRYDELAY 50
#define LIFEDELAY 50
#define CLOVERDELAY 50
#define POKERMSGDELAY 80
#define LEVELWINDELAY 80
#define DIEDELAY 80
@ -111,6 +116,8 @@
#define FLOODSPEED 4 // how fast flood effect acts
#define LUCKYFLASH 10 // how fast score flashes during lucky mode
#define MASKOFFSETX 8
#define MASKOFFSETY -12
@ -276,7 +283,7 @@
#define S_SLOPE 2
// Sprite types
#define MAXPTYPES 118
#define MAXPTYPES 119
#define P_PLAYER 0
#define P_RAT 1
#define P_CHEESE 2
@ -400,6 +407,7 @@
#define P_CARDCK 115
#define P_MOVINGCARD 116
#define P_FIVECARDS 117
#define P_CLOVER 118
// cards
#define CARDFONTX 4

871
rc.c

File diff suppressed because it is too large Load Diff

1
rc.h
View File

@ -80,3 +80,4 @@ void trytojump(sprite_t *pl);
void trytoshoot(sprite_t *pl);
void docannoneffect(void);
void dotitlescreen(void);
void startgame(void);

View File

@ -1268,6 +1268,9 @@ int loadimagesets(void) {
loadspriteimage(P_CANNON,F_WALK1, "sprites/cannon.png");
imageset[P_CANNON].numimages = 1;
loadspriteimage(P_CLOVER,F_WALK1, "sprites/clover.png");
imageset[P_CLOVER].numimages = 1;
loadspriteimage(P_BIGSPEED,F_WALK1, "sprites/bigspeed.png");
imageset[P_BIGSPEED].numimages = 1;
@ -1879,6 +1882,7 @@ int isfruit(int id) {
case P_TAP:
case P_SPRAY:
case P_CANNONPOWERUP:
case P_CLOVER:
return FT_TEMP;
/* flowers */
case P_FLOWERYELLOW:
@ -2488,7 +2492,7 @@ int loadlevellist(void) {
int randompowerup(void) {
int num;
num = rand() % 27;
num = rand() % 28;
switch (num) {
case 0:
@ -2546,6 +2550,8 @@ int randompowerup(void) {
return P_MASKPOWERUP;
case 26:
return getrandomcard();
case 27:
return P_CLOVER;
}
}
@ -2674,8 +2680,7 @@ void setfruitinfo(void) {
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_TAP, "Tap", "The leaky tap will flood the level with water, allowing you to acces hard to reach areas.", "tap.png");
// TODO: add cards here!
setinfo(P_CLOVER, "4-Leaf Clover", "Increases your luck...", "clover.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");
@ -2859,7 +2864,7 @@ int getrandomcard(void) {
}
// are we forcing it to be good?
if (forcegoodcard) {
if ((forcegoodcard) && (player->numcards > 0)) {
int okay = B_FALSE;
int csuit,cval;
for (i = 0; i < player->numcards; i++) {