diff options
author | Nathan Vance <nathav63@gmail.com> | 2015-01-28 11:49:16 -0500 |
---|---|---|
committer | Nathan Vance <nathav63@gmail.com> | 2015-01-28 11:49:16 -0500 |
commit | 44d006c8a74bed0de617284b9b881fdb4d9754d2 (patch) | |
tree | dea21cb3f65d381f8488280c544a0e65d9ccf583 /cards.c | |
parent | Delete 7w (diff) | |
download | 7w-44d006c8a74bed0de617284b9b881fdb4d9754d2.tar.gz 7w-44d006c8a74bed0de617284b9b881fdb4d9754d2.tar.bz2 7w-44d006c8a74bed0de617284b9b881fdb4d9754d2.zip |
Added basic card printout
Diffstat (limited to 'cards.c')
-rw-r--r-- | cards.c | 24 |
1 files changed, 22 insertions, 2 deletions
@@ -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 |