melee.105 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. "
  2. 0 -- attacker misses
  3. 1 -- defender unconscious
  4. 2 -- defender dead
  5. 3 -- defender lightly wounded
  6. 4 -- defender seriously wounded
  7. 5 -- staggered
  8. 6 -- loses weapon
  9. 7 -- hesitate (miss on free swing)
  10. 8 -- sitting duck (crunch!)
  11. "
  12. <DEFINE ADD-MELEE (OBJ REM)
  13. #DECL ((OBJ) OBJECT (REM) UVECTOR)
  14. <PUT .OBJ ,ORAND .REM>>
  15. <PSETG SWORD-MELEE
  16. '![![["Your swing misses the " D " by an inch."]
  17. ["A mighty blow, but it misses the " D " by a mile."]
  18. ["You charge, but the " D " jumps nimbly aside."]
  19. ["Clang! Crash! The " D " parries."]
  20. ["A good stroke, but it's too slow, the " D " dodges."]!]
  21. ![["Your sword crashes down, knocking the " D " into dreamland."]
  22. ["The " D " is battered into unconsciousness."]
  23. ["A furious exchange, and the " D " is knocked out!"]!]
  24. ![["It's curtains for the " D " as your sword removes his head."]
  25. ["The fatal blow strikes the " D " square in the heart: He dies."]
  26. ["The " D " takes a final blow and slumps to the floor dead."]!]
  27. ![["The " D " is struck on the arm, blood begins to trickle down."]
  28. ["Your sword pinks the " D " on the wrist, but it's not serious."]
  29. ["Your stroke lands, but it was only the flat of the blade."]
  30. ["The blow lands, making a shallow gash in the " D "'s arm!"]!]
  31. ![["The " D " receives a deep gash in his side."]
  32. ["A savage blow on the thigh! The " D " is stunned but can still fight!"]
  33. ["Slash! Your blow lands! That one hit an artery, it could be serious!"]!]
  34. ![["The " D " is staggered, and drops to his knees."]
  35. ["The " D " is momentarily disoriented and can't fight back."]
  36. ["The force of your blow knocks the " D " back, stunned."]!]
  37. ![["The " D "'s weapon is knocked to the floor, leaving him unarmed."]!]!]>
  38. <PSETG KNIFE-MELEE
  39. '![![["Your stab misses the " D " by an inch."]
  40. ["A good slash, but it misses the " D " by a mile."]
  41. ["You charge, but the " D " jumps nimbly aside."]
  42. ["A quick stroke, but the " D " is on guard."]
  43. ["A good stroke, but it's too slow, the " D " dodges."]!]
  44. ![["The haft of your knife knocks out the " D "."]
  45. ["The " D " drops to the floor, unconscious."]
  46. ["The " D " is knocked out!"]!]
  47. ![["The end for the " D " as your knife severs his jugular."]
  48. ["The fatal thrust strikes the " D " square in the heart: He dies."]
  49. ["The " D " takes a final blow and slumps to the floor dead."]!]
  50. ![["The " D " is slashed on the arm, blood begins to trickle down."]
  51. ["Your knife point pinks the " D " on the wrist, but it's not serious."]
  52. ["Your stroke lands, but it was only the flat of the blade."]
  53. ["The blow lands, making a shallow gash in the " D "'s arm!"]!]
  54. ![["The " D " receives a deep gash in his side."]
  55. ["A savage cut on the leg stuns the " D ", but he can still fight!"]
  56. ["Slash! Your stroke connects! The " D " could be in serious trouble!"]!]
  57. ![["The " D " drops to his knees, staggered."]
  58. ["The " D " is confused and can't fight back."]
  59. ["The quickness of your thrust knocks the " D " back, stunned."]!]
  60. ![["The " D " is disarmed by a subtle feint past his guard."]!]!]>
  61. <PSETG CYCLOPS-MELEE
  62. '![![["The Cyclops misses, but the backwash almost knocks you over."]
  63. ["The Cyclops rushes you, but runs into the wall."]
  64. ["The Cyclops trips over his feet trying to get at you."]
  65. ["The Cyclops unleashes a roundhouse punch, but you have time to dodge."]!]
  66. ![["The Cyclops knocks you unconscious."]
  67. ["The Cyclops sends you crashing to the floor, unconscious."]!]
  68. ![["The Cyclops raises his arms and crushes your skull."]
  69. ["The Cyclops has just essentially ripped you to shreds."]
  70. ["The Cyclops decks you. In fact, you are dead."]
  71. ["The Cyclops breaks your neck with a massive smash."]!]
  72. ![["A quick punch, but it was only a glancing blow."]
  73. ["The Cyclops grabs but you twist free, leaving part of your cloak."]
  74. ["A glancing blow from the Cyclops' fist."]
  75. ["The Cyclops chops at you with the side of his hand, and it connects,
  76. but not solidly."]!]
  77. ![["The Cyclops gets a good grip and breaks your arm."]
  78. ["The monster smashes his huge fist into your chest, breaking several
  79. ribs."]
  80. ["The Cyclops almost knocks the wind out of you with a quick punch."]
  81. ["A flying drop kick breaks your jaw."]
  82. ["The Cyclops breaks your leg with a staggering blow."]!]
  83. ![["The Cyclops knocks you silly, and you reel back."]
  84. ["The Cyclops lands a punch that knocks the wind out of you."]
  85. ["Heedless of your weapons, the Cyclops tosses you against the rock
  86. wall of the room."]
  87. ["The Cyclops grabs you, and almost strangles you before you wiggle
  88. free, breathless."]!]
  89. ![["The Cyclops grabs you by the arm, and you drop your " W "."]
  90. ["The Cyclops kicks your " W " out of your hand."]
  91. ["The Cyclops grabs your " W ", tastes it, and throws it to the
  92. ground in disgust."]
  93. ["The monster grabs you on the wrist, squeezes, and you drop your
  94. " W " in pain."]!]
  95. ![["The Cyclops is so excited by his success that he neglects to kill
  96. you."]
  97. ["The Cyclops, momentarily overcome by remorse, holds back."]
  98. ["The Cyclops seems unable to decide whether to broil or stew his
  99. dinner."]]
  100. ![["The Cyclops, no sportsman, dispatches his unconscious victim."]]!]>
  101. <PSETG TROLL-MELEE
  102. '![![["The troll swings his axe, but it misses."]
  103. ["The troll's axe barely misses your ear."]
  104. ["The axe sweeps past as you jump aside."]
  105. ["The axe crashes against the rock, throwing sparks!"]!]
  106. ![["The flat of the troll's axe hits you delicately on the head, knocking
  107. you out."]!]
  108. ![["The troll lands a killing blow. You are dead."]
  109. ["The troll neatly removes your head."]
  110. ["The troll's axe stroke cleaves you from the nave to the chops."]
  111. ["The troll's axe removes your head."]!]
  112. ![["The axe gets you right in the side. Ouch!"]
  113. ["The flat of the troll's axe skins across your forearm."]
  114. ["The troll's swing almost knocks you over as you barely parry
  115. in time."]
  116. ["The troll swings his axe, and it nicks your arm as you dodge."]!]
  117. ![["The troll charges, and his axe slashes you on your " W " arm."]
  118. ["An axe stroke makes a deep wound in your leg."]
  119. ["The troll's axe swings down, gashing your shoulder."]
  120. ["The troll sees a hole in your defense, and a lightning stroke
  121. opens a wound in your left side."]!]
  122. ![["The troll hits you with a glancing blow, and you are momentarily
  123. stunned."]
  124. ["The troll swings; the blade turns on your armor but crashes
  125. broadside into your head."]
  126. ["You stagger back under a hail of axe strokes."]
  127. ["The troll's mighty blow drops you to your knees."]!]
  128. ![["The axe hits your " W " and knocks it spinning."]
  129. ["The troll swings, you parry, but the force of his blow disarms you."]
  130. ["The axe knocks your " W " out of your hand. It falls to the floor."]
  131. ["Your " W " is knocked out of your hands, but you parried the blow."]!]
  132. ![["The troll strikes at your unconscious form, but misses in his rage."]
  133. ["The troll hesitates, fingering his axe."]
  134. ["The troll scratches his head ruminatively: Might you be magically
  135. protected, he wonders?"]
  136. ["The troll seems afraid to approach your crumpled form."]]
  137. ![["Conquering his fears, the troll puts you to death."]]!]>
  138. <PSETG THIEF-MELEE
  139. '![![["The thief stabs nonchalantly with his stilletto and misses."]
  140. ["You dodge as the thief comes in low."]
  141. ["You parry a lightning thrust, and the thief salutes you with
  142. a grim nod."]
  143. ["The thief tries to sneak past your guard, but you twist away."]!]
  144. ![["Shifting in the midst of a thrust, the thief knocks you unconscious
  145. with the haft of his stilletto."]
  146. ["The thief knocks you out."]!]
  147. ![["Finishing you off, a lightning throw right to the heart."]
  148. ["The stilletto severs your jugular. It looks like the end."]
  149. ["The thief comes in from the side, feints, and inserts the blade
  150. into your ribs."]
  151. ["The thief bows formally, raises his stilletto, and with a wry grin,
  152. ends the battle and your life."]!]
  153. ![["A quick thrust pinks your left arm, and blood starts to
  154. trickle down."]
  155. ["The thief draws blood, raking his stilletto across your arm."]
  156. ["The stilletto flashes faster than you can follow, and blood wells
  157. from your leg."]
  158. ["The thief slowly approaches, strikes like a snake, and leaves
  159. you wounded."]!]
  160. ![["The thief strikes like a snake! The resulting wound is serious."]
  161. ["The thief stabs a deep cut in your upper arm."]
  162. ["The stilletto touches your forehead, and the blood obscures your
  163. vision."]
  164. ["The thief strikes at your wrist, and suddenly your grip is slippery
  165. with blood."]]
  166. ![["The butt of his stilletto cracks you on the skull, and you stagger
  167. back."]
  168. ["You are forced back, and trip over your own feet, falling heavily
  169. to the floor."]
  170. ["The thief rams the haft of his blade into your stomach, leaving
  171. you out of breath."]
  172. ["The thief attacks, and you fall back desperately."]!]
  173. ![["A long, theatrical slash. You catch it on your " W ", but the
  174. thief twists his knife, and the " W " goes flying."]
  175. ["The thief neatly flips your " W " out of your hands, and it drops
  176. to the floor."]
  177. ["You parry a low thrust, and your " W " slips out of your hand."]
  178. ["Avoiding the thief's stilletto, you stumble to the floor, dropping
  179. your " W "."]!]
  180. ![["The thief, a man of good breeding, refrains from attacking a helpless
  181. opponent."]
  182. ["The thief amuses himself by searching your pockets."]
  183. ["The thief entertains himself by rifling your pack."]]
  184. ![["The thief, noticing you begin to stir, reluctantly finishes you off."]
  185. ["The thief, forgetting his essentially genteel upbringing, cuts your
  186. throat."]
  187. ["The thief, who is essentially a pragmatist, dispatches you as a
  188. threat to his livelihood."]]!]>
  189. <MSETG MISSED 0>
  190. <MSETG UNCONSCIOUS 1>
  191. <MSETG KILLED 2>
  192. <MSETG LIGHT-WOUND 3>
  193. <MSETG SERIOUS-WOUND 4>
  194. <MSETG STAGGER 5>
  195. <MSETG LOSE-WEAPON 6>
  196. <MSETG HESITATE 7>
  197. <MSETG SITTING-DUCK 8>
  198. <PSETG DEF1
  199. <UVECTOR
  200. ,MISSED ,MISSED ,MISSED ,MISSED
  201. ,STAGGER ,STAGGER
  202. ,UNCONSCIOUS ,UNCONSCIOUS
  203. ,KILLED ,KILLED ,KILLED ,KILLED ,KILLED>>
  204. <PSETG DEF2A
  205. <UVECTOR
  206. ,MISSED ,MISSED ,MISSED ,MISSED ,MISSED
  207. ,STAGGER ,STAGGER
  208. ,LIGHT-WOUND ,LIGHT-WOUND
  209. ,UNCONSCIOUS>>
  210. <PSETG DEF2B
  211. <UVECTOR
  212. ,MISSED ,MISSED ,MISSED
  213. ,STAGGER ,STAGGER
  214. ,LIGHT-WOUND ,LIGHT-WOUND ,LIGHT-WOUND
  215. ,UNCONSCIOUS
  216. ,KILLED ,KILLED ,KILLED>>
  217. <PSETG DEF3A
  218. <UVECTOR
  219. ,MISSED ,MISSED ,MISSED ,MISSED ,MISSED
  220. ,STAGGER ,STAGGER
  221. ,LIGHT-WOUND ,LIGHT-WOUND
  222. ,SERIOUS-WOUND ,SERIOUS-WOUND>>
  223. <PSETG DEF3B
  224. <UVECTOR
  225. ,MISSED ,MISSED ,MISSED
  226. ,STAGGER ,STAGGER
  227. ,LIGHT-WOUND ,LIGHT-WOUND ,LIGHT-WOUND
  228. ,SERIOUS-WOUND ,SERIOUS-WOUND ,SERIOUS-WOUND>>
  229. <PSETG DEF3C
  230. <UVECTOR
  231. ,MISSED
  232. ,STAGGER ,STAGGER
  233. ,LIGHT-WOUND ,LIGHT-WOUND ,LIGHT-WOUND ,LIGHT-WOUND
  234. ,SERIOUS-WOUND ,SERIOUS-WOUND ,SERIOUS-WOUND>>
  235. <PSETG DEF1-RES <UVECTOR ,DEF1 <REST ,DEF1> <REST ,DEF1 2>>>
  236. <PSETG DEF2-RES <UVECTOR ,DEF2A ,DEF2B <REST ,DEF2B> <REST ,DEF2B 2>>>
  237. <PSETG DEF3-RES <UVECTOR ,DEF3A <REST ,DEF3A> ,DEF3B <REST ,DEF3B> ,DEF3C>>
  238. <SETG STRENGTH-MAX 7>
  239. <SETG STRENGTH-MIN 2>
  240. <SETG CURE-WAIT 30>
  241. <GDECL (DEF1-RES DEF2-RES DEF3-RES)
  242. <UVECTOR [REST UVECTOR]>
  243. (DEF1 DEF2A DEF2B DEF3A DEF3B DEF3C)
  244. <UVECTOR [REST FIX]>
  245. (OPPV) VECTOR
  246. (VILLAINS) <LIST [REST OBJECT]>
  247. (VILLAIN-PROBS) <UVECTOR [REST FIX]>
  248. (STRENGTH-MIN STRENGTH-MAX CURE-WAIT) FIX>
  249. <DEFINE FIGHTING (FROB "AUX" (HERE ,HERE) (OPPS ,OPPV) (HERO ,PLAYER) (FIGHT? <>)
  250. RANDOM-ACTION)
  251. #DECL ((FROB) HACK (OPPS) <VECTOR [REST <OR OBJECT FALSE>]> (HERO) ADV
  252. (HERE) ROOM (FIGHT?) <OR ATOM FALSE>
  253. (RANDOM-ACTION) <OR ATOM OFFSET FALSE>)
  254. <COND
  255. (,PARSE-WON
  256. <MAPR <>
  257. <FUNCTION (OO OV VOUT "AUX" (O <1 .OO>) (S <OCAPAC .O>))
  258. #DECL ((OO) <LIST [REST OBJECT]> (OV) VECTOR
  259. (VOUT) <UVECTOR [REST FIX]> (O) OBJECT (S) FIX)
  260. <PUT .OV 1 <>>
  261. <SET RANDOM-ACTION <OACTION .O>>
  262. <COND (<==? .HERE <OROOM .O>>
  263. <COND (<L? .S 0>
  264. <COND (<AND <NOT <0? <1 .VOUT>>> <PROB <1 .VOUT>>>
  265. <PUT .O ,OCAPAC <- .S>>
  266. <PUT .VOUT 1 0>
  267. <COND (.RANDOM-ACTION
  268. <PUT ,PRSVEC 1 ,IN\!!-WORDS>
  269. <APPLY-RANDOM .RANDOM-ACTION>)>)
  270. (<PUT .VOUT 1 <+ <1 .VOUT> 10>>)>)
  271. (<FIGHTING? .O>
  272. <SET FIGHT? T>
  273. <PUT .OV 1 .O>)
  274. (.RANDOM-ACTION
  275. <PUT ,PRSVEC 1 ,FIRST?!-WORDS>
  276. <COND (<APPLY-RANDOM .RANDOM-ACTION>
  277. <SET FIGHT? T>
  278. <TRO .O ,FIGHTBIT>
  279. <PUT .OV 1 .O>)>)>)
  280. (<N==? .HERE <OROOM .O>>
  281. <COND (<FIGHTING? .O>
  282. <COND (.RANDOM-ACTION
  283. <PUT ,PRSVEC 1 ,FIGHT!-WORDS>
  284. <APPLY-RANDOM .RANDOM-ACTION>)>)>
  285. <TRZ .HERO ,ASTAGGERED>
  286. <TRZ .O ,STAGGERED>
  287. <TRZ .O ,FIGHTBIT>
  288. <COND (<L? .S 0>
  289. <PUT .O ,OCAPAC <- .S>>
  290. <COND (.RANDOM-ACTION
  291. <PUT ,PRSVEC 1 ,IN\!!-WORDS>
  292. <APPLY-RANDOM .RANDOM-ACTION>)>)>)>>
  293. ,VILLAINS
  294. .OPPS
  295. ,VILLAIN-PROBS>
  296. <COND (.FIGHT?
  297. <CLOCK-INT ,CURIN>
  298. <REPEAT ((OUT <>) RES)
  299. #DECL ((OUT) <OR FIX FALSE> (RES) <OR FIX FALSE>)
  300. <COND (<MAPF <>
  301. <FUNCTION (O)
  302. #DECL ((O) <OR OBJECT FALSE>)
  303. <COND (<NOT .O>)
  304. (<AND <SET RANDOM-ACTION <OACTION .O>>
  305. <PUT ,PRSVEC 1 ,FIGHT!-WORDS>
  306. <APPLY-RANDOM .RANDOM-ACTION>>)
  307. (<NOT <SET RES
  308. <BLOW .HERO .O <ORAND .O> <> .OUT>>>
  309. <MAPLEAVE <>>)
  310. (<==? .RES ,UNCONSCIOUS>
  311. <SET OUT <+ 2 <MOD <RANDOM> 3>>>)
  312. (T)>>
  313. .OPPS>
  314. <COND (<NOT .OUT> <RETURN>)
  315. (<0? <SET OUT <- .OUT 1>>> <RETURN>)>)
  316. (ELSE <RETURN>)>>)>)>>
  317. <DEFINE PRES (TAB A D W "AUX" (L <LENGTH .TAB>))
  318. #DECL ((TAB) <UVECTOR [REST VECTOR]> (A D) STRING
  319. (W) <OR STRING FALSE>)
  320. <MAPF <>
  321. <FUNCTION (S)
  322. <COND (<TYPE? .S STRING> <TELL .S 0>)
  323. (<TYPE? .S ATOM>
  324. <COND (<==? .S A> <TELL .A 0>)
  325. (<==? .S D> <TELL .D 0>)
  326. (<AND .W <==? .S W>> <TELL .W 0>)>)>>
  327. <NTH .TAB <+ 1 <MOD <RANDOM> .L>>>>
  328. <TELL "" 1>>
  329. <DEFINE FIGHT-STRENGTH (HERO "OPTIONAL" (ADJUST? T)
  330. "AUX" S (SMAX ,STRENGTH-MAX) (SMIN ,STRENGTH-MIN))
  331. #DECL ((HERO) ADV (S SMAX SMIN VALUE) FIX (ADJUST?) <OR ATOM FALSE>)
  332. <SET S
  333. <+ .SMIN
  334. <FIX <+ .5
  335. <* <- .SMAX .SMIN>
  336. </ <FLOAT <ASCORE .HERO>>
  337. <FLOAT ,SCORE-MAX>>>>>>>
  338. <COND (.ADJUST? <+ .S <ASTRENGTH .HERO>>)(ELSE .S)>>
  339. <GDECL (CURIN) CEVENT>
  340. <DEFINE BLOW (HERO VILLAIN REMARKS HERO? OUT?
  341. "AUX" DWEAPON (VDESC <ODESC2 .VILLAIN>) ATT DEF OA OD TBL RES
  342. NWEAPON RANDOM-ACTION)
  343. #DECL ((HERO) ADV (VILLAIN) OBJECT (DWEAPON NWEAPON) <OR OBJECT FALSE>
  344. (RES OA OD ATT DEF FIX) FIX (REMARKS) <UVECTOR [REST UVECTOR]>
  345. (HERO?) <OR ATOM FALSE> (VDESC) STRING (TBL) <UVECTOR [REST FIX]>
  346. (OUT?) <OR FIX FALSE> (RANDOM-ACTION) <OR ATOM FALSE OFFSET>)
  347. <PROG ()
  348. <COND (.HERO?
  349. <TRO .VILLAIN ,FIGHTBIT>
  350. <COND (<STAGGERED? .HERO>
  351. <TELL
  352. "You are still recovering from that last blow, so your attack is
  353. ineffective.">
  354. <TRZ .HERO ,ASTAGGERED>
  355. <RETURN>)>
  356. <SET OA <SET ATT <FIGHT-STRENGTH .HERO>>>
  357. <COND (<0? <SET OD <SET DEF <OCAPAC .VILLAIN>>>>
  358. <COND (<==? .VILLAIN <FIND-OBJ "#####">>
  359. <RETURN <JIGS-UP
  360. "Well, you really did it that time. Is suicide painless?">>)>
  361. <TELL "Attacking a dead " 1 .VDESC " is pointless.">
  362. <RETURN>)>
  363. <SET DWEAPON
  364. <AND <NOT <EMPTY? <OCONTENTS .VILLAIN>>>
  365. <1 <OCONTENTS .VILLAIN>>>>)
  366. (ELSE
  367. <COND (<STAGGERED? .HERO> <TRZ .HERO ,ASTAGGERED>)>
  368. <COND (<TRNN .VILLAIN ,STAGGERED>
  369. <TELL "The "
  370. 1
  371. .VDESC
  372. " slowly regains his feet.">
  373. <TRZ .VILLAIN ,STAGGERED>
  374. <RETURN 0>)>
  375. <SET OA <SET ATT <OCAPAC .VILLAIN>>>
  376. <COND (<L=? <SET DEF <FIGHT-STRENGTH .HERO>> 0> <RETURN>)>
  377. <SET OD <FIGHT-STRENGTH .HERO <>>>
  378. <SET DWEAPON <FWIM ,WEAPONBIT <AOBJS .HERO> T>>)>
  379. <COND (<L? .DEF 0>
  380. <COND (.HERO?
  381. <TELL "The unconscious " 1 .VDESC
  382. " cannot defend himself: He dies.">)>
  383. <SET RES ,KILLED>)
  384. (ELSE
  385. <COND (<1? .DEF>
  386. <COND (<G? .ATT 2> <SET ATT 3>)>
  387. <SET TBL <NTH ,DEF1-RES .ATT>>)
  388. (<==? .DEF 2>
  389. <COND (<G? .ATT 3> <SET ATT 4>)>
  390. <SET TBL <NTH ,DEF2-RES .ATT>>)
  391. (<G? .DEF 2>
  392. <SET ATT <- .ATT .DEF>>
  393. <COND (<L? .ATT -1> <SET ATT -2>)
  394. (<G? .ATT 1> <SET ATT 2>)>
  395. <SET TBL <NTH ,DEF3-RES <+ .ATT 3>>>)>
  396. <SET RES <NTH .TBL <+ 1 <MOD <RANDOM> 9>>>>
  397. <COND (.OUT?
  398. <COND (<==? .RES ,STAGGER> <SET RES ,HESITATE>)
  399. (ELSE <SET RES ,SITTING-DUCK>)>)>
  400. <COND (<AND <==? .RES ,STAGGER> .DWEAPON <PROB 25>>
  401. <SET RES ,LOSE-WEAPON>)>
  402. <PRES <NTH .REMARKS <+ .RES 1>>
  403. <COND (.HERO? "Adventurer") (ELSE .VDESC)>
  404. <COND (.HERO? .VDESC) (ELSE "Adventurer")>
  405. <AND .DWEAPON <ODESC2 .DWEAPON>>>)>
  406. <COND (<OR <==? .RES ,MISSED> <==? .RES ,HESITATE>>)
  407. (<==? .RES ,UNCONSCIOUS>
  408. <COND (.HERO? <SET DEF <- .DEF>>)>)
  409. (<OR <==? .RES ,KILLED> <==? .RES ,SITTING-DUCK>> <SET DEF 0>)
  410. (<==? .RES ,LIGHT-WOUND> <SET DEF <MAX 0 <- .DEF 1>>>)
  411. (<==? .RES ,SERIOUS-WOUND> <SET DEF <MAX 0 <- .DEF 2>>>)
  412. (<==? .RES ,STAGGER>
  413. <COND (.HERO? <TRO .VILLAIN ,STAGGERED>)
  414. (ELSE <TRO .HERO ,ASTAGGERED>)>)
  415. (<AND <==? .RES ,LOSE-WEAPON> .DWEAPON>
  416. <COND (.HERO?
  417. <REMOVE-OBJECT .DWEAPON>
  418. <INSERT-OBJECT .DWEAPON ,HERE>)
  419. (ELSE
  420. <DROP-OBJECT .DWEAPON .HERO>
  421. <INSERT-OBJECT .DWEAPON ,HERE>
  422. <COND (<SET NWEAPON <FWIM ,WEAPONBIT <AOBJS .HERO> T>>
  423. <TELL
  424. "Fortunately, you still have a " 1 <ODESC2 .NWEAPON> ".">)>)>)
  425. (ELSE <ERROR MELEE "CHOMPS" .RES>)>
  426. <COND (<NOT .HERO?>
  427. <PUT .HERO ,ASTRENGTH <COND (<0? .DEF> -10000)(<- .DEF .OD>)>>
  428. <COND (<L? <- .DEF .OD> 0>
  429. <CLOCK-ENABLE ,CURIN>
  430. <PUT ,CURIN ,CTICK ,CURE-WAIT>)>
  431. <COND (<L=? <FIGHT-STRENGTH .HERO> 0>
  432. <PUT .HERO ,ASTRENGTH <+ 1 <- <FIGHT-STRENGTH .HERO <>>>>>
  433. <JIGS-UP
  434. "It appears that that last blow was too much for you. I'm afraid you
  435. are dead.">
  436. <>)
  437. (.RES)>)
  438. (ELSE
  439. <PUT .VILLAIN ,OCAPAC .DEF>
  440. <COND (<0? .DEF>
  441. <TRZ .VILLAIN ,FIGHTBIT>
  442. <TELL
  443. "Almost as soon as the " 0 .VDESC " breathes his last breath, a cloud
  444. of sinister black fog envelops him, and when the fog lifts, the
  445. carcass has disappeared.">
  446. <REMOVE-OBJECT .VILLAIN>
  447. <COND (<SET RANDOM-ACTION <OACTION .VILLAIN>>
  448. <PUT ,PRSVEC 1 ,DEAD\!!-WORDS>
  449. <APPLY-RANDOM .RANDOM-ACTION>)>
  450. <TELL "">
  451. .RES)
  452. (<==? .RES ,UNCONSCIOUS>
  453. <COND (<SET RANDOM-ACTION <OACTION .VILLAIN>>
  454. <PUT ,PRSVEC 1 ,OUT\!!-WORDS>
  455. <APPLY-RANDOM .RANDOM-ACTION>)>
  456. .RES)
  457. (.RES)>)>>>
  458. <DEFINE WINNING? (V H "AUX" (VS <OCAPAC .V>) (PS <- .VS <FIGHT-STRENGTH .H>>))
  459. #DECL ((V) OBJECT (H) ADV (VS PS) FIX)
  460. <COND (<G? .PS 3> <PROB 90>)
  461. (<G? .PS 0> <PROB 75>)
  462. (<0? .PS> <PROB 50>)
  463. (<G? .VS 1> <PROB 25>)
  464. (ELSE <PROB 10>)>>
  465. <DEFINE CURE-CLOCK ("AUX" (HERO ,PLAYER) (S <ASTRENGTH .HERO>) (I ,CURIN))
  466. #DECL ((HERO) ADV (S) FIX (I) CEVENT)
  467. <COND (<G? .S 0> <PUT .HERO ,ASTRENGTH <SET S 0>>)
  468. (<L? .S 0> <PUT .HERO ,ASTRENGTH <SET S <+ .S 1>>>)>
  469. <COND (<L? .S 0> <PUT .I ,CTICK ,CURE-WAIT>)
  470. (ELSE <CLOCK-DISABLE .I>)>>
  471. <DEFINE DIAGNOSE ("AUX" (W ,WINNER) (MS <FIGHT-STRENGTH .W <>>)
  472. (WD <ASTRENGTH .W>) (RS <+ .MS .WD>) (I <CTICK ,CURIN>))
  473. #DECL ((W) ADV (MS WD RD I) FIX)
  474. <COND (<NOT <CFLAG ,CURIN>>
  475. <SET WD 0>)
  476. (<SET WD <- .WD>>)>
  477. <COND (<0? .WD> <TELL "You are in perfect health.">)
  478. (<1? .WD> <TELL "You have a light wound," 0>)
  479. (<==? .WD 2> <TELL "You have a serious wound," 0>)
  480. (<==? .WD 3> <TELL "You have several wounds," 0>)
  481. (<G? .WD 3> <TELL "You have serious wounds," 0>)>
  482. <COND (<NOT <0? .WD>>
  483. <TELL " which will be cured after " 0>
  484. <PRINC <+ <* ,CURE-WAIT <- .WD 1>> .I>>
  485. <TELL " moves.">)>
  486. <COND (<0? .RS> <TELL "You are dead.">)
  487. (<1? .RS> <TELL "You can be killed by one more light wound.">)
  488. (<==? .RS 2> <TELL "You can be killed by a serious wound.">)
  489. (<==? .RS 3> <TELL "You can survive one serious wound.">)
  490. (<G? .RS 3> <TELL "You are strong enough to take several wounds.">)>
  491. <COND (<NOT <0? ,DEATHS>>
  492. <TELL "You have been killed " 1 <COND (<1? ,DEATHS> "once.")
  493. (T "twice.")>>)>>