-
Notifications
You must be signed in to change notification settings - Fork 38
/
demons.zil
45 lines (41 loc) · 1.37 KB
/
demons.zil
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"DEMONS for
Zork III: The Dungeon Master
The Great Underground Empire (Part 3)
(c) Copyright 1982 Infocom, Inc. All Rights Reserved.
"
"SWORD demon"
<ROUTINE I-SWORD ("AUX" (DEM <INT I-SWORD>) (NG 0) P T L)
<COND (<IN? ,SWORD ,ADVENTURER>
<COND (<AND <==? ,HERE ,CLIFF> <NOT ,MAN-GONE>> <SET NG 1>)
(<AND <==? ,HERE ,CLIFF-LEDGE> ,MAN-FLAG> <SET NG 1>)
(<INFESTED? ,HERE> <SET NG 2>)
(ELSE
<SET P 0>
<REPEAT ()
<COND (<0? <SET P <NEXTP ,HERE .P>>>
<RETURN>)
(<NOT <L? .P ,LOW-DIRECTION>>
<SET T <GETPT ,HERE .P>>
<SET L <PTSIZE .T>>
<COND (<EQUAL? .L ,UEXIT ,CEXIT ,DEXIT>
<COND (<INFESTED? <GETB .T 0>>
<SET NG 1>
<RETURN>)>)>)>>)>
<COND (<==? .NG ,SWORD-STATE> <RFALSE>)
(<==? .NG 2>
<TELL "Your sword has begun to glow very brightly." CR>)
(<1? .NG>
<TELL "Your sword is glowing with a faint blue glow."
CR>)
(<0? .NG>
<TELL "Your sword is no longer glowing." CR>)>
<SETG SWORD-STATE .NG>
<RTRUE>)
(ELSE <DISABLE .DEM> <RFALSE>)>>
<GLOBAL SWORD-STATE 0>
<ROUTINE INFESTED? (R "AUX" (F <FIRST? .R>))
<REPEAT ()
<COND (<NOT .F> <RETURN <>>)
(<AND <FSET? .F ,ACTORBIT> <NOT <FSET? .F ,INVISIBLE>>>
<RETURN .F>)
(<NOT <SET F <NEXT? .F>>> <RETURN <>>)>>>