From 34195cb85ac5844b5abdc7e2ec9613ef95f5ba5f Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Sun, 24 Jul 2016 20:55:55 +1200 Subject: [PATCH] No longer consider cards with adjacent values okay for 'lucky' card draws. --- shared.c | 23 +++++++++++------------ todo | 12 ++++++++++-- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/shared.c b/shared.c index c10a339..183f8b6 100644 --- a/shared.c +++ b/shared.c @@ -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; } diff --git a/todo b/todo index bc1f3ab..de3b164 100644 --- a/todo +++ b/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 - add help to level editor! -- Add a level with an 'animspike' to test it. - - top left tile is always blank?? - New powerups: