* Copyright (c) 1983 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
static char sccsid
[] = "@(#)com1.c 5.2 (Berkeley) %G%";
if ((!notes
[CANTMOVE
] && !notes
[LAUNCHED
]) || testbit(location
[position
].objects
, LAND
) || fuel
> 0 && notes
[LAUNCHED
])
puts("You can't go this way.");
whichway(location
[position
]);
else if (notes
[CANTMOVE
] && !notes
[LAUNCHED
])
puts("You aren't able to move; you better drop something.");
puts("You are out of fuel; now you will rot in space forever!");
convert(tothis
) /* Converts day to night and vice versa. */
int tothis
; /* Day objects are permanent. Night objects are added*/
{ /* at dusk, and subtracted at dawn. */
for (i
= 1; i
<= NUMOFROOMS
; i
++)
for (j
= 0; j
< NUMOFWORDS
; j
++)
nightfile
[i
].objects
[j
] = dayfile
[i
].objects
[j
];
for (p
= nightobjs
; p
->room
!= 0; p
++)
setbit(nightfile
[p
->room
].objects
, p
->obj
);
for (i
= 1; i
<= NUMOFROOMS
; i
++)
for (j
= 0; j
< NUMOFWORDS
; j
++)
dayfile
[i
].objects
[j
] = nightfile
[i
].objects
[j
];
for (p
= nightobjs
; p
->room
!= 0; p
++)
clearbit(dayfile
[p
->room
].objects
, p
->obj
);
if (time
> 30 && position
< 32){
puts("An explosion of shuddering magnitude splinters bulkheads and");
puts("ruptures the battlestar's hull. You are sucked out into the");
puts("frozen void of space and killed.");
if (time
> 20 && position
< 32)
puts("Explosions rock the battlestar.");
puts("You drop from exhaustion...");
puts("You're getting tired.");
if (time
> (rythmn
+ CYCLE
)) {
if (location
== nightfile
) {
if (OUTSIDE
&& time
- rythmn
- CYCLE
< 10) {
puts("Dew lit sunbeams stretch out from a watery sunrise and herald the dawn.");
puts("You awake from a misty dream-world into stark reality.");
clearbit(location
[POOLS
].objects
, BATHGOD
);
if (OUTSIDE
&& time
- rythmn
- CYCLE
< 10) {
puts("The dying sun sinks into the ocean, leaving a blood stained sunset.");
puts("The sky slowly fades from orange to violet to black. A few stars");
puts("flicker on, and it is night.");
puts("The world seems completly different at night.");
rythmn
= time
- time
% CYCLE
;
if ((testbit(inven
,TALISMAN
) || testbit(wear
,TALISMAN
)) && (testbit(inven
,MEDALION
) || testbit(wear
,MEDALION
)) && (testbit(inven
,AMULET
) || testbit(wear
,AMULET
))){
puts("The three amulets glow and reenforce each other in power.\nYou are now a wizard.");
if (testbit(location
[position
].objects
,ELF
)){
printf("%s\n",objdes
[ELF
]);
if (testbit(location
[position
].objects
,DARK
)){
printf("%s\n",objdes
[DARK
]);
if (testbit(location
[position
].objects
,WOODSMAN
)){
printf("%s\n",objdes
[WOODSMAN
]);
case 257: /* entering a cave */
case 216: /* leaving a cave */
if (testbit(location
[position
].objects
, GIRL
))
if (meetgirl
&& CYCLE
* 1.5 - time
< 10){
setbit(location
[GARDEN
].objects
,GIRLTALK
);
setbit(location
[GARDEN
].objects
,LAMPON
);
setbit(location
[GARDEN
].objects
,ROPE
);
if (position
== DOCK
&& (beenthere
[position
] || time
> CYCLE
)){
clearbit(location
[DOCK
].objects
, GIRL
);
clearbit(location
[DOCK
].objects
,MAN
);
if (meetgirl
&& time
- CYCLE
* 1.5 > 10){
clearbit(location
[GARDEN
].objects
,GIRLTALK
);
clearbit(location
[GARDEN
].objects
,LAMPON
);
clearbit(location
[GARDEN
].objects
,ROPE
);
if (testbit(location
[position
].objects
,CYLON
)){
puts("Oh my God, you're being shot at by an alien spacecraft!");
printf("The targeting computer says we have %d seconds to attack!\n",clock
);
hurt
= rnd(NUMOFINJURIES
);
puts("Laser blasts sear the cockpit, and the alien veers off in a victory roll.");
puts("The viper shudders under a terrible explosion.");
printf("I'm afraid you have suffered %s.\n", ouch
[hurt
]);
clearbit(location
[position
].objects
,CYLON
);
if (injuries
[SKULL
] && injuries
[INCISE
] && injuries
[NECK
]){
puts("I'm afraid you have suffered fatal injuries.");
for (n
=0; n
< NUMOFINJURIES
; n
++)
if (injuries
[RIBS
] == 2){
if (injuries
[SPINE
] == 2){
if (carrying
> WEIGHT
|| encumber
> CUMBER
)
if (!location
[position
].flyhere
|| (testbit(location
[position
].objects
,LAND
) && fuel
<= 0)){
if (!location
[position
].flyhere
)
puts("You're flying too low. We're going to crash!");
puts("You're out of fuel. We'll have to crash land!");
if (!location
[position
].down
){
puts("Your viper strikes the ground and explodes into firey fragments.");
puts("Thick black smoke billows up from the wreckage.");
position
= location
[position
].down
;
setbit(location
[position
].objects
,CRASH
);
puts("The viper explodes into the ground and you lose consciousness...");
hurt1
= rnd(NUMOFINJURIES
- 2) + 2;
hurt2
= rnd(NUMOFINJURIES
- 2) + 2;
injuries
[0] = 1; /* abrasions */
injuries
[1] = 1; /* lacerations */
printf("I'm afraid you have suffered %s and %s.\n",ouch
[hurt1
],ouch
[hurt2
]);