No longer consider cards with adjacent values okay for 'lucky' card draws.
This commit is contained in:
parent
846e54e33d
commit
34195cb85a
23
shared.c
23
shared.c
|
@ -4548,13 +4548,12 @@ char *getcardletter(int num) {
|
||||||
int getrandomcard(void) {
|
int getrandomcard(void) {
|
||||||
int i;
|
int i;
|
||||||
int cardid;
|
int cardid;
|
||||||
int gotit;
|
int ok = B_FALSE;
|
||||||
//cardid = P_FIRSTCARD + (rand() % 52);
|
//cardid = P_FIRSTCARD + (rand() % 52);
|
||||||
|
|
||||||
|
|
||||||
// TODO: possible infinite loop?
|
// TODO: possible infinite loop?
|
||||||
gotit = B_TRUE;
|
while (!ok) {
|
||||||
while (gotit) {
|
|
||||||
// give current card
|
// give current card
|
||||||
cardid = deck[curcard];
|
cardid = deck[curcard];
|
||||||
// move to next card
|
// move to next card
|
||||||
|
@ -4564,18 +4563,18 @@ int getrandomcard(void) {
|
||||||
curcard = 0;
|
curcard = 0;
|
||||||
}
|
}
|
||||||
// make sure the player doesn't have it!
|
// make sure the player doesn't have it!
|
||||||
gotit = B_FALSE;
|
ok = B_TRUE;
|
||||||
if (player) {
|
if (player) {
|
||||||
for (i = 0; i < player->numcards; i++) {
|
for (i = 0; i < player->numcards; i++) {
|
||||||
if (player->card[i] == cardid) {
|
if (player->card[i] == cardid) {
|
||||||
gotit = B_TRUE;
|
ok = B_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (player2) {
|
if (player2) {
|
||||||
for (i = 0; i < player2->numcards; i++) {
|
for (i = 0; i < player2->numcards; i++) {
|
||||||
if (player2->card[i] == cardid) {
|
if (player2->card[i] == cardid) {
|
||||||
gotit = B_TRUE;
|
ok = B_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4591,8 +4590,8 @@ int getrandomcard(void) {
|
||||||
csuit = getcardsuit(player->card[i]);
|
csuit = getcardsuit(player->card[i]);
|
||||||
if (csuit == getcardsuit(cardid)) okay = B_TRUE;
|
if (csuit == getcardsuit(cardid)) okay = B_TRUE;
|
||||||
if (cval == (getcardvalue(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) {
|
if (player2 && !okay) {
|
||||||
|
@ -4601,17 +4600,17 @@ int getrandomcard(void) {
|
||||||
csuit = getcardsuit(player2->card[i]);
|
csuit = getcardsuit(player2->card[i]);
|
||||||
if (csuit == getcardsuit(cardid)) okay = B_TRUE;
|
if (csuit == getcardsuit(cardid)) okay = B_TRUE;
|
||||||
if (cval == (getcardvalue(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 not a good card, go to next one
|
||||||
if (!okay) {
|
if (!okay) {
|
||||||
gotit = B_TRUE;
|
ok = B_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // end while !ok
|
||||||
|
|
||||||
return cardid;
|
return cardid;
|
||||||
}
|
}
|
||||||
|
|
12
todo
12
todo
|
@ -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
|
- Make level editor work again in opengl
|
||||||
- add help to level editor!
|
- add help to level editor!
|
||||||
|
|
||||||
- Add a level with an 'animspike' to test it.
|
|
||||||
|
|
||||||
- top left tile is always blank??
|
- top left tile is always blank??
|
||||||
|
|
||||||
- New powerups:
|
- New powerups:
|
||||||
|
|
Loading…
Reference in New Issue