underground.inf 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. !% -SD
  2. Constant Story "Underground";
  3. Constant Headline "^A one-room zombie sandbox game
  4. ^By Vincent Zeng^
  5. ^(for more info, type 'about')^^";
  6. Release 0; Serial "141001";
  7. Include "Parser";
  8. Include "VerbLib";
  9. Include "Menus";
  10. Include "Grammar";
  11. !== time management
  12. Constant TICKMAX = 5; !== length of a phase
  13. Global phaseCount= 0; !== how many times we've ticked over
  14. Global currentTick = 0; !== current tick
  15. !== appendix
  16. Global humanDesc = "You're looking a little ragged around the edges, but at
  17. least your blood is flowing.";
  18. Global zombieDesc = "There's this body. You've only got a
  19. vague connection to it, but maybe you can order it around.";
  20. Global poss = "the"; !==as a zombie, do not get personal possession
  21. !== info about character
  22. Global isAwake = false;
  23. Global isShackled = true;
  24. !=======MENUS
  25. !=======CLASSES
  26. Class Room
  27. with
  28. cant_go "That's not helping.",
  29. before [;
  30. Go:
  31. if (isShackled) {
  32. print_ret "Shackles around ", (string) poss, " ankles pull taut with a heavy clang.";
  33. }
  34. Unlock, Disrobe:
  35. if (isAwake) {
  36. } else {
  37. "You order the body around, but it just stands there, unable to comprehend.";
  38. }
  39. ],
  40. each_turn [ ;
  41. currentTick++;
  42. if (currentTick >= TICKMAX) { !=== do all the tick stuff
  43. style bold;
  44. print "The lights flicker for a moment.^";
  45. style roman;
  46. if (isAwake) {
  47. box "Your body feels leaden, and you"
  48. "experience the strange sensation of"
  49. "sliding up out of your own head."
  50. "The body isn't yours anymore.";
  51. isAwake = false;
  52. poss = "the";
  53. player.description = zombieDesc;
  54. move body to player;
  55. give body ~concealed;
  56. body.description = "A body. It might even be yours.";
  57. !new_body = Body.create();
  58. !move new_body to player;
  59. } else {
  60. box "You get the sudden feeling of being"
  61. "sucked right into the body you've been"
  62. "trying to steer. Your pulse races"
  63. "briefly. When you open your eyes,"
  64. "your body feels like your own.";
  65. isAwake = true;
  66. poss = "your";
  67. move body to location;
  68. give body concealed;
  69. body.description = "Your body. You feel pretty attached to it.";
  70. player.description = humanDesc;
  71. }
  72. phaseCount++;
  73. currentTick = 0;
  74. }
  75. if (location == stairwell) { !=== endgame state
  76. deadflag = 3;
  77. print "You walk away from all of this.";
  78. }
  79. ];
  80. Class Prop
  81. with
  82. before [;
  83. Examine:
  84. return false;
  85. default:
  86. print_ret "That's not really useful.";
  87. ],
  88. has scenery;
  89. Class Wall
  90. with description
  91. "Peeling paint and flaking plaster.",
  92. name 'wall' 'walls' 'plaster',
  93. damage 0,
  94. before [;
  95. Attack:
  96. if (self.damage < 3) {
  97. self.damage++;
  98. if (isAwake) {
  99. "You smash at the wall, damaging it a little. It stings.";
  100. } else {
  101. self.damage++;
  102. "On your command, the body thrashes at the wall, doing considerable damage.";
  103. }
  104. } else {
  105. remove self;
  106. print_ret "The wall crumbles away under ", (string) poss, " abuse.";
  107. }
  108. Examine:
  109. switch(self.damage) {
  110. 0:
  111. "Peeling paint and flaking plaster.";
  112. 1:
  113. "Damaged paint and crumbled plaster.";
  114. 2:
  115. "It's falling apart.";
  116. }
  117. ],
  118. has scenery;
  119. !=======ROOMS
  120. Room basement "The Basement"
  121. with description
  122. "The basement is full of junk. Stairs lead up.",
  123. u_to stairwell,
  124. has light;
  125. Wall n_wall "northern wall" basement
  126. with description "The northern wall.",
  127. name 'northern wall' 'north wall',
  128. has ;
  129. Room stairwell "Basement Exit"
  130. with description
  131. "The way out.",
  132. s_to basement,
  133. has light;
  134. !=======OBJECTS
  135. Prop stairs "stairs" basement
  136. with description
  137. "Stairs that lead out of the basement.",
  138. name 'stairs' 'steps' 'stair' 'step',
  139. has ;
  140. Prop lights "lights" basement
  141. with description
  142. "A naked bulb dangling from above.",
  143. name 'lights' 'light' 'lamp' 'bulb',
  144. has ;
  145. Object shackles "pair of shackles"
  146. with description
  147. "A pair of heavy iron shackles, bolted to the wall.",
  148. name 'shackles' 'shackle' 'chains' 'manacles',
  149. with_key shackle_key,
  150. before [;
  151. ! Examine:
  152. ! if (self.worn) {
  153. ! if (isAwake) {
  154. ! print_ret "Iron shackles bound tightly around your ankles.";
  155. ! } else {
  156. ! print_ret "Iron shackles bound tightly around the ankles.";
  157. ! }
  158. ! } else {
  159. ! }
  160. Disrobe:
  161. if (self has locked ) {
  162. print_ret "It's not possible to remove locked shackles.";
  163. } else {
  164. if (isAwake) {
  165. isShackled = false;
  166. give self ~worn;
  167. print_ret "You reach down and open the shackles. They drop to the ground with a heavy clang.";
  168. } else {
  169. print_ret "You order the body to remove the shackles, but it just stands there, unable to comprehend.";
  170. }
  171. }
  172. Wear:
  173. if (isAwake) {
  174. isShackled = true;
  175. give self worn;
  176. print_ret "It's too dangerous to let the body move around on its own; you shackle your ankles.";
  177. } else {
  178. print_ret "You order the body to put on the shackles, but it just stands there, unable to comprehend.";
  179. }
  180. Take:
  181. "They're bolted in place.";
  182. Remove:
  183. <<Disrobe self>>;
  184. ],
  185. has static lockable clothing;
  186. Object shackle_chain "shackle chain" basement
  187. with description
  188. "A heavy chain securing the shackles to the wall.",
  189. name 'chain',
  190. has static scenery;
  191. Object shackle_bolt "shackle bolts" basement
  192. with description
  193. "Four heavy machine bolts securing the shackles to the wall.",
  194. name 'bolt' 'bolts' 'machine' 'screw' 'screws',
  195. has static scenery;
  196. Object shackle_key "shackle key" basement
  197. with description
  198. "butts",
  199. name "key" "shackle key",
  200. has;
  201. Object junk "pile of junk" basement
  202. with description
  203. "A television, a toolbox, a wooden bookshelf, a metal locker...",
  204. name 'junk' 'pile' 'trash' 'clutter',
  205. has transparent container open scenery;
  206. Object tv "television" junk
  207. with description
  208. "A dusty old television.",
  209. name 'tv' 'telly' 'television' 'tube',
  210. has supporter switchable;
  211. Object toolbox "toolbox" junk
  212. with description
  213. "An old red metal toolbox.",
  214. name 'toolbox',
  215. has container openable ~open;
  216. Object wooden_bookshelf "wooden bookshelf" junk
  217. with description
  218. "A rickety wooden bookshelf full of books.",
  219. name 'shelf' 'bookshelf' 'rickety' 'wooden',
  220. has supporter static;
  221. Object locker "metal locker" junk
  222. with description
  223. "A rusty metal locker.",
  224. name 'locker' 'rusty',
  225. has container openable static;
  226. Object puppy "puppy" basement
  227. with description
  228. "A puppy.",
  229. initial [;
  230. if (isAwake) {
  231. print_ret "A small puppy sits in the farthest coner from you, regarding you with caution.";
  232. } else {
  233. print_ret "A small puppy sits in the farthest corner, quiet with fear.";
  234. }
  235. ],
  236. name 'puppy' 'pupy' 'pup' 'dog' 'doggy',
  237. before [;
  238. Take:
  239. print_ret "The pup doesn't budge.";
  240. Open:
  241. if (isAwake) {
  242. print_ret "The puppy whines pitifully at you as you pull on its limbs, then squirms out of your grasp.";
  243. } else {
  244. remove self;
  245. print_ret "With a desperate clawing, the puppy down gets split the middle. It yelps for only a moment.";
  246. }
  247. ],
  248. has animate;
  249. !Class Body (100)
  250. Object body "body"
  251. with description
  252. !if (isAwake) {
  253. ! "Your body. You feel pretty attached to it.",
  254. !} else {
  255. "A body. It might even be yours.",
  256. !}
  257. name 'body' 'me' 'corpse' 'zombie' 'pc' 'player' 'reader',
  258. each_turn [;
  259. ! if (isAwake) {
  260. ! move self to location;
  261. ! give self concealed;
  262. ! } else {
  263. ! move self to player;
  264. ! give self ~concealed;
  265. ! }
  266. ],
  267. before [;
  268. Drop, Eat, Attack:
  269. "You can't.";
  270. Think:
  271. "Yeah, it's definitely your body.";
  272. ],
  273. has transparent;
  274. Class Bodypart
  275. has ;
  276. Bodypart ankles "ankles" body
  277. with description
  278. "Connects feet to legs.",
  279. name 'ankles' 'ankle',
  280. has ;
  281. !=======grammar=============
  282. !=======menus================
  283. Menu about_menu "Underground";
  284. Option -> "Info"
  285. with description "Underground puts you in the position of a zombie bite victim who has been chained up in the basement and left to die.";
  286. Option -> "Spoilers"
  287. with description "You change modes from being awake and present in your body, and being an unconscious zombie every so and so number of moves.^
  288. ^The zombie form is a lot stronger than the human form, but cannot perform sophisticated tasks.^
  289. ^Your time as a human is limited. Each move you take costs you time.^
  290. ^There isn't really 'win' state.";
  291. Option -> "Credits"
  292. with description "";
  293. Verb 'help' 'about' 'menu' 'hints'
  294. * -> Help;
  295. [ HelpSub;
  296. about_menu.select();
  297. ];
  298. !=======initializing==========
  299. [ Initialise ;
  300. location = basement;
  301. lookmode = 2;
  302. player.description = zombieDesc;
  303. !new_body = Body.create();
  304. !move new_body to player;
  305. move body to player;
  306. move shackles to player;
  307. give shackles worn;
  308. give shackles locked;
  309. !print "^Everything seems hazy, as if you are not seeing the world through your eyes.^";
  310. ];