summaryrefslogtreecommitdiffstats
path: root/battlestar
diff options
context:
space:
mode:
authorjsm <jsm@NetBSD.org>2000-09-21 10:22:36 +0000
committerjsm <jsm@NetBSD.org>2000-09-21 10:22:36 +0000
commit9b155f6c698343b8b24b5dff54920f74ae4bbf6c (patch)
tree4b10d1fd00d84f0539d8be85b992bb377d20ea52 /battlestar
parent54fe46ad92fd6283ba380e0692db3d2e686ea6f4 (diff)
downloadbsdgames-darwin-9b155f6c698343b8b24b5dff54920f74ae4bbf6c.tar.gz
bsdgames-darwin-9b155f6c698343b8b24b5dff54920f74ae4bbf6c.tar.zst
bsdgames-darwin-9b155f6c698343b8b24b5dff54920f74ae4bbf6c.zip
If no hand-to-hand weapons are available, try using the laser to kill
in murder(). From OpenBSD.
Diffstat (limited to 'battlestar')
-rw-r--r--battlestar/com2.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/battlestar/com2.c b/battlestar/com2.c
index 19ec2ec6..98cee5c2 100644
--- a/battlestar/com2.c
+++ b/battlestar/com2.c
@@ -1,4 +1,4 @@
-/* $NetBSD: com2.c,v 1.10 2000/09/17 23:04:17 jsm Exp $ */
+/* $NetBSD: com2.c,v 1.11 2000/09/21 10:22:36 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)com2.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: com2.c,v 1.10 2000/09/17 23:04:17 jsm Exp $");
+__RCSID("$NetBSD: com2.c,v 1.11 2000/09/21 10:22:36 jsm Exp $");
#endif
#endif /* not lint */
@@ -178,9 +178,35 @@ murder()
int n;
for (n = 0; !((n == SWORD || n == KNIFE || n == TWO_HANDED || n == MACE || n == CLEAVER || n == BROAD || n == CHAIN || n == SHOVEL || n == HALBERD) && testbit(inven, n)) && n < NUMOFOBJECTS; n++);
- if (n == NUMOFOBJECTS)
- puts("You don't have suitable weapons to kill.");
- else {
+ if (n == NUMOFOBJECTS) {
+ if (testbit(inven, LASER)) {
+ printf("Your laser should do the trick.\n");
+ n = wordnumber;
+ while (wordtype[++n] == ADJS)
+ ;
+ switch(wordvalue[n]) {
+ case NORMGOD:
+ case TIMER:
+ case NATIVE:
+ case MAN:
+ wordvalue[wordnumber] = SHOOT;
+ cypher();
+ break;
+ case -1:
+ puts("Kill what?");
+ break;
+ default:
+ if (wordtype[n] != OBJECT ||
+ wordvalue[wordnumber] == EVERYTHING)
+ puts("You can't kill that!");
+ else
+ printf("You can't kill the %s!\n",
+ objsht[wordvalue[n]]);
+ break;
+ }
+ } else
+ puts("You don't have suitable weapons to kill.");
+ } else {
printf("Your %s should do the trick.\n", objsht[n]);
while (wordtype[++wordnumber] == ADJS);
switch (wordvalue[wordnumber]) {