{ Dark Army, copyright 1992 by Miron Schmidt. This source code is written in ADL, copyrighted by Ross Cunniff. 1996/APR/6: Tidied up and commented heavily for release. } MESSAGE "\n Compiling Dark Army.\n\n"; INCLUDE "calyx2.adl"; { there may be some bugs now } MESSAGE "\nAnd after that, initialization !\n"; { new object properties } NUMPEOP = 17; { how many men are to be recruited ? } PARTS = 1; { are body-parts in the room ? } DEAD = 18; { how many dead men lie around ? } ROUTINE DieAct, { Handle Death of main actor } cg, { you can't go that way } why1, { cg special 1 } ChkRoomCond, { are body-parts or dead men in the room ? } ChkNumber, { how many men are left ? } SetArmy, { we just recruited some people } Skore, { guess what } Dem1, { The city dem } Dem1Run, { $sdem the city dem } Dem1Stp, { $ddem the city dem } RatDem { The black rat on actor's shoulder } ; NOUN Me; VAR ArmyNum, { How many men do we have in the army? } ArmyStr, { How strong is the army right now? } ArmyMaxStr, { How strong can the army get by practice? } Score, { The current score } xxy; { General var, more convenient than dozens of locals } { Here we have the room names } NOUN castle, road, dungeon, town, limbo, traderoad, alley1, alley2, hut1, magerm, gambling; { Including the objects file from the verbs file is necessary so that the objects know all the (predefined) verbs, but the verbs know the objects and the actor (Me) as well. } INCLUDE "da.v.adl"; { objects are included from there } { room descriptions and connected routines } MESSAGE "Then the room routines: "; MESSAGE "castle, "; castle(LIGHT) = TRUE; castle(SDESC) = ($say "In The Castle.\n"); castle(LDESC) = (IF ($eq ($prop castle SEEN) FALSE) THEN ($say " In a few years this will be all yours. But as long as the old " "fart is still alive, you just have to make compromises ...\n" ) ) ($say " People whizzing around, stupid servants yelling commands, and stuff. It's " "the same with all castles, so why bothering ?\n" " You could leave via the main gates to the north, via the back door to the " "south, or visit the dungeons below.\n" ) ; castle (ACTION) = ($hit .ME 0 road 0 0 0 0 0 0 0 dungeon) ($miss why1 0 cg cg cg cg cg cg cg ChkRoomCond) ; MESSAGE "dungeon, "; dungeon(LIGHT) = TRUE; dungeon(SDESC) = ($say "Dungeon.\n"); dungeon(LDESC) = ($say " You really love this part of the castle. The lower you get on that long, " "winding stairway, the louder the moaning and screaming gets. Years ago, " "you used to lay a hand on the red hot irons yourself. But nowadays you " "enjoy listening to that sweetest of music just enough for inspiration.\n" " The only way is up.\n" ) ; dungeon(ACTION) = ($hit .ME 0 0 0 0 0 0 0 0 castle 0) ($miss cg cg cg cg cg cg cg cg ChkRoomCond cg) ; MESSAGE "road, "; road(LIGHT) = TRUE; road(SDESC) = ($say "The Old Castle Road.\n"); road(LDESC) = ($say " The old road leads directly from the castle moat to the town of Froggiz. " "You will have to walk some miles.\n" ) ; road(ACTION) = ($hit .ME castle town 0 0 0 0 0 0 0 0) ($miss ChkRoomCond Dem1Run cg cg cg cg cg cg cg cg) ; MESSAGE "town, "; town(LIGHT) = TRUE; town(SDESC) = ($say "In The Town.\n"); town(LDESC) = ($say " Froggiz is the biggest town around. You are now on the main street, " "where there are a lot of little \"Shoppes\", not to mention the lots and " "lots of merchants offering their wares with loud voices.\n" " The main Street leads from the castle (to the north) to the trading road " "(just south of here). You could also enter buildings to the northeast or " "southeast, or diverge into the narrow alleys east and west of here.\n" ) ; town(ACTION) = ($hit .ME road traderoad alley1 alley2 hut1 magerm 0 0 0 0) ($miss Dem1Stp Dem1Stp 0 Dem1Stp Dem1Stp Dem1Stp cg cg cg cg) ; MESSAGE "traderoad, "; traderoad(LIGHT) = TRUE; traderoad(SDESC) = ($say "The Trading Road.\n"); traderoad(LDESC) = ($say "No description, man !\n"); traderoad(ACTION) = ($hit .ME town 0 0 0 0 0 0 0 0 0) ($miss Dem1Run cg cg cg cg cg cg cg cg cg) ; MESSAGE "alley1, "; alley1(LIGHT) = TRUE; alley1(SDESC) = ($say "Bright Alley.\n"); alley1(LDESC) = ($say "You gotta use your illusion.\n"); alley1(ACTION) = ($hit .ME 0 0 0 town 0 0 0 0 0 0) ($miss cg cg cg 0 cg cg cg cg cg cg) ; MESSAGE "alley2, "; alley2(LIGHT) = TRUE; alley2(SDESC) = ($say "Dark Alley.\n"); alley2(LDESC) = ($say " This alley is filled up with loads of junk. It smells awful.\n" " There is a door to the north, leading into some kind of gambling hall.\n" ) ; alley2(ACTION) = ($hit .ME gambling 0 town 0 0 0 0 0 0 0) ($miss 0 cg Dem1Run cg cg cg cg cg cg cg) ; MESSAGE "hut1, "; hut1(LIGHT) = TRUE; hut1(SDESC) = ($say "Unused Hut.\n"); hut1(LDESC) = ($say " Although this hut is obviously not inhabited, someone must have lived " "here some time. The floor is littered with clay shards, and three " "cushioned seats have been ripped apart. " ) (IF ($eq ($prop hut1 SEEN) FALSE) THEN ($say "In other words - this room was looted by vandals (perhaps is was " "the White Army - after all, rapture and levy are the victor's " "right)." ) ) ($say "\n") ; hut1(ACTION) = ($hit .ME 0 0 0 0 0 0 0 town 0 0) ($miss cg cg cg cg cg cg cg Dem1Run cg cg) ; MESSAGE "magerm, "; magerm(LIGHT) = TRUE; magerm(SDESC) = ($say "The Town Magician's Place.\n"); magerm(LDESC) = ($say "Nothing big yet.\n"); magerm(ACTION) = ($hit .ME 0 0 0 0 0 0 town 0 0 0) ($miss cg cg cg cg cg cg Dem1Run cg cg cg) ; MESSAGE "gambling, "; gambling(LIGHT) = TRUE; gambling(SDESC) = ($say "Gambling Hall.\n"); gambling(LDESC) = ($say "Ooooops. No description.\n"); gambling(ACTION) = ($hit .ME 0 alley1 0 0 0 0 0 0 0 0) ($miss cg 0 cg cg cg cg cg cg cg cg) ; { General routines, starting with START, then alphabetically } MESSAGE "... done !\nDoing general routines.\n"; INCREMENT = (IF ($eq .ME Me) THEN ($incturn 1) ELSE ($exit 0)); START = (ClS) ($spec MARGIN 76) ($say "You ever knew it would happen. But why so soon ? One day you are fully " "absorbed with your work on black magic, the other there's the White Army " "knocking on the gates.\n" " Now, as usual, it's up to you. No other than you has the job to recruit " "a Dark Army of at least 700 men, skilled in weaponry, combat, and dying " "arts. In short, your task is to destroy the White Army - within one week.\n" " You've got 77 soldiers from the castle's own guard, but most of these " "are hopelessly drunk all the day. So you need another 700.\n" " There is but one chance - the Red Dragon in the southern mountains. He " "is awfully dangerous and could cope with a 1000 men. But you know how to " "deal with a dragon -- don't you ?\n\n\n" " Press [RETURN]" ) ($read) ($say "\n\n\n\n D A R K A R M Y. A sinister fantasy.\n" " An adventure game by Calyx software.\n" " Project 005. Release 1.\n" " Written and directed by Miron Schmidt.\n" " (C) 1992, 1996.\n\n\n" "Type \"help\" for a list of special commands.\n\n\n" ) ($setg Indent TRUE) (StdInit Me) ($move Me castle) ($sdem INCREMENT) ; { cg is the standard "You can't go that way" message. } cg = ($say "You can't go that way\n"); { ChkNumber is called whenever the player kills someone from a number of people. When the last one is killed, the whole object is removed. } ChkNumber = (IF ($lt ($prop %1 NUMPEOP) 1) THEN ($move %1 limbo) ($say "That was the last one.\n") ) ; { ChkRoomCond is used in a ($miss) routine. Since we can have only one object of a given short name, we move body parts and dead men into every room that ought to have some. } ChkRoomCond = (IF ($eq ($prop ($loc Me) PARTS) TRUE) THEN ($move body-parts ($loc Me)) ) (IF ($eq ($prop ($loc Me) DEAD) 1) THEN ($move [dead man] ($loc Me)) ) (IF ($gt ($prop ($loc Me) DEAD) 1) THEN ($move [dead man] limbo) ($move [dead men] ($loc Me)) ) ; { This daemon is run in the town of Froggiz. I tend to write out text in the least redundant manner possible. (See the (wo)man as an example.) } Dem1Run = ($sdem Dem1); Dem1Stp = ($ddem Dem1); Dem1 = (IF ($pct 15) THEN ($setg xxy ($rand 10)) (IF ($eq @xxy 1) THEN ($say " You overhear an argument between two merchants who both " "claim to sell the better products.\n" ) ELSEIF ($eq @xxy 2) THEN ($say " A drunk accidentally runs into you.\n") ELSEIF ($eq @xxy 3) THEN ($say " Right before you some guys start to fight. In seconds " "a huge crowd gathers around the three of you, dissolving " "after the unsatisfying short and bloodless struggle.\n" ) ELSEIF ($eq @xxy 4) THEN ($say " Someone screams in the distance.\n") ELSEIF ($eq @xxy 5) THEN ($say " You smell some sweet spices.\n") ELSEIF ($eq @xxy 6) THEN ($say " A couple of kids chase a pig bladder.\n") ELSEIF ($eq @xxy 7) THEN ($say " A ") { no sexual discrimination } (IF ($pct 50) THEN ($say "wo")) ($say "man with a kart shoves you away.\n") ELSEIF ($eq @xxy 8) THEN ($say " A cloud of dust makes you cough.\n") ELSEIF ($eq @xxy 9) THEN ($say " You hear some ") (IF ($pct 50) THEN ($say "barking.\n") ELSE ($say "crows\n") ) ELSE ($say " A rider rushes along the street.\n") ) ) ; { This routine is called after any more descriptive text when the player dies. The ADL library (the original as well as my own) doesn't offer the "Play again?" query, so we have to insert it here. } DieAct = ($say "First thing you realize is --\n\n" " *** You are dead ***\n\n" " [Press RETURN]\n" ) ($read) ($say " Then again, black magic isn't the worst thing to hang on to. In a few " "days you'll wake up as a demi-lich ! Let's see if those White Army suckers " "have anything to put in your way NOW ...\n\n" " (Anyway - you could do better in terms of ADVENTURING. Try it again.)\n\n" ) (Skore) ($say "\nDo you really want to try it again ? ") (IF ($yorn) THEN ($spec RESTART) ELSE ($say "\nBye.\n\n\n") ($spec QUIT)) ; { Both dwimmers are set to the standard one provided in the library. } DWIMD = (Dwimmer %1); DWIMI = (Dwimmer %1); { The rat daemon is started when the player gains the rat, and stopped when the rat dies, since there is no other possibility for the player to lose it. } RatDem = (IF ($pct 10) THEN ($setg xxy ($rand 6)) (IF ($eq @xxy 1) THEN ($say " The rat glides through your robe.\n") ELSEIF ($eq @xxy 2) THEN ($say " The rat sniffs in the air.\n") ELSEIF ($eq @xxy 3) THEN ($say " The rat nibbles on your earlobe.\n") ELSEIF ($eq @xxy 4) THEN ($say " The rat sinks its teeth into your sleeve.\n") ELSEIF ($eq @xxy 5) THEN ($say " The rat rubs its snout on your cheek.\n") ELSE ($say " The rat feasts on a freshly-caught moth.\n") ) ) ; { When men are recruited this routine is called with the object to be recruited and its average strength as arguments. } SetArmy = ($setg ArmyNum ($plus @ArmyNum ($prop %1 NUMPEOP))) ($setg ArmyMaxStr ($plus @ArmyMaxStr ($times ($prop %1 NUMPEOP) 10))) ($setg ArmyStr ($plus @ArmyStr ($times ($prop %1 NUMPEOP) %2))) ; { The Skore routine has to be written with a "k" or else ADL confuses it with the variable of the same name. :) } Skore = ($say "Your score is " ($str @Score) " out of a possible 200 in " ($str($turns)) " turns. Your ranking is " ) (IF ($eq @Score 0) THEN ($say "Slave")) (IF ($and ($gt @Score 0) ($lt @Score 50)) THEN ($say "Servant")) (IF ($and ($gt @Score 49) ($lt @Score 100)) THEN ($say "Chief Servant") ) (IF ($and ($gt @Score 99) ($lt @Score 150)) THEN ($say "Servant of the Year") ) (IF ($and ($gt @Score 149) ($lt @Score 200)) THEN ($say "Servant of the Century") ) (IF ($eq @Score 200) THEN ($say "The One Who Did It")) ($say ".\n") ; { why1 is a special "You can't go that way" message. } why1 = ($say " Really, that's clever ! Can't you read, or what ? The White Army is " "having a nice party just beyond these gates. Think again.\n" ) ; { EOF "da.adl" }