Refactored jokers stack to be a list (AI used)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "joker.h"
|
||||
#include "util.h"
|
||||
#include "hand_analysis.h"
|
||||
#include "list.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
static JokerEffect default_joker_effect(Joker *joker, Card *scored_card) {
|
||||
@@ -191,16 +192,19 @@ static JokerEffect joker_stencil_effect(Joker *joker, Card *scored_card) {
|
||||
if (scored_card != NULL)
|
||||
return effect; // if card != null, we are not at the end-phase of scoring yet
|
||||
|
||||
List* jokers = get_jokers();
|
||||
|
||||
// +1 xmult per empty joker slot...
|
||||
int num_jokers = get_jokers_top() + 1;
|
||||
int num_jokers = list_get_size(jokers);
|
||||
|
||||
effect.xmult = (MAX_JOKERS_HELD_SIZE) - num_jokers;
|
||||
|
||||
// ...and also each stencil_joker adds +1 xmult
|
||||
JokerObject** jokers = get_jokers();
|
||||
|
||||
for (int i = 0; i < num_jokers; i++ )
|
||||
{
|
||||
if (jokers[i]->joker->id == JOKER_STENCIL_ID)
|
||||
JokerObject* joker_object = list_get(jokers, i);
|
||||
if (joker_object->joker->id == JOKER_STENCIL_ID)
|
||||
effect.xmult++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user