- Killing 5 monsters simultaneously will force cards appearing on the next
level to be good (ie. match suit, value, or value +/- 1 of current cards)
This commit is contained in:
parent
5f260a9ae9
commit
c4b48e993d
2
defs.h
2
defs.h
|
@ -771,6 +771,8 @@ extern spriteinfo_t spriteinfo[];
|
|||
|
||||
extern int curcard;
|
||||
extern int deck[];
|
||||
extern int forcegoodcard;
|
||||
extern int nextforcegoodcard;
|
||||
|
||||
extern char *datadir;
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ char *datadir;
|
|||
|
||||
int curcard;
|
||||
int deck[DECKSIZE];
|
||||
int forcegoodcard;
|
||||
int nextforcegoodcard;
|
||||
|
||||
|
||||
SDL_Surface *levelbg; // level background image
|
||||
|
|
52
rc.c
52
rc.c
|
@ -267,6 +267,9 @@ int main (int argc, char **argv) {
|
|||
player->invuln = INVULNTIME;
|
||||
player->score = 0;
|
||||
player->lives = 3;
|
||||
forcegoodcard = B_FALSE;
|
||||
nextforcegoodcard = B_FALSE;
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -856,6 +859,11 @@ void nextlevel(void) {
|
|||
|
||||
/* reset level stats */
|
||||
level->gotpowerup = B_FALSE;
|
||||
|
||||
// this is based on the max number of monsters killed
|
||||
// simulatneously on the previous level...
|
||||
forcegoodcard = nextforcegoodcard;
|
||||
nextforcegoodcard = B_FALSE;
|
||||
|
||||
if (player->hasbell) {
|
||||
playedbell = B_FALSE;
|
||||
|
@ -4166,9 +4174,6 @@ void dogravity(sprite_t *s) {
|
|||
s->netlen += s->netspeed;
|
||||
s->netting++;
|
||||
if (s->netting % 2 == 0) {
|
||||
if (s->netspeed == 0) {
|
||||
printf("maxlen %d\n",s->netlen);
|
||||
}
|
||||
if (s->netspeed > -NETSPEED) {
|
||||
s->netspeed--;
|
||||
} else {
|
||||
|
@ -4445,8 +4450,9 @@ void dogravity(sprite_t *s) {
|
|||
|
||||
}
|
||||
}
|
||||
}
|
||||
} // end if gotsomething || PW_MACE
|
||||
|
||||
// play sound effect
|
||||
if (!hitboss) {
|
||||
if (gotsomething >= 1) {
|
||||
playfx(FX_KILL);
|
||||
|
@ -4456,6 +4462,12 @@ void dogravity(sprite_t *s) {
|
|||
}
|
||||
}
|
||||
|
||||
// killing 5 at a time gives us a bonus on the next level...
|
||||
if (gotsomething >= 5) {
|
||||
nextforcegoodcard = B_TRUE;
|
||||
forcegoodcard = B_TRUE; // and on this level if we get one...
|
||||
}
|
||||
|
||||
|
||||
gotsomething = B_FALSE;
|
||||
|
||||
|
@ -6412,38 +6424,6 @@ char *getpokermsg2(int effect, char *buf) {
|
|||
return buf;
|
||||
}
|
||||
|
||||
int getcardsuit(int cardid) {
|
||||
if ((cardid >= P_FIRSTHEART) && (cardid <= (P_FIRSTHEART + 12))) {
|
||||
return CS_HEART;
|
||||
} else if ((cardid >= P_FIRSTDIAMOND) && (cardid <= (P_FIRSTDIAMOND + 12))) {
|
||||
return CS_DIAMOND;
|
||||
} else if ((cardid >= P_FIRSTSPADE) && (cardid <= (P_FIRSTSPADE + 12))) {
|
||||
return CS_SPADE;
|
||||
} else {
|
||||
return CS_CLUB;
|
||||
}
|
||||
}
|
||||
int getcardvalue(int cardid) {
|
||||
int points;
|
||||
points = cardid;
|
||||
switch (getcardsuit(cardid)) {
|
||||
case CS_HEART:
|
||||
points -= P_FIRSTHEART;
|
||||
break;
|
||||
case CS_DIAMOND:
|
||||
points -= P_FIRSTDIAMOND;
|
||||
break;
|
||||
case CS_SPADE:
|
||||
points -= P_FIRSTSPADE;
|
||||
break;
|
||||
case CS_CLUB:
|
||||
default:
|
||||
points -= P_FIRSTCLUB;
|
||||
break;
|
||||
}
|
||||
|
||||
return (points+1);
|
||||
}
|
||||
|
||||
|
||||
void handleinput(void) {
|
||||
|
|
2
rc.h
2
rc.h
|
@ -74,8 +74,6 @@ int getpokereffect(sprite_t *pl);
|
|||
void dopokereffect(sprite_t *pl, int effect);
|
||||
char *getpokermsg(int effect);
|
||||
char *getpokermsg2(int effect, char *buf);
|
||||
int getcardvalue(int cardid);
|
||||
int getcardsuit(int cardid);
|
||||
void handleinput(void);
|
||||
int keydown(int checkfor);
|
||||
void trytojump(sprite_t *pl);
|
||||
|
|
51
shared.c
51
shared.c
|
@ -2857,6 +2857,24 @@ int getrandomcard(void) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// are we forcing it to be good?
|
||||
if (forcegoodcard) {
|
||||
int okay = B_FALSE;
|
||||
int csuit,cval;
|
||||
for (i = 0; i < player->numcards; i++) {
|
||||
cval = getcardvalue(player->card[i]);
|
||||
csuit = getcardsuit(player->card[i]);
|
||||
if (csuit == getcardsuit(cardid)) okay = B_TRUE;
|
||||
if (cval == (getcardvalue(cardid))) okay = B_TRUE;
|
||||
if (cval == (getcardvalue(cardid)+1)) okay = B_TRUE;
|
||||
if (cval == (getcardvalue(cardid)-1)) okay = B_TRUE;
|
||||
}
|
||||
// if not a good card, go to next one
|
||||
if (!okay) {
|
||||
gotit = B_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//printf("returning cardid %d\n",cardid);
|
||||
|
@ -3013,3 +3031,36 @@ int getlevel(int lev) {
|
|||
return wnum;
|
||||
}
|
||||
|
||||
|
||||
int getcardsuit(int cardid) {
|
||||
if ((cardid >= P_FIRSTHEART) && (cardid <= (P_FIRSTHEART + 12))) {
|
||||
return CS_HEART;
|
||||
} else if ((cardid >= P_FIRSTDIAMOND) && (cardid <= (P_FIRSTDIAMOND + 12))) {
|
||||
return CS_DIAMOND;
|
||||
} else if ((cardid >= P_FIRSTSPADE) && (cardid <= (P_FIRSTSPADE + 12))) {
|
||||
return CS_SPADE;
|
||||
} else {
|
||||
return CS_CLUB;
|
||||
}
|
||||
}
|
||||
int getcardvalue(int cardid) {
|
||||
int points;
|
||||
points = cardid;
|
||||
switch (getcardsuit(cardid)) {
|
||||
case CS_HEART:
|
||||
points -= P_FIRSTHEART;
|
||||
break;
|
||||
case CS_DIAMOND:
|
||||
points -= P_FIRSTDIAMOND;
|
||||
break;
|
||||
case CS_SPADE:
|
||||
points -= P_FIRSTSPADE;
|
||||
break;
|
||||
case CS_CLUB:
|
||||
default:
|
||||
points -= P_FIRSTCLUB;
|
||||
break;
|
||||
}
|
||||
|
||||
return (points+1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue