Restrict players to 10 bombs, use enum for tile types

This commit is contained in:
Stefan Bühler 2009-08-10 22:00:27 +02:00
parent 9b60fa91f0
commit 8b614a8728
2 changed files with 23 additions and 12 deletions

View File

@ -166,13 +166,24 @@ typedef struct bonustile {
int type;
} bonustile;
#define TILE_NONE -1
#define TILE_BOMB 5
#define TILE_FLAME 2
#define TILE_GOLDFLAME 7
#define TILE_CONTROL 9
#define TILE_SKATES 4
#define TILE_TURTLE 14
enum tile_types {
TILE_NONE = -1,
TILE_DISEASE = 0,
TILE_KICK = 1,
TILE_FLAME = 2,
TILE_PUNCH = 3,
TILE_SKATES = 4,
TILE_BOMB = 5,
TILE_SPOOGE = 6,
TILE_GOLDFLAME = 7,
TILE_BAD_DISEASE = 8,
TILE_TRIGGER = 9,
TILE_RANDOM = 10,
TILE_JELLY = 11,
TILE_GRAB = 12,
TILE_RANDOM2 = 13,
TILE_TURTLE = 14
};
#define ACT_INVALID 0x88

8
game.c
View File

@ -41,7 +41,7 @@ static int bonustotal;
static const int bonuschances[]= {
TILE_BOMB,20,
TILE_FLAME,20,
TILE_CONTROL,2,
TILE_TRIGGER,2,
TILE_GOLDFLAME,2,
TILE_SKATES,20,
TILE_TURTLE,5,
@ -685,9 +685,9 @@ static void applybonus(player *pl,bonustile *bonus) {
maxflame=arraynumx>arraynumy ? arraynumx : arraynumy;
type=bonus->type;
deletebonus(bonus);
switch(type)
{
switch(type) {
case TILE_BOMB:
if (pl->bombsavailable < 9)
++(pl->bombsavailable);
break;
case TILE_FLAME:
@ -697,7 +697,7 @@ static void applybonus(player *pl,bonustile *bonus) {
case TILE_GOLDFLAME:
pl->flamelength=maxflame;
break;
case TILE_CONTROL:
case TILE_TRIGGER:
pl->flags|=FLG_CONTROL;
break;
case TILE_SKATES: