No longer consider cards with adjacent values okay for 'lucky' card draws.

This commit is contained in:
Rob Pearce 2016-07-24 20:55:55 +12:00
parent 846e54e33d
commit 34195cb85a
2 changed files with 21 additions and 14 deletions

View File

@ -4548,13 +4548,12 @@ char *getcardletter(int num) {
int getrandomcard(void) {
int i;
int cardid;
int gotit;
int ok = B_FALSE;
//cardid = P_FIRSTCARD + (rand() % 52);
// TODO: possible infinite loop?
gotit = B_TRUE;
while (gotit) {
while (!ok) {
// give current card
cardid = deck[curcard];
// move to next card
@ -4564,18 +4563,18 @@ int getrandomcard(void) {
curcard = 0;
}
// make sure the player doesn't have it!
gotit = B_FALSE;
ok = B_TRUE;
if (player) {
for (i = 0; i < player->numcards; i++) {
if (player->card[i] == cardid) {
gotit = B_TRUE;
ok = B_FALSE;
}
}
}
if (player2) {
for (i = 0; i < player2->numcards; i++) {
if (player2->card[i] == cardid) {
gotit = B_TRUE;
ok = B_FALSE;
}
}
}
@ -4591,8 +4590,8 @@ int getrandomcard(void) {
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 (cval == (getcardvalue(cardid)+1)) okay = B_TRUE;
//if (cval == (getcardvalue(cardid)-1)) okay = B_TRUE;
}
}
if (player2 && !okay) {
@ -4601,17 +4600,17 @@ int getrandomcard(void) {
csuit = getcardsuit(player2->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 (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;
}
ok = B_FALSE;
}
}
}
} // end while !ok
return cardid;
}

12
todo
View File

@ -1,8 +1,16 @@
- make points worth chasing for something more than a high schore
- bonus level teleport appears on next level once you
reach a certain amount of points ?
- ability to spent points on something in a shop?
- bonus levels or shop gives:
permenant special power ?
- Make level editor work again in opengl
- add help to level editor!
- Add a level with an 'animspike' to test it.
- top left tile is always blank??
- New powerups: