-/* $NetBSD: command5.c,v 1.4 2012/06/19 05:46:08 dholland Exp $ */
+/* $NetBSD: command5.c,v 1.6 2021/05/02 12:50:43 rillig Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)com5.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: command5.c,v 1.4 2012/06/19 05:46:08 dholland Exp $");
+__RCSID("$NetBSD: command5.c,v 1.6 2021/05/02 12:50:43 rillig Exp $");
#endif
#endif /* not lint */
return;
}
if (wordtype[wordnumber] == NOUNS) {
- if (testbit(location[position].objects,
+ if (testbit(location[position].objects,
wordvalue[wordnumber])) {
pleasure++;
printf("Kissed.\n");
}
printf("Goddess:\n");
if (!loved)
- setbit(location[position].objects,
+ setbit(location[position].objects,
MEDALION);
loved = 1;
ourtime += 10;
return;
}
}
- if (testbit(location[position].objects,
+ if (testbit(location[position].objects,
wordvalue[wordnumber])) {
if (wordvalue[wordnumber] == NATIVE) {
printf("The girl is easy prey. She peels ");
{
int oldtime;
int n;
+ int zzztime;
+
+ zzztime = (3 * CYCLE) / 4;
oldtime = ourtime;
- if ((snooze - ourtime) < (0.75 * CYCLE)) {
- ourtime += 0.75 * CYCLE - (snooze - ourtime);
+ if ((snooze - ourtime) < zzztime) {
+ ourtime += zzztime - (snooze - ourtime);
printf("<zzz>");
for (n = 0; n < ourtime - oldtime; n++)
printf(".");
while (!testbit(inven, n))
n = rnd(NUMOFOBJECTS);
clearbit(inven, n);
- if (n != AMULET && n != MEDALION &&
+ if (n != AMULET && n != MEDALION &&
n != TALISMAN)
setbit(
location[position].objects,
last1 = last2 = 0;
firstnumber = wordnumber;
- while (wordtype[++wordnumber] != OBJECT &&
- wordvalue[wordnumber] != AMULET &&
- wordvalue[wordnumber] != MEDALION &&
+ while (wordtype[++wordnumber] != OBJECT &&
+ wordvalue[wordnumber] != AMULET &&
+ wordvalue[wordnumber] != MEDALION &&
wordvalue[wordnumber] != TALISMAN && wordnumber <= wordcount)
continue;
if (wordnumber <= wordcount) {
last1 = wordnumber;
}
wordnumber = firstnumber;
- while ((wordtype[++wordnumber] != NOUNS ||
+ while ((wordtype[++wordnumber] != NOUNS ||
wordvalue[wordnumber] == obj) && wordnumber <= wordcount);
if (wordtype[wordnumber] == NOUNS) {
person = wordvalue[wordnumber];
* the same place. */
wordnumber = last1 - 1;
if (person && testbit(location[position].objects, person)) {
- if (person == NORMGOD && godready < 2 &&
+ if (person == NORMGOD && godready < 2 &&
!(obj == RING || obj == BRACELET))
puts("The goddess won't look at you.");
else
wordnumber = max(last1, last2) + 1;
return (0);
}
- if (result != -1 && (testbit(location[position].objects, obj) ||
+ if (result != -1 && (testbit(location[position].objects, obj) ||
obj == AMULET || obj == MEDALION || obj == TALISMAN)) {
clearbit(location[position].objects, obj);
ourtime++;
ego += 5;
godready += 3;
}
- if (obj == AMULET || obj == MEDALION ||
+ if (obj == AMULET || obj == MEDALION ||
obj == TALISMAN) {
win++;
ego += 5;
printf("you want to win this game, ");
printf("you're going to have to\n");
puts("shoot her!)");
- clearbit(location[position].objects,
+ clearbit(location[position].objects,
MEDALION);
wintime = ourtime;
}