summaryrefslogtreecommitdiffstats
path: root/battlestar
diff options
context:
space:
mode:
authorjsm <jsm@NetBSD.org>2000-09-24 14:42:18 +0000
committerjsm <jsm@NetBSD.org>2000-09-24 14:42:18 +0000
commit520ce860c38b79913e06c3fd240c968228e4c4ae (patch)
tree71a3788b10e2bd7807ca6792e74cad99c614c01e /battlestar
parent9ae968b31504e93c0435f5f1ed75fb2ab2c7cbea (diff)
downloadbsdgames-darwin-520ce860c38b79913e06c3fd240c968228e4c4ae.tar.gz
bsdgames-darwin-520ce860c38b79913e06c3fd240c968228e4c4ae.tar.zst
bsdgames-darwin-520ce860c38b79913e06c3fd240c968228e4c4ae.zip
Give less cryptic messages than "-1%" when WEIGHT or CUMBER are zero.
Diffstat (limited to 'battlestar')
-rw-r--r--battlestar/cypher.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/battlestar/cypher.c b/battlestar/cypher.c
index 6fd3c7df..e6853e44 100644
--- a/battlestar/cypher.c
+++ b/battlestar/cypher.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cypher.c,v 1.18 2000/09/24 09:41:53 jsm Exp $ */
+/* $NetBSD: cypher.c,v 1.19 2000/09/24 14:42:18 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cypher.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: cypher.c,v 1.18 2000/09/24 09:41:53 jsm Exp $");
+__RCSID("$NetBSD: cypher.c,v 1.19 2000/09/24 14:42:18 jsm Exp $");
#endif
#endif /* not lint */
@@ -311,9 +311,21 @@ cypher()
for (n = 0; n < NUMOFOBJECTS; n++)
if (testbit(inven, n))
printf("\t%s\n", objsht[n]);
- printf("\n= %d kilogram%s (%d%%)\n", carrying, (carrying == 1 ? "." : "s."), (WEIGHT ? carrying * 100 / WEIGHT : -1));
- printf("Your arms are %d%% full.\n",
- (CUMBER ? encumber * 100 / CUMBER : -1));
+ if (WEIGHT == 0)
+ printf("\n= %d kilogram%s (can't lift any weight%s)\n",
+ carrying,
+ (carrying == 1 ? "." : "s."),
+ (carrying ? " or move with what you have" : ""));
+ else
+ printf("\n= %d kilogram%s (%d%%)\n",
+ carrying,
+ (carrying == 1 ? "." : "s."),
+ carrying * 100 / WEIGHT);
+ if (CUMBER == 0)
+ printf("Your arms can't pick anything up.\n");
+ else
+ printf("Your arms are %d%% full.\n",
+ encumber * 100 / CUMBER);
} else
puts("You aren't carrying anything.");