]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - battlestar/com5.c
1 /* $NetBSD: com5.c,v 1.3 1995/03/21 15:07:07 cgd Exp $ */
4 * Copyright (c) 1983, 1993
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by the University of
18 * California, Berkeley and its contributors.
19 * 4. Neither the name of the University nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 static char sccsid
[] = "@(#)com5.c 8.1 (Berkeley) 5/31/93" ;
40 static char rcsid
[] = "$NetBSD: com5.c,v 1.3 1995/03/21 15:07:07 cgd Exp $" ;
48 while ( wordtype
[++ wordnumber
] != NOUNS
&& wordnumber
<= wordcount
);
49 if ( wordtype
[ wordnumber
] == NOUNS
&& testbit ( location
[ position
]. objects
, wordvalue
[ wordnumber
])){
52 switch ( wordvalue
[ wordnumber
]){
56 puts ( "She squirms and avoids your advances." );
59 puts ( "She is coming around; she didn't fight it as much." );
62 puts ( "She's begining to like it." );
65 puts ( "She's gone limp." );
70 puts ( "The lips are warm and her body robust. She pulls you down to the ground." );
73 puts ( "The old man blushes." );
76 puts ( "The dwarf punches you in the kneecap." );
82 else puts ( "I'd prefer not to." );
89 while ( wordtype
[++ wordnumber
] != NOUNS
&& wordnumber
<= wordcount
);
90 if ( wordtype
[ wordnumber
] == NOUNS
&& testbit ( location
[ position
]. objects
, wordvalue
[ wordnumber
])){
91 if ( wordvalue
[ wordnumber
] == NORMGOD
&& ! loved
)
93 puts ( "She cuddles up to you, and her mouth starts to work: \n 'That was my sister's amulet. The lovely goddess, Purl, was she. The Empire \n captured her just after the Darkness came. My other sister, Vert, was killed \n by the Dark Lord himself. He took her amulet and warped its power. \n Your quest was foretold by my father before he died, but to get the Dark Lord's \n amulet you must use cunning and skill. I will leave you my amulet." );
94 puts ( "which you may use as you wish. As for me, I am the last goddess of the \n waters. My father was the Island King, and the rule is rightfully mine.' \n\n She pulls the throne out into a large bed." );
98 if ( card ( injuries
, NUMOFINJURIES
)){
99 puts ( "Her kisses revive you; your wounds are healed. \n " );
100 for ( n
= 0 ; n
< NUMOFINJURIES
; n
++)
105 printf ( "Goddess: \n " );
107 setbit ( location
[ position
]. objects
, MEDALION
);
116 if ( wordvalue
[ wordnumber
] == NATIVE
){
117 puts ( "The girl is easy prey. She peals off her sarong and indulges you." );
126 else puts ( "I't doesn't seem to work." );
135 if (( snooze
- time
) < ( 0.75 * CYCLE
)){
136 time
+= 0.75 * CYCLE
- ( snooze
- time
);
138 for ( n
= 0 ; n
< time
- oldtime
; n
++)
141 snooze
+= 3 * ( time
- oldtime
);
142 if ( notes
[ LAUNCHED
]){
143 fuel
-= ( time
- oldtime
);
144 if ( location
[ position
]. down
){
145 position
= location
[ position
]. down
;
151 if ( OUTSIDE
&& rnd ( 100 ) < 50 ){
152 puts ( "You are awakened abruptly by the sound of someone nearby." );
156 n
= rnd ( NUMOFOBJECTS
);
157 while (! testbit ( inven
, n
))
158 n
= rnd ( NUMOFOBJECTS
);
160 if ( n
!= AMULET
&& n
!= MEDALION
&& n
!= TALISMAN
)
161 setbit ( location
[ position
]. objects
, n
);
162 carrying
-= objwt
[ n
];
163 encumber
-= objcumber
[ n
];
165 puts ( "A fiendish little Elf is stealing your treasures!" );
169 setbit ( location
[ position
]. objects
, DEADWOOD
);
172 setbit ( location
[ position
]. objects
, HALBERD
);
186 if (( time
/ CYCLE
+ 1 ) % 2 && OUTSIDE
)
187 switch (( time
% CYCLE
)/( CYCLE
/ 7 )){
189 puts ( "It is just after sunrise." );
192 puts ( "It is early morning." );
195 puts ( "It is late morning." );
198 puts ( "It is near noon." );
201 puts ( "It is early afternoon." );
204 puts ( "It is late afternoon." );
207 puts ( "It is near sunset." );
211 switch (( time
% CYCLE
)/( CYCLE
/ 7 )){
213 puts ( "It is just after sunset." );
216 puts ( "It is early evening." );
219 puts ( "The evening is getting old." );
222 puts ( "It is near midnight." );
225 puts ( "These are the wee hours of the morning." );
228 puts ( "The night is waning." );
231 puts ( "It is almost morning." );
235 puts ( "I can't tell the time in here." );
240 int obj
= - 1 , result
= - 1 , person
= 0 , firstnumber
, last1
, last2
;
242 firstnumber
= wordnumber
;
243 while ( wordtype
[++ wordnumber
] != OBJECT
&& wordvalue
[ wordnumber
] != AMULET
&& wordvalue
[ wordnumber
] != MEDALION
&& wordvalue
[ wordnumber
] != TALISMAN
&& wordnumber
<= wordcount
);
244 if ( wordnumber
<= wordcount
){
245 obj
= wordvalue
[ wordnumber
];
246 if ( obj
== EVERYTHING
)
247 wordtype
[ wordnumber
] = - 1 ;
250 wordnumber
= firstnumber
;
251 while (( wordtype
[++ wordnumber
] != NOUNS
|| wordvalue
[ wordnumber
] == obj
) && wordnumber
<= wordcount
);
252 if ( wordtype
[ wordnumber
] == NOUNS
){
253 person
= wordvalue
[ wordnumber
];
256 wordnumber
= last1
- 1 ;
257 if ( person
&& testbit ( location
[ position
]. objects
, person
))
258 if ( person
== NORMGOD
&& godready
< 2 && !( obj
== RING
|| obj
== BRACELET
))
259 puts ( "The goddess won't look at you." );
261 result
= drop ( "Given" );
263 puts ( "I don't think that is possible." );
266 if ( result
!= - 1 && ( testbit ( location
[ position
]. objects
, obj
) || obj
== AMULET
|| obj
== MEDALION
|| obj
== TALISMAN
)){
267 clearbit ( location
[ position
]. objects
, obj
);
272 puts ( "She accepts it shyly." );
276 if ( obj
== RING
|| obj
== BRACELET
){
277 puts ( "She takes the charm and puts it on. A little kiss on the cheek is" );
278 puts ( "your reward." );
282 if ( obj
== AMULET
|| obj
== MEDALION
|| obj
== TALISMAN
){
287 puts ( "The powers of the earth are now legitimate. You have destroyed the Darkness" );
288 puts ( "and restored the goddess to her thrown. The entire island celebrates with" );
289 puts ( "dancing and spring feasts. As a measure of her gratitude, the goddess weds you" );
290 puts ( "in the late summer and crowns you Prince Liverwort, Lord of Fungus." );
291 puts ( " \n But, as the year wears on and autumn comes along, you become restless and" );
292 puts ( "yearn for adventure. The goddess, too, realizes that the marriage can't last." );
293 puts ( "She becomes bored and takes several more natives as husbands. One evening," );
294 puts ( "after having been out drinking with the girls, she kicks the throne particulary" );
295 puts ( "hard and wakes you up. (If you want to win this game, you're going to have to \n shoot her!)" );
296 clearbit ( location
[ position
]. objects
, MEDALION
);
303 puts ( "He fingers the coins for a moment and then looks up agape. `Kind you are and" );
304 puts ( "I mean to repay you as best I can.' Grabbing a pencil and cocktail napkin... \n " );
305 printf ( "+-----------------------------------------------------------------------------+ \n " );
306 printf ( "| xxxxxxxx \\ | \n " );
307 printf ( "| xxxxx \\ CLIFFS | \n " );
308 printf ( "| FOREST xxx \\ | \n " );
309 printf ( "| \\\\ x \\ OCEAN | \n " );
310 printf ( "| || x \\ | \n " );
311 printf ( "| || ROAD x \\ | \n " );
312 printf ( "| || x \\ | \n " );
313 printf ( "| SECRET || ......... | \n " );
314 printf ( "| - + - || ........ | \n " );
315 printf ( "| ENTRANCE || ... BEACH | \n " );
316 printf ( "| || ... E | \n " );
317 printf ( "| || ... | | \n " );
318 printf ( "| // ... N <-- + --- S | \n " );
319 printf ( "| PALM GROVE // ... | | \n " );
320 printf ( "| // ... W | \n " );
321 printf ( "+-----------------------------------------------------------------------------+ \n " );
322 puts ( " \n `This map shows a secret entrance to the catacombs." );
323 puts ( "You will know when you arrive because I left an old pair of shoes there.'" );
328 wordnumber
= max ( last1
, last2
);