diff options
author | Nathan Vance <nathav63@gmail.com> | 2015-02-24 15:24:39 -0500 |
---|---|---|
committer | Nathan Vance <nathav63@gmail.com> | 2015-02-24 15:24:39 -0500 |
commit | 952244e7b184bf88122742ad75b884d1eb97eae5 (patch) | |
tree | 0ada6a0b2b200b9e4af7f0c745e25c9fd42b3f3c /player_turn.c | |
parent | Added more support for idefinites, but has major bugs! (diff) | |
download | 7w-952244e7b184bf88122742ad75b884d1eb97eae5.tar.gz 7w-952244e7b184bf88122742ad75b884d1eb97eae5.tar.bz2 7w-952244e7b184bf88122742ad75b884d1eb97eae5.zip |
Added messages, fixed indefinites
Diffstat (limited to 'player_turn.c')
-rw-r--r-- | player_turn.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/player_turn.c b/player_turn.c index cc52825..5d1b122 100644 --- a/player_turn.c +++ b/player_turn.c @@ -14,18 +14,22 @@ void view_refresh(int focus, int cursor, int player); int wonder_numstages(int player); int* cards_getcost(int era, int card); int data_numbuilt(int p); +void postmessage(char* message); +void posthelp(); +void clearmessage(); int player_build(int focus, int cursor, int player) { if(focus == data_numplayers()) { int *hand = data_gethand(player); - if(data_canafford(player, cards_getcost(data_getera(), hand[cursor])) == 2) { + if(data_canafford(player, cards_getcost(data_getera(), hand[cursor]))) { data_build(player, hand[cursor]); return 1; } + else postmessage("Can't afford this!"); } if(focus == 0) { - if(data_canafford(player, cards_getcost(data_getwonder(player), data_getwonderside(player)*3+1+cursor)) == 2) { + if(data_canafford(player, cards_getcost(data_getwonder(player), data_getwonderside(player)*3+1+cursor))) { data_buildwonder(player, 0); //change to choose card used return 1; } @@ -52,11 +56,17 @@ void player_turn(int player) case LEFT: focus--; break; case ENTER: - if(player_build(focus, cursor, player)) - player++; + if(player_build(focus, cursor, player)) { + player++; + cursor = 0; + focus = data_numplayers(); + clearmessage(); + } break; case '\t': focus = (focus+1)%(data_numplayers()+1); break; + case 'h': posthelp(); + break; default: break; } if(player >= data_numplayers()) { |