Restrict players to 10 bombs, use enum for tile types
This commit is contained in:
parent
9b60fa91f0
commit
8b614a8728
25
bomber.h
25
bomber.h
@ -166,13 +166,24 @@ typedef struct bonustile {
|
|||||||
int type;
|
int type;
|
||||||
} bonustile;
|
} bonustile;
|
||||||
|
|
||||||
#define TILE_NONE -1
|
enum tile_types {
|
||||||
#define TILE_BOMB 5
|
TILE_NONE = -1,
|
||||||
#define TILE_FLAME 2
|
TILE_DISEASE = 0,
|
||||||
#define TILE_GOLDFLAME 7
|
TILE_KICK = 1,
|
||||||
#define TILE_CONTROL 9
|
TILE_FLAME = 2,
|
||||||
#define TILE_SKATES 4
|
TILE_PUNCH = 3,
|
||||||
#define TILE_TURTLE 14
|
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
|
#define ACT_INVALID 0x88
|
||||||
|
10
game.c
10
game.c
@ -41,7 +41,7 @@ static int bonustotal;
|
|||||||
static const int bonuschances[]= {
|
static const int bonuschances[]= {
|
||||||
TILE_BOMB,20,
|
TILE_BOMB,20,
|
||||||
TILE_FLAME,20,
|
TILE_FLAME,20,
|
||||||
TILE_CONTROL,2,
|
TILE_TRIGGER,2,
|
||||||
TILE_GOLDFLAME,2,
|
TILE_GOLDFLAME,2,
|
||||||
TILE_SKATES,20,
|
TILE_SKATES,20,
|
||||||
TILE_TURTLE,5,
|
TILE_TURTLE,5,
|
||||||
@ -685,10 +685,10 @@ static void applybonus(player *pl,bonustile *bonus) {
|
|||||||
maxflame=arraynumx>arraynumy ? arraynumx : arraynumy;
|
maxflame=arraynumx>arraynumy ? arraynumx : arraynumy;
|
||||||
type=bonus->type;
|
type=bonus->type;
|
||||||
deletebonus(bonus);
|
deletebonus(bonus);
|
||||||
switch(type)
|
switch(type) {
|
||||||
{
|
|
||||||
case TILE_BOMB:
|
case TILE_BOMB:
|
||||||
++(pl->bombsavailable);
|
if (pl->bombsavailable < 9)
|
||||||
|
++(pl->bombsavailable);
|
||||||
break;
|
break;
|
||||||
case TILE_FLAME:
|
case TILE_FLAME:
|
||||||
if(pl->flamelength<maxflame)
|
if(pl->flamelength<maxflame)
|
||||||
@ -697,7 +697,7 @@ static void applybonus(player *pl,bonustile *bonus) {
|
|||||||
case TILE_GOLDFLAME:
|
case TILE_GOLDFLAME:
|
||||||
pl->flamelength=maxflame;
|
pl->flamelength=maxflame;
|
||||||
break;
|
break;
|
||||||
case TILE_CONTROL:
|
case TILE_TRIGGER:
|
||||||
pl->flags|=FLG_CONTROL;
|
pl->flags|=FLG_CONTROL;
|
||||||
break;
|
break;
|
||||||
case TILE_SKATES:
|
case TILE_SKATES:
|
||||||
|
Loading…
Reference in New Issue
Block a user