aboutsummaryrefslogtreecommitdiff
path: root/cards.c
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-02-02 11:32:40 -0500
committerNathan Vance <nathav63@gmail.com>2015-02-02 11:32:40 -0500
commite1573d382e5c6cea7d4f470473ed6781553e13a5 (patch)
tree1efb65025b288b774946fd9079b00fde3f8562fb /cards.c
parentAdded basic card printout (diff)
download7w-e1573d382e5c6cea7d4f470473ed6781553e13a5.tar.gz
7w-e1573d382e5c6cea7d4f470473ed6781553e13a5.tar.bz2
7w-e1573d382e5c6cea7d4f470473ed6781553e13a5.zip
Added get coupons method
Diffstat (limited to 'cards.c')
-rw-r--r--cards.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/cards.c b/cards.c
index fcca690..78a84b4 100644
--- a/cards.c
+++ b/cards.c
@@ -53,6 +53,26 @@ void cards_setcoupons(int era, int card, int era1, int card1, int era2, int card
cards[era][card][i++] = card2;
}
+//returns the cards this card is a coupon for
+int* cards_getcoupons(int era, int card)
+{
+ int *ret = get_intarray(4);
+ int i;
+ for(i = 0; i < 4; i++)
+ ret[i] = cards[era][card][1+NUMRESOURCES+NUMPRODUCTS+i];
+ return ret;
+}
+
+//returns cards that make this card free
+int* cards_getcouponed(int era, int card)
+{
+ int *ret = get_intarray(4);
+ int i;
+ for(i = 0; i < 4; i++)
+ ret[i] = cards[era][card][1+NUMRESOURCES+NUMPRODUCTS+4+i];
+ return ret;
+}
+
void cards_updatecoupons()
{
int i, j, k;
bgstack15