From 0d6e5b89d34b6af57c7ee82985bfa7291edcb8d7 Mon Sep 17 00:00:00 2001 From: xolatile Date: Sun, 16 Jun 2024 16:13:33 -0400 Subject: [PATCH] Added construction descriptions... --- xerbia.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/xerbia.c b/xerbia.c index 48f9e49..b315ac6 100644 --- a/xerbia.c +++ b/xerbia.c @@ -126,11 +126,30 @@ static void build_construction (void) { int reply; for (index = 0; index < constructions; ++index) { - print ("/0->/- build /3%s/- ()\n", construction_name [index]); + int price; + + print ("/0->/- build /3%s/- (", construction_name [index]); + + for (price = 0; price < resources; ++price) { + if (construction_price [index] [price] > 0) { + print ((resource [price] < construction_price [index] [price]) ? "/1" : "/2"); + print ("%s %i/-", resource_name [price], construction_price [index] [price]); + } + + if ((price > 0) && (price < resources - 1)) { + print (", "); + } + } + + print (");\n"); } + separate (); + reply = query (construction_name, constructions); + separate (); + for (index = 0; index < resources; ++index) { if (resource [index] < construction_price [reply] [index]) { print ("You don't have enough /1%s/-, need /1%i/- more.\n", resource_name [index], construction_price [reply] [index] - resource [index]); @@ -168,6 +187,13 @@ int main (void) { construction [index] = random (1, 2); } + separate (); + + print ("-- Xerbia is clone of Sumerian game, made for fun in readable and formatted ANSI C.\n"); + print ("-- Original game was designed by Mabel Addis and programmed by William McKay in 1964.\n"); + print ("-- \n"); + print ("-- Ognjen 'xolatile' Milan Robovic\n"); + for (reply = reply_help; reply != reply_quit; reply = query (reply_name, replies)) { separate (); @@ -180,10 +206,10 @@ int main (void) { } } - print_constructions (); - separate (); + print_constructions (); + print ("/0The end!/-\n"); separate ();