From 44d006c8a74bed0de617284b9b881fdb4d9754d2 Mon Sep 17 00:00:00 2001 From: Nathan Vance Date: Wed, 28 Jan 2015 11:49:16 -0500 Subject: Added basic card printout --- cards.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'cards.c') diff --git a/cards.c b/cards.c index 113e7f1..fcca690 100644 --- a/cards.c +++ b/cards.c @@ -71,7 +71,7 @@ void cards_updatecoupons() void cards_setname(int era, int card, char *name, int type) { int i; - for(i = 0; (cards[era][card][i+1+NUMRESOURCES+NUMPRODUCTS+4] = name[i]) != '\0'; i++); + for(i = 0; (cards[era][card][i+1+NUMRESOURCES+NUMPRODUCTS+8] = name[i]) != '\0'; i++); cards_settype(era, card, type); } @@ -79,10 +79,30 @@ char* cards_getname(int era, int card) { char *ret = get_chararray(26); int i; - for(i = 0; (ret[i] = cards[era][card][i+1+NUMRESOURCES+NUMPRODUCTS+4]) != '\0'; i++); + for(i = 0; (ret[i] = cards[era][card][i+1+NUMRESOURCES+NUMPRODUCTS+8]) != '\0'; i++); return ret; } +char* getname(int res) +{ + switch(res) { + case WOOD: return "wood"; + case STONE: return "stone"; + case CLAY: return "clay"; + case ORE: return "ore"; + case CLOTH: return "cloth"; + case GLASS: return "glass"; + case PAPER: return "paper"; + case GOLD: return "gold"; + case COMPASS: return "compass"; + case GEAR: return "gear"; + case TABLET: return "tablet"; + case SHIELD: return "shield"; + case VP: return "vp"; + default: return "error"; + } +} + void cards_init() { //Era 1 -- cgit