!%

Constant Story "Romeroland";
Constant Headline "School of the Dead^
		^By Vincent Zeng^
		^(for more info, type 'about')^^";
	
Release 1;
Include "Parser";
Include "VerbLib";
Include "Menus";
Include "Grammar";

!== time management
Constant TICKMAX = 5;  !== length of a phase 
Global phaseCount= 0; !== how many times we've ticked over
Global currentTick = 0; !== current tick

!== appendix
Global humanDesc = "You're looking a little ragged around the edges, but at least your blood is flowing."; 
Global zombieDesc = "There's this body. You've only got a vague connection to it, but maybe you can order it around.";

Global poss = "the"; !==as a zombie, do not get personal possession

!== player stuff

Global isAwake = false;
Global isShackled = false;

!====CLASSES

Class Room
	with
		cant_go [;
			"You bump uselessly along the wall, but find no exit in that direction.";
		],
		each_turn [;
			currentTick++;

			if (currentTick >= TICKMAX) {  !=== do all the tick stuff
				style bold;
				print "^Everything flickers for a moment.^";
				style roman;
				if (isAwake) {
					box "Your body feels leaden, and you"
					"experience the strange sensation of"
					"sliding up out of your own head."
					"The body isn't yours anymore.";
					isAwake = false;
					poss = "the";
					player.description = zombieDesc;
					move body to player;
					give body ~concealed;
					body.description = "A body. It might even be yours.";
				} else {
					box "You get the sudden feeling of being"
					"sucked right into the body you've been"
					"trying to steer. Your pulse races"
					"briefly. When you open your eyes,"
					"your body feels like your own."; 
					isAwake = true;
					poss = "your";
					move body to location;
					give body concealed;
					body.description = "Your body. You feel pretty attached to it.";
					player.description = humanDesc;
				}
				
				phaseCount++;
				currentTick = 0;
			}
		],
	has	;

!====== ROOMS

Room c_lockroom "C-Level: Under the Stairs"
	with	description
		"Filler.",
		s_to c_stairs,
	has	light;

Room c_stairs "C-Level: Stairwell"
	with	description
		"Filler",
		n_to c_stairs, u_to b_cstairs,
	has	light;

Room b_cstairs "B-Level: Stairwell"
	with	description
		"Filler",
		d_to c_stairs, n_to b_hall1,
	has	light;

Room b_hall1 "B-Level: Hallway"
	with	description
		"",
		s_to b_cstairs, e_to b_fac, n_to b_hall2,
	has	light;

Room b_fac "B-Level: Faculty Office"
	with	description
		"",
		w_to b_hall1,
	has	light;

Room b_hall2 "B-Level: Hallway"
	with	description
		"",
		s_to b_hall1, w_to b_qmd, e_to b_equ, n_to b_hall3,
	has	light;

Room b_qmd "B-Level: Quartermaster Depot"
	with	description
		"",
		e_to b_hall2,
	has	light;

Room b_equ "B-Level: Equipment Office"
	with	description
		"",
		w_to b_hall2,
	has	light;

Room b_hall3 "B-Level: Hallway"
	with	description
		"",
		s_to b_hall2, w_to b_class, n_to b_hall4,
	has	light;

Room b_class "B-Level: Classroom"
	with	description
		"",
		with e_to b_hall3,
	has	light;

Room b_hall4 "B-Level: Hallway"
	with	description
		"",
		s_to b_hall3, w_to b_hall5,
	has	light;

Room b_hall5 "B-Level: Hallway"
	with	description
		"",
		e_to b_hall4, s_to b_dr, n_to b_hall6, nw_to b_hall7,
	has	light;

Room b_dr "B-Level: Main Darkroom"
	with	description
		"",
		n_to b_hall5, sw_to b_bdr, se_to b_adr,
	has	light;

Room b_bdr "B-Level: Beginning Darkroom"
	with	description
		"",
		s_to b_dr,
	has	light;

Room b_adr "B-Level: Advanced Darkroom"
	with	description
		"",
		n_to b_dr,
	has	light;

Room b_hall6 "B-Level: Hallway"
	with	description
		"",
		s_to b_hall5, e_to b_ss, w_to elevator,
	has	light;

Room b_ss "B-Level: Shooting Studio"
	with	description
		"",
		w_to b_hall6, n_to b_ssc,
	has	light;

Room b_ssc "B-Level: Shooting Studio Closet"
	with	description
		"",
		s_to b_ss,
	has	light;

Room b_hall7 "B-Level: Hallway"
	with	description
		"",
		se_to b_hall5, w_to b_astairs, sw_to b_hall8,
	has	light;

Room b_astairs "B-Level: Stairwell"
	with	description
		"",
		e_to b_hall7,
	has	light;

Room b_hall8 "B-Level: Hallway"
	with	description
		"",
		ne_to b_hall7, s_to b_lpl, n_to b_lpo, w_to b_hall9,
	has	light;

Room b_lpl "B-Level: Letterpress Lab"
	with	description
		"",
		n_to b_hall8,
	has	light;

Room b_lpo "B-Level: Letterpress Office"
	with	description
		"",
		s_to b_hall8, w_to b_lpoc,
	has	light;

Room b_lpoc "B-Level: Letterpress Office Closet"
	with	description
		"",
		e_to b_lpo, n_to b_hole,
	has	light;

Room b_hole "B-Level: ?????????"
	with	description
		"",
		s_to b_lpoc,
	has	light;

Room b_hall9 "B-Level: Hallway"
	with	description
		"", e_to b_hall8, n_to b_ro, w_to b_reese, s_to b_dlab,
	has	light;

Room b_ro "B-Level: Reese Office"
	with	description
		"",
		s_to b_hall9,
	has	light;

Room b_reese "B-Level: Reese Lab"
	with	description
		"",
		e_to b_hall9,
	has	light;

Room b_hall10 "B-Level: Hallway"
	with	description
		"",
		n_to b_hall9, s_to b_dlab,
	has	light;

Room b_dlab "B-Level: Digital Lab"
	with	description
		"",
		n_to b_hall10,
	has	light;

Room elevator "Elevator"
	with	description
		"",
		e_to b_hall6,
	has	light;
!====== STUFF

Object shackles "pair of shackles" 
	with 	description
		"A pair of heavy iron shackles, bolted to the wall.",
		name 'shackles' 'shackle' 'chains' 'manacles',
		with_key shackle_key,
		before [;
		!	Examine:
		!		if (self.worn) {
		!			if (isAwake) {
		!				print_ret "Iron shackles bound tightly around your ankles.";
		!			} else {
		!				print_ret "Iron shackles bound tightly around the ankles.";
		!			}
		!		} else {
		!		}
			Disrobe:
				if (self has locked ) {
					print_ret "It's not possible to remove locked shackles.";
				} else {
					if (isAwake) {
						isShackled = false;
						give self ~worn;
						print_ret "You reach down and open the shackles. They drop to the ground with a heavy clang.";
					} else {
						print_ret "You order the body to remove the shackles, but it just stands there, unable to comprehend.";
					}
				}
			Wear:
				if (isAwake) {
					isShackled = true;
					give self worn;
					print_ret "It's too dangerous to let the body move around on its own; you shackle your ankles.";
				} else {
					print_ret "You order the body to put on the shackles, but it just stands there, unable to comprehend.";
				}
			Take:
				"They're bolted in place.";
			Remove:
				<<Disrobe self>>;
		],
	has	static lockable clothing;

Object shackle_key "shackle key" 
	with	description
		"butts",
		name "key" "shackle key",
	has;

!======= BODY STUFF

Object body "body" 
	with	description
		"A body. It might even be yours.",
		name 'body' 'me' 'corpse' 'zombie' 'pc' 'player' 'reader',
		each_turn [;
		],
		before [;
			Drop, Eat, Attack: 
				"You can't.";
			Think:
				"Yeah, it's definitely your body.";
		],
	has	transparent;

Class Bodypart
	has	;

Bodypart ankles "ankles" body
	with	description 
		"Connects feet to legs.",
		name 'ankles' 'ankle',
	has	;

!=======menus================

Menu about_menu "Underground";
Option -> "Info"
	with description "You are a recent zombie bite victim chained up for everyone else's safety.";
Option -> "Spoilers"
	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.^
		^The zombie form is a lot stronger than the human form, but cannot perform sophisticated tasks.^
		^Your time as a human is limited. Each move you take costs you time.";
Option -> "Credits"
	with description "Vincent Zeng";

Verb 'help' 'about' 'menu' 'hints' 'info' 'credits' 'author'
	* -> Help;

[ HelpSub;
	about_menu.select();
];

!=======initializing==========

[ Initialise ;
	location = c_lockroom;
	lookmode = 2;

	player.description = zombieDesc;
	move body to player;
	move shackles to player;
	!give shackles worn;
	!give shackles locked;
	];
