2025-02-04 18:47:56 -05:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#include "field_multiplier.h"
|
|
|
|
#include "card.h"
|
|
|
|
|
2025-02-22 13:50:38 -05:00
|
|
|
static FieldMultiplier small_field = { "Small Field", "", 1 };
|
|
|
|
static FieldMultiplier large_field = { "Large Field", "Score transfers are doubled", 2 };
|
|
|
|
static FieldMultiplier grand_field = { "Grand Field", "Score transfers are quadrupled" ,4 };
|
2025-02-15 15:51:53 -05:00
|
|
|
|
|
|
|
FieldMultiplier *calculate_field_multiplier(Hand *h) {
|
2025-02-04 18:47:56 -05:00
|
|
|
bool large = false;
|
|
|
|
for (int i = 0; i < h->count; i++) {
|
|
|
|
Card *c = h->cards[i];
|
|
|
|
if (c->index == CRANE_INDEX || c->index == CURTAIN_INDEX || c->index == MOON_INDEX)
|
|
|
|
large = true;
|
|
|
|
else if (c->index == RAINY_MAN_INDEX || c->index == PHOENIX_INDEX)
|
|
|
|
return &grand_field;
|
|
|
|
}
|
|
|
|
|
|
|
|
return large ? &large_field : &small_field;
|
|
|
|
}
|