Added construction descriptions...

This commit is contained in:
Ognjen Milan Robovic 2024-06-16 16:13:33 -04:00
parent c6d1bcc7ab
commit 0d6e5b89d3

View File

@ -126,11 +126,30 @@ static void build_construction (void) {
int reply; int reply;
for (index = 0; index < constructions; ++index) { 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); reply = query (construction_name, constructions);
separate ();
for (index = 0; index < resources; ++index) { for (index = 0; index < resources; ++index) {
if (resource [index] < construction_price [reply] [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]); 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); 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)) { for (reply = reply_help; reply != reply_quit; reply = query (reply_name, replies)) {
separate (); separate ();
@ -180,10 +206,10 @@ int main (void) {
} }
} }
print_constructions ();
separate (); separate ();
print_constructions ();
print ("/0The end!/-\n"); print ("/0The end!/-\n");
separate (); separate ();