/******************************************************************************/
(script 0)
/******************************************************************************/
(include "sci.sh")
/******************************************************************************/
(use "controls")
(use "ego")
(use "pseudomouse")
(use "gamecontrols")
(use "iconbar")
(use "feature")
(use "stopwalk")
(use "dcicon")
(use "grooper")
(use "window")
(use "sound")
(use "cycle")
(use "game")
(use "inv")
(use "user")
(use "features")
(use "obj")

/******************************************************************************/
(local /* GLOBAL */	
	/*  0 */ gEgo
	/*  1 */ gGame
	/*  2 */ gRoom 
	/*  3 */ gSpeed = 6
	/*  4 */ gQuitGame = FALSE
	/*  5 */ gCast
	/*  6 */ gRegions
	/*  7 */ gTimers
	/*  8 */ gSounds
	/*  9 */ gInv
	/*  A */ gAddToPics // gEventHandler
	/*  B */ gRoomNumberExit
	/*  C */ gPreviousRoomNumber
	/*  D */ gRoomNumber 
	/*  E */ gDEBUG_ON_EXIT = FALSE
	/*  F */ gScore 
	/* 10 */ gMaxScore
	/* 11 */ gDefaultPicAni
	/* 12 */ gSpeed2
	/* 13 */ gCurrentCursor
	/* 14 */ gNormalCursor = 999
	/* 15 */ gLoadingCursor = 20
	/* 16 */ gDefaultFont = 1
  global_0017 = 4 // $4
  global_0018 = 0 // $0
  global_0019 = 0 // $0
  global_001A = 1 // $1
  global_001B = 0 // $0
  global_001C = 0 // $0
  global_001D = 0 // $0
  global_001E = 10 // $A
  global_001F = 0 // $0
  global_0020 = 0 // $0
  global_0021 = 0 // $0
  global_0022 = 0 // $0
  global_0023 = 0 // $0
  global_0024 = -1
  global_0025 = 0 // $0
  global_0026 = 0 // $0
  global_0027 = 3
  global_0028 = 0 // $0
  global_0029[22] = $00 $00 $00 
		$00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 
  global_003F = 0 // $0
  global_0040 = 0 // $0
  global_0041 = 0 // $0
  global_0042 = 0
  global_0043 = 1 // $1
  global_0044 = 0 // $0
  global_0045 = 0 // $0
  global_0046 = 0 // $0
  global_0047 = 0 // $0
  global_0048 = 0 // $0
  global_0049 = 0 // $0
  global_004A = 0 // $0
  global_004B[2] = $00 $00 
  global_004D = 0 // $0
  global_004E = 0 // $0
  global_004F = 60 // $3C
  global_0050 = 0 // $0
  global_0051[3] = $00 $00 $00 
  global_0054 = 0 // $0
  global_0055[15] = $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 
  global_0064 = 0 // $0
  global_0065 = 0 // $0
  global_0066 = 0 // $0
  global_0067[3] = $00 $01 $00 
  global_006A = 0 // $0
  global_006B = 0 // $0
  global_006C = 0 // $0
  global_006D = 0 // $0
  global_006E = 0 // $0
  global_006F = 0 // $0
  global_0070 = 0 // $0
  global_0071 = 0 // $0
  global_0072 = 0 // $0
  global_0073 = 0 // $0
  global_0074 = 0 // $0
  global_0075 = 0 // $0
  global_0076 = 0 // $0
  global_0077 = 0 // $0
  global_0078 = 0 // $0
  global_0079 = 0 // $0
  global_007A = 0 // $0
  global_007B = 0 // $0
  global_007C = 0 // $0
  global_007D = 0 // $0
  global_007E = 0 // $0
  global_007F = 0 // $0
  global_0080[164] = $00 $00 $00 $00 $00 
		$00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $A0 $A0 
		$00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $0A $327 $01 $00 $00 $04 $00 $00 $00 
		$00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 
		$00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 
		$00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 
		$00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 
		$00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 
		$00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 
  global_0124 = 0 // $0
  global_0125 = 0 // $0
)
/******************************************************************************/
(instance ego  of LLEgo
	(properties
		x 0
		y 0
		z 0
		heading 0
		noun 0
		nsTop 0
		nsLeft 0
		nsBottom 0
		nsRight 0
		description "you"
		sightAngle 180
		actions 0
		onMeCheck $6789
		approachX 0
		approachY 0
		approachDist 0
		_approachVerbs $6789
		lookStr "You are wearing the latest in fashion -- if you consider 1973 late!"
		yStep 2
		view 800
		loop 0
		cel 0
		priority 0
		underBits 0
		signal 8192
		lsTop 0
		lsLeft 0
		lsBottom 0
		lsRight 0
		brTop 0
		brLeft 0
		brBottom 0
		brRight 0
		palette 0
		cycleSpeed 0
		script 0
		cycler 0
		timer 0
		detailLevel 0
		illegalBits 32768
		xLast 0
		yLast 0
		xStep 3
		moveSpeed 0
		blocks 0
		baseSetter 0
		mover 0
		looper 0
		viewer 0
		avoider 0
		code 0
		edgeHit 0
		{_head} 0
		normal 1
		moveHead 1
	)
	(method (doVerb param1)
		(if(global[$19])
			(send global[$19]:dispose())
		)
		(switch(param1)
			(case 5
				Print("You talk to yourself, and are amazed to discover you already know what you're going to say.")
			)
			(case 3
				(if(proc000_6($2B))
					proc000_8($2B)
					(send gEgo:put(8 0))
					proc_1380($57)
					Print("Good idea. You carefully remove your lubber and dispose of it in a way that will not be described here.")
				)(else
  					Print("Carefully exploring your leisure suit, you find it stylish but empty.")
		    	)
			)
  			(case 10
  				Print("Larry! The whole point of this game was to stop doing that!")
		    )
  			(case 11
  				(if(proc000_6(37))
  					Print("Larry! The whole point of this game was to stop doing that!")
				)(else
					(if(Random(0 1))
						Print("Sniffing your leisure suit thoroughly, you conclude there's nothing quite like the fragrance of fresh polyester! Ahhh!")
					)(else
						Print("Licking your leisure suit leads you to the conclusion that polyester doesn't mean good taste!")
		    		)
		    	)
			)
  			(case 4
  				(switch(param2))
  					(case 0
  						Print(0 7)
  					)
  					(case 1
  						(if(send gRoom:script)
		    				Print(0 8)
		    			)(else
		    				(if((<> (send gGame:view) 800) and (<> (send gGame:view) 809))
		    					Print(0 8)
		    				)(else
		    					(send gRoom:setScript(ScriptID(812 0))
							)
		    			)
		    		)
  					(case 2
  						Print(0 9)
  						Print(0 10 #at -1 140)
		    			)
  						(case 3
  							Print(0 11)
  							(send gEgo:put(3 0))
  						)
  						(case 4
  							Print(0 12)
  							Print(0 13)
  						)
  						(case 5
  							(send gEgo:put(5 110))
  							= global[$9B] 10
  							Print(0 14)
  							Print(0 15 #at -1 140)
  						)
  						(case 6
  							Print(0 16)
  						)
  						(case 7
  							Print(0 17)
  						)
  						(case 8
  							(if(proc000_6($2B))
		    					proc000_8($2B)
							    (send gEgo:put(8 0))
							    proc_1380(87 1)
							   	Print(0 1)
							)(else
								Print(0 18)
							)
						)
						(case 9
							Print(0 19)
							(send gGame:put(9 0)
						)
						(case 11
							Print(0 20)
						)
						(case 12
							(send gEgo:put(12 510))
							= global[$9B] 15
							Print(0 21)
							Print(0 22 #at -1 140)
						)
						(case 14
							Print(0 23)
						)
						(case 15
							Print(0 24)
							Print(0 25)
							Print(0 26)
							proc000_21(103 0 1)
							Format(@global[$170] 0 #1B)
							proc000_10(0 28)
						)
						(case 16
							Print(0 29)
						)
						(super:doVerb(param1)
					)
				)
		    )
  			(default
  				(super:doVerb(param1))
  			)
		)
	)
)
/******************************************************************************/
(instance egoHead  of Head
	(properties
		x 0
		y 0
		z 0
		heading 0
		noun 0
		nsTop 0
		nsLeft 0
		nsBottom 0
		nsRight 0
		description "your head"
		sightAngle $6789
		actions 0
		onMeCheck $6789
		approachX 0
		approachY 0
		approachDist 0
		{_approachVerbs} $6789
		lookStr 0
		yStep 2
		view 809
		loop 0
		cel 0
		priority 0
		underBits 0
		signal 0
		lsTop 0
		lsLeft 0
		lsBottom 0
		lsRight 0
		brTop 0
		brLeft 0
		brBottom 0
		brRight 0
		palette 0
		cycleSpeed 0
		script 0
		cycler 0
		timer 0
		detailLevel 0
		client 0
		{_cnt} 0
		{_offSet} 0
	)
	(method (doVerb param1 param2)
		(if(global[$19])
			(send global[$19]:dispose())
		)
		(switch(param1)
			(case 2
				Print(0 30)
			)
			(case 3
				Print(0 31)
			)
			(default
				(send gEgo:doVerb(param1 param2))
			)
 	)
)
/******************************************************************************/
(instance pointsSound  of Sound
	(properties
		nodePtr 0
		handle 0
		flags 1
		number 821
		vol 127
		priority 0
		loop 1
		signal 0
		prevSignal 0
		dataInc 0
		min 0
		sec 0
		frame 0
		client 0
		owner 0
	)
)
/******************************************************************************/
(instance spraySound  of Sound
	(properties
		nodePtr 0
		handle 0
		flags 1
		number 820
		vol 127
		priority 0
		loop 1
		signal 0
		prevSignal 0
		dataInc 0
		min 0
		sec 0
		frame 0
		client 0
		owner 0
	)
)
/******************************************************************************/
(instance stopGroop  of Grooper
	(properties)
	(method (doit params)
		(if(IsObject(send gEgo:cycler) and (send (send gEgo:cycler):isKindOf(StopWalk)))
			(send gEgo:
				view(send (send gEgo:cycler):vWalking)
			)
		)
		(super:doit(rest params))
  )
)
/******************************************************************************/
(instance babbleIcon  of DCIcon
	(properties)
  	(method (init)
  		(send ( = cycle (Fwd:new()) ):init(self))
  	)
)
/******************************************************************************/
(instance ll1KDHandler  of EventHandler
	(properties)
)
/******************************************************************************/
(instance ll1MDHandler  of EventHandler
	(properties)
)
/******************************************************************************/
(instance ll1DirHandler  of EventHandler
	(properties)
)
/******************************************************************************/
(instance public LSL1  of Game
	(properties)
	(method(init)
		(var temp0, temp1, temp2, temp3, temp4, temp5, temp6)
		= global[$6E] stopGroop
		= global[$26] ll1Win
		= global[$1B] "x.yyy"
		
		(super:init())
		
		= global[$41] ll1DoVerbCode
		= global[$40] ll1FtrInit
		
		(send (= global[$48] ll1KDHandler):add())
		(send (= global[$49] ll1MDHandler):add())
		(send (= global[$4A] ll1DirHandler):add())
		
		= global[$4D] PseudoMouse
		
		(send (= gEgo ego):_head( = global[$79] egoHead ))
		(send (send gEgo:_head):client(gEgo))
		
	    (send ScriptID(816 0):init())
	    Unload(rsSCRIPT 816)
	    
	    (send (= global[$64] longSound):
	    	init()
	    	owner(self)
	    	flags(1)
	    )
	    (send (= global[$66] longSong2):
	    	init()
	    	owner(self)
	    	flags(1)
	    )
	    (send (= global[$A7] longSong3):
	    	init()
	    	owner(self)
	    	flags(1)
	    )
	    
	    (send ScriptID(814 0):init())
	    
	    
		(send (= global[$45] IconBar):
			invLoop(0)
			add(
				icon0
				icon1
				icon2
				icon3
				icon4
				icon5
				icon6
				icon7
				icon8
				icon9
			)
			eachElementDo(#init)
			eachElementDo(#highlightColor global[$8E])
			curIcon(icon0)
			useIconItem(icon4)
			helpIconItem(icon9)
			disable()
		)
		
		(send icon5:
			message(
				(if(HaveMouse())
					$F00
				)(else
					9
				)
			)
		)
		
		(send gcWin:
			color(0)
			back(global[$94])
		)

		(send GameControls:
			window(gcWin)
			add(
	    		iconOk
			    (send detailSlider:
			    	theObj(gGame)
			    	selector(#detailLevel)
			    	topValue(3)
			    	bottomValue(0)
			    	yourself()
			    )
			    (send volumeSlider:
			    	theObj(gGame)
			    	selector(#masterVolume)
			    	topValue(
			    		(if(> global[$6B] 1)
				    		15
				    	)(else
				    		1
				    	)
				    )
				    bottomValue(0)
				    yourself()
				)
			    (send speedSlider:
			    	theObj(speedORama)
			    	selector(#doit)
			    	topValue(0)
			    	bottomValue(5)
			    	yourself()
			    )
			    (send iconSave:
			    	theObj(gGame)
			    	selector(#save)
			    	yourself()
			    )
			    (send iconRestore:
			    	theObj(gGame)
			    	selector(#restore)
			    	yourself()
			    )
			    (send iconRestart:
			    	theObj(gGame)
			    	selector(#restart)
			    	yourself()
			    )
			    (send iconQuit:
			    	theObj(gGame)
			    	selector(#quitGame)
			    	yourself()
			    )
			    (send iconAbout:
			    	theObj(ScriptID(811 0))
			    	selector(#doit)
			    	yourself()
			    )
	  			iconHelp
	  		)
	    	eachElementDo(#highlightColor global[$8E])
	    	eachElementDo(#lowlightColor global[$94])
	    	helpIconItem(iconHelp)
	    	curIcon(iconSave)
	    )


		(if(GameIsRestarting())
			= global[$6C] 100
		)(else
			= global[$6C] 710
		)
		
		(send theDefaultFeature:init())
		(self:newRoom(803))
	)
	(method (doit params)
		(if(<> global[$9A] GetTime(1))
		    = global[$9A] GetTime(1)
			(if(
				(== (& ++global[$99] $3C) 60)
		    	and
		    	(== (& (= global[$99]  (& (= global[$99] (+ global[$99] $40)) $FFC0)) $F00) $F00)
		    	and
		    	(== (& (= global[$99] (& (= global[$99] (+ global[$99] $1000)) $F03F)) $D000) $D000)
		       )
		    		= global[$99] $1000
		    )
			(if(
		    	(> global[$9B 1)
		   		and
		    	(<> gRoomNumberExit 710)
		   		and
		    	(<> gRoomNumberExit 720)
		   		and
		    	(<> gRoomNumberExit 190)
		   		and
		   		(not proc000_6(6))
		   		and
		    	(== --global[$9B] 1)
		  	   )
					= global[$9B] 0
					proc000_7(20)
					
					(if(not proc000_6(5))
				    	(if(global[$19]) 
				    		(send global[$19]:dispose())
						)
						(switch(Random(5))
							(case 1
								Print(0 42)
				 			)
				 			(case 2
								Print(0 43)
							)
							(case 3
								Print(0 44)
				    		)
				    		(case 4
								Print(0 45)
				    		)
				    		(case 5
								Print(0 46)
				    		)
				    	)
				    )
			)
			(if((< global[$9E] 1) and (not proc000_6(1)))
			    (if(global[$19]) 
			    	(send global[$19]:dispose())
			    )
			    Print(0 47)
			    proc000_21(807 1)
			    Format(@global[170] 0 48)
			    proc000_10(0 49)
			)
		)
 		(super:doit(rest params))
	)
	(method (startRoom param1)
		(if(global[$4D])
			(send global[$4D]:stop())
		)
		(if(global[$19])
			(send global[$19]:dispose())
		)
		(send (ScriptID(801)):doit(param1))
		UnLoad(rsSCRIPT 801)
		
		(if(EqualsAny(param1 100 300 400 500 600))
			ScriptID(700)
		)
		(if(EqualsAny(param1 505 385 355 615 200 250 260 371))
			(send icon0:
				loop(15)
				cursor(106)
			)
		)(else
			(send icon0:
				loop(0)
				cursor(100)
			)
		)
		(if(== global[$45] icon0)
			(send gGame:
				setCursor(send icon0:cursor)
				1
			)
		)
		(send cueObj:
			client(NULL)
			theVerb(0)
			theInvItem(0)
		)
		
		(super:startRoom(param1)
		(if(send gCast:contains(gEgo))
			(if((send gEgo:normal) and not(send (send gEgo:cycler):isKindOf(StopWalk)))
					(send gEgo:setCycle(StopWalk 809))
			)
			(if(not (send gEgo:looper))
				(send gEgo:setLoop(stopGroop))
			)
			proc000_17(send egoHead:view)
		)
	)
	(method (restart)
		(end gRoom:
			style(6)
			drawPic(720)
		)
		(send gCast:eachElementDo(#hide))
		(super:restart())
	)
	(method (handleEvent pEvent)
		(var temp0)
		(super:handleEvent(pEvent))
		(if(send pEvent:claimed)
			return(TRUE)
		)
		(if((== gRoomNumberExit 710) or (== gRoomNumberExit 720) or (== gRoomNumberExit 803))
		    return(send pEvent:claimed(TRUE))
		)(else
			(switch(send pEvent:type)
				(case 4
					(switch(send pEvent:message)
						(case $4100
							(send gGame:restore())
						    (send gGame:setCursor(
						    	(send (send global[$45]:curIcon):cursor)
						    	1
						    )
						    (send pEvent:claimed(TRUE))
						)
  						(case $11
							(send gGame:quitGame())
						    (send pEvent:claimed(TRUE))
						)
  						(case $2B
  							(if(> (send gGame:egoMoveSpeed) 0)
		    					(send gGame:egoMoveSpeed(- (send gGame:egoMoveSpeed) 1))
		    					(if(User:canControl())
		    						(send gGame:egoSpeed(send gGame:egoMoveSpeed))
		    					)
		    				)
						)
						(case $2D
							(if(< (send gGame:egoMoveSpeed) 15)
		    					(send gGame:egoMoveSpeed(+ (send gGame:egoMoveSpeed) 1))
								(if(User:canControl)
									(send gEgo:egoSpeed(send gGame:egoMoveSpeed))
		    					)
							)		
						)
						(case $3D
		    				(send gGame:egoMoveSpeed(global[$A9]))
		    				(if(User:canControl())
		    					(send gGame:egoSpeed(send gGame:egoMoveSpeed))
							)
						)
						(case 9
							(if(not (& (send icon5:signal) 4))
								(Inv:showSelf(gGame))
							)
						)
						(case $F00
							(if(not (& (send icon5:signal) 4))
								(Inv:showSelf(gGame))
							)
						)
						(case 3
							(send gGame:setCursor(999 1))
							(send icon8:select())
						)
						(case $3C00
							(if(send gGame:masterVolume)
								(send gGame:masterVolume(0))
							)(else
								(if(> global[$6B] 1)
									(send gGame:masterVolume(15))
								)(else
									(send gGame:masterVolume(1))
		    					)
							)
							(send pEvent:claimed(TRUE))
						)
						(case $3F00
							(send gGame:save())
							(send gGame:setCursor(
								(send (send global[$45]:curIcon):cursor)
								1
							)
							(send pEvent:claimed(TRUE))
						)
					)
				)
			)
		)
	)
	(method (quitGame) // method_09EB
		(send babbleIcon:
			view(853)
			loop(0)
			cycleSpeed(* (+ global[$65] 1) 4)
		)
		(send gGame:setCursor(999 1))
		Animate((send gCast:elements) 0)

		(super:quitGame(
		    Print(
		    	"No! Don't leave me all alone inside your computer! You can't imagine the things your CPU does to me when you're not watching!"
		    	#button "Stop Whining" 1
		    	#button "Oh, All Right" 0
		    	#icon babbleIcon
		    	#title "Don't give up. It's still early!"
		    )
		)
	)
	(method (pragmaFail)
		(var temp0, temp1)
		(if(User:canInput())
			= temp0 (send (User:curEvent):message)
			(if(send IconBar:curInvIcon)
				= temp1 (send (IconBar:curInvIcon):description)
			)(else
				= temp1 (send theDefaultFeature:description)
		    )
		    (if(global[$19])
		    	(send global[$19]:dispose())
			)
			(switch(temp0)
				(case 2
					Print(0 32)
				)
				(case 5
					Print(0 33)
				)
				(case 3
					Print(0 34)
				)
				(case 4
					(switch(temp1)
						(case (send (Inv:at(16)):description)
							Print(0 35)
						)
						(case (send (Inv:at(11)):description)
							Print(0 36)
							Print(0 37 #at -1 140)
						)
						(default
							FormatPrint(0 38 temp1)
						)
					)
				)
				(case 10
					(if(send gRoom:script)
						Print(0 8)
					)(else
						(if((<> (send gEgo:view) 800) and (<> (send gEgo:view) 809))
							Print(0 8)
		    			)(else
							Print(0 39)
		    			)
		    		)
				)
				(case 11
					Print(0 40)
		    	)
		    )
		)
	)
)
/******************************************************************************/
(instance speedORama  of Code
	(properties)
	(method (doit param1)
		(if(paramTotal)
		    (send gGame:egoMoveSpeed(param1))
		    (if(User:canControl())
		    	(send gEgo:egoSpeed(
		    		(send gGame:egoMoveSpeed)
		    	)
		    )
		)
		(send gGame:egoMoveSpeed)
	)
)
/******************************************************************************/
(instance deathIcon  of DCIcon
	(properties)
	(method (init)
		(if(global[$A8])
		    (send (= cycler (End:new())):init(self))
		)(else
		    (send (= cycler (Fwd:new())):init(self))
		)
	)
)
/******************************************************************************/
(instance theDefaultFeature  of Feature
	(properties
		x 0
		y 0
		z 0
		heading 0
		noun 0
		nsTop 0
		nsLeft 0
		nsBottom 0
		nsRight 0
		description "it"
		sightAngle $6789
		actions 0
		onMeCheck $6789
		approachX 0
		approachY 0
		approachDist 0
		{_approachVerbs} $6789
		lookStr 0
	)
)
/******************************************************************************/
(instance icon0  of IconI
	(properties
		view 850
		loop 0
		cel 0
		nsLeft 0
		nsTop 65535
		nsRight 0
		nsBottom 0
		state 0
		cursor 100
		type 16384
		message 1
		modifiers 0
		signal 65
		helpStr "Use this icon to move your character."
		maskView 850
		maskLoop 14
		maskCel 1
		highlightColor 0
		lowlightColor 0
	)
	(method (init)
		(self:lowlightColor(global[$91]))
		(super:init())
	)
)
/******************************************************************************/
(instance icon1  of IconI
	(properties
		view 850
		loop 1
		cel 0
		nsLeft 0
		nsTop 65535
		nsRight 0
		nsBottom 0
		state 0
		cursor 101
		type 16384
		message 2
		modifiers 0
		signal 65
		helpStr "Use this icon to look at things."
		maskView 850
		maskLoop 14
		maskCel 1
		highlightColor 0
		lowlightColor 0
	)
	(method (init)
		(self:lowlightColor(global[$93]))
		(super:init())
	)
)
/******************************************************************************/
(instance icon2  of IconI
	(properties
		view 850
		loop 2
		cel 0
		nsLeft 0
		nsTop 65535
		nsRight 0
		nsBottom 0
		state 0
		cursor 102
		type 16384
		message 3
		modifiers 0
		signal 65
		helpStr "Use this icon to do things."
		maskView 850
		maskLoop 14
		maskCel 0
		highlightColor 0
		lowlightColor 0
	)
	(method (init)
		(self:lowlightColor(global[$8A]))
		(super:init())
	)
)
/******************************************************************************/
(instance icon3  of IconI
	(properties
		view 850
		loop 3
		cel 0
		nsLeft 0
		nsTop 65535
		nsRight 0
		nsBottom 0
		state 0
		cursor 103
		type 16384
		message 5
		modifiers 0
		signal 65
		helpStr "Use this icon to talk to other characters."
		maskView 850
		maskLoop 14
		maskCel 3
		highlightColor 0
		lowlightColor 0
	)
	(method (init)
		(self:lowlightColor(global[$83]))
		(super:init())
	)
)
/******************************************************************************/
(instance icon4  of IconI
	(properties
		view 850
		loop 4
		cel 0
		nsLeft 0
		nsTop 65535
		nsRight 0
		nsBottom 0
		state 0
		cursor 999
		type 16384
		message 4
		modifiers 0
		signal 65
		helpStr "Select this icon to use the current inventory object."
		maskView 850
		maskLoop 14
		maskCel 4
		highlightColor 0
		lowlightColor 0
	)
	(method (init)
		(self:lowlightColor(global[$8A]))
		(super:init())
	)
)
/******************************************************************************/
(instance icon5  of IconI
	(properties
		view 850
		loop 5
		cel 0
		nsLeft 0
		nsTop 65535
		nsRight 0
		nsBottom 0
		state 0
		cursor 999
		type 16384
		message 0
		modifiers 0
		signal 67
		helpStr "Use this icon to bring up the inventory window."
		maskView 850
		maskLoop 14
		maskCel 2
		highlightColor 0
		lowlightColor 0
	)
	(method (init)
		(self:lowlightColor(global[$86]))
		(super:init())
	)
	(method (select params)
		(if(super:select(rest params))
			(Inv:showSelf(gEgo))
		)
	)
)
/******************************************************************************/
(instance icon6  of IconI
	(properties
		view 850
		loop 10
		cel 0
		nsLeft 0
		nsTop 65535
		nsRight 0
		nsBottom 0
		state 0
		cursor 104
		type 16384
		message 10
		modifiers 0
		signal 65
		helpStr "Larry! You know what this is for!"
		maskView 850
		maskLoop 14
		maskCel 0
		highlightColor 0
		lowlightColor 0
	)
	(method (init)
		(self:lowlightColor(global[$87]))
		(super:init())
	)
)
/******************************************************************************/
(instance icon7  of IconI
	(properties
		view 850
		loop 11
		cel 0
		nsLeft 0
		nsTop 65535
		nsRight 0
		nsBottom 0
		state 0
		cursor 105
		type 16384
		message 11
		modifiers 0
		signal 65
		helpStr "This icon is for tasting and smelling."
		maskView 850
		maskLoop 14
		maskCel 1
		highlightColor 0
		lowlightColor 0
	)
	(method (init)
		(self:lowlightColor(global[$93]))
		(super:init())
	)
)
/******************************************************************************/
(instance icon8  of IconI
	(properties
		view 850
		loop 7
		cel 0
		nsLeft 0
		nsTop 65535
		nsRight 0
		nsBottom 0
		state 0
		cursor 999
		type 16384
		message 8
		modifiers 0
		signal 67
		helpStr "This icon brings up the control panel."
		maskView 850
		maskLoop 14
		maskCel 1
		highlightColor 0
		lowlightColor 0
	)
	(method (init)
		(self:lowlightColor(global[$91]))
		(super:init())
	)
	(method (select)
		(if(super:select())
			(send global[$45]:hide())
			(GameControls:show())
		)
	)
)
/******************************************************************************/
(instance icon9  of IconI
	(properties
		view 850
		loop 9
		cel 0
		nsLeft 0
		nsTop 65535
		nsRight 0
		nsBottom 0
		state 0
		cursor 150
		type 16384
		message 6
		modifiers 0
		signal 3
		helpStr "This icon tells you about other icons."
		maskView 850
		maskLoop 14
		maskCel 0
		highlightColor 0
		lowlightColor 0
	)
	(method (init)
		(self:lowlightColor(global[$83]))
		(super:init())
	)
)
/******************************************************************************/
(instance ll1DoVerbCode  of Code
	(properties)
	(method (doit param1 param2 param3)
		(var temp0, temp1)
		(if(send param2:description)
			= temp0 (send param2:description)
		)(else
			= temp0 (send theDefaultFeature:description)
		)
		(if(send gInv:at(param3))
			= temp1 (send (send gInv:at(param3))):description)
		)(else
			= temp1 (send theDefaultFeature:description)
		)
		(if(global[$19])
			(send global[$19]:dispose())
		)
		(if(send param1:facingMe(gEgo))
			(switch(param1)
				(case 2
					(if(send param1:lookStr)
						Print(send param2:lookStr)
					)(else
						FormatPrint(0 50 temp0)
					)
				)
				(case 5
					FormatPrint(0 51 temp0)
				)
				(case 3
					FormatPrint(0 52 temp0)
				)
				(case 4
					(switch(temp1)
						(case (send (send gInv:at(16)))
							FormatPrint(0 53 temp0)
						)
						(case (send (send gInv:at(11)))
							FormatPrint(0 54 temp0)
						)
						(case (send (send gInv:at(11)))
							FormatPrint(0 55 temp1 temp0)
						)
					)
				)
				(case 10
					FormatPrint(0 56 temp0)
				)
				(case 11
					FormatPrint(0 57 temp0)
		    	)
		    )
		)
	)
)
/******************************************************************************/
(instance longSong  of Sound
	(properties)
)
/******************************************************************************/
(instance longSong2  of Sound
	(properties)
)
/******************************************************************************/
(instance longSong3  of Sound
	(properties)
)
/******************************************************************************/
(instance ll1FtrInit  of Code
	(properties)
	(method (doit param1)
		(if(== (send param1:sightAngle) $6789)
			(send param1:sightAngle(points))
		)
		(if(== (send param1:actions) $6789)
			(send param1:actions(0))
		)
	)
)
/******************************************************************************/
(instance ll1Win  of Window
	(properties)
)
/******************************************************************************/
(instance gcWin  of Window
	(properties)
	(method (open)
		(var temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7,
		     temp8, temp9, temp10, temp11, temp12, temp13, temp14[15], temp29[5])
		(self:
			top(/ (- 200 (+ CelHigh(852 1 1) 6)) 2)
			left(/ (- 320 (+ 151 CelWide(852 0 1))) 2)
		    bottom(+ (+ CelHigh(852 1 1) 6) (/ (- 200 (+ CelHigh(852 1 1) 6)) 2))
		    right(+ (+ 151 CelWide(852 0 1)) (/ (- 320 (+ 151 CelWide(852 0 1))) 2))
		    priority(15)
		)
		(super:open())
		DrawCel(
			852
		    0
		    5
		    (+
		    	(/ (- (- (+ 151 CelWide(852 0 1)) (+ 4 CelWide(852 1 1))) CelWide(852 0 5)) 2)
		    	(+ 4 CelWide(852 1 1))
			)
		    6
		    15
		)
		DrawCel(852 1 1 4   3  15)
		DrawCel(852 1 0 94  38 15)
		DrawCel(852 1 0 135 38 15)
		DrawCel(852 0 4 63  (- 37 (+ CelHigh(852 0 4) 3)) 15)
		DrawCel(852 0 3 101 (- 37 (+ CelHigh(852 0 4) 3)) 15)
		DrawCel(852 0 2 146 (- 37 (+ CelHigh(852 0 4) 3)) 15)
		
		Format(@temp14 0 58 gScore gMaxScore)
		TextSize(@temp29 @temp14 999 0)
		Display(
			@temp14
		    dsFONT  global[$16] 
		    dsCOLOR global[$8D] 
		    dsCOORD
			    (+
			    	(+ 10 CelWide(852 1 1))
			    	(/ (- (- (+ 151 CelWide(852 0 1)) (+ (+ 10 CelWide(852 1 1)) 6)) temp29[3]) 2)
			   	)
			    (+ (+ 46 CelHigh(852 0 1)) 3)
		)
	)
)
/******************************************************************************/
(instance detailSlider  of Slider
	(properties
		view 852
		loop 0
		cel 1
		nsLeft 67
		nsTop 37
		nsRight 0
		nsBottom 0
		state 0
		cursor 65535
		type 16384
		message 65535
		modifiers 0
		signal 128
		helpStr 9694
		maskView 0
		maskLoop 0
		maskCel 0
		highlightColor 0
		lowlightColor 0
		sliderView 852
		sliderLoop 0
		sliderCel 0
		sTop 0
		sLeft 0
		sRight 0
		maxY 0
		minY 0
		underBits 0
		yStep 1
		theObj 0
		selector 0
		bottomValue 0
		topValue 3
	)
)
/******************************************************************************/
(instance volumeSlider  of Slider
	(properties
		view 852
		loop 0
		cel 1
		nsLeft 107
		nsTop 37
		nsRight 0
		nsBottom 0
		state 0
		cursor 65535
		type 16384
		message 65535
		modifiers 0
		signal 128
		helpStr 9804
		maskView 0
		maskLoop 0
		maskCel 0
		highlightColor 0
		lowlightColor 0
		sliderView 852
		sliderLoop 0
		sliderCel 0
		sTop 0
		sLeft 0
		sRight 0
		maxY 0
		minY 0
		underBits 0
		yStep 1
		theObj 0
		selector 0
		bottomValue 0
		topValue 15
	)
)
/******************************************************************************/
(instance speedSlider  of Slider
	(properties
		view 852
		loop 0
		cel 1
		nsLeft 147
		nsTop 37
		nsRight 0
		nsBottom 0
		state 0
		cursor 65535
		type 16384
		message 65535
		modifiers 0
		signal 128
		helpStr 9880
		maskView 0
		maskLoop 0
		maskCel 0
		highlightColor 0
		lowlightColor 0
		sliderView 852
		sliderLoop 0
		sliderCel 0
		sTop 0
		sLeft 0
		sRight 0
		maxY 0
		minY 0
		underBits 0
		yStep 1
		theObj 0
		selector 0
		bottomValue 15
		topValue 0
	)
)
/******************************************************************************/
(instance iconSave  of ControlIcon
	(properties
		view 852
		loop 2
		cel 0
		nsLeft 8
		nsTop 6
		nsRight 0
		nsBottom 0
		state 0
		cursor 65535
		type 16384
		message 9
		modifiers 0
		signal 451
		helpStr 9971
		maskView 0
		maskLoop 0
		maskCel 0
		highlightColor 0
		lowlightColor 0
		theObj 0
		selector 0
	)
)
/******************************************************************************/
(instance iconRestore  of ControlIcon
	(properties
		view 852
		loop 3
		cel 0
		nsLeft 8
		nsTop 26
		nsRight 0
		nsBottom 0
		state 0
		cursor 65535
		type 16384
		message 9
		modifiers 0
		signal 451
		helpStr 10101
		maskView 0
		maskLoop 0
		maskCel 0
		highlightColor 0
		lowlightColor 0
		theObj 0
		selector 0
	)
)
/******************************************************************************/
(instance iconRestart  of ControlIcon
	(properties
		view 852
		loop 4
		cel 0
		nsLeft 8
		nsTop 46
		nsRight 0
		nsBottom 0
		state 0
		cursor 65535
		type 16384
		message 9
		modifiers 0
		signal 451
		helpStr 10153
		maskView 0
		maskLoop 0
		maskCel 0
		highlightColor 0
		lowlightColor 0
		theObj 0
		selector 0
	)
)
/******************************************************************************/
(instance iconQuit  of ControlIcon
	(properties
		view 852
		loop 5
		cel 0
		nsLeft 8
		nsTop 66
		nsRight 0
		nsBottom 0
		state 0
		cursor 65535
		type 16384
		message 9
		modifiers 0
		signal 451
		helpStr 10219
		maskView 0
		maskLoop 0
		maskCel 0
		highlightColor 0
		lowlightColor 0
		theObj 0
		selector 0
	)
)
/******************************************************************************/
(instance iconAbout  of ControlIcon
	(properties
		view 852
		loop 6
		cel 0
		nsLeft 8
		nsTop 86
		nsRight 0
		nsBottom 0
		state 0
		cursor 65535
		type 16384
		message 9
		modifiers 0
		signal 451
		helpStr 10256
		maskView 0
		maskLoop 0
		maskCel 0
		highlightColor 0
		lowlightColor 0
		theObj 0
		selector 0
	)
)
/******************************************************************************/
(instance iconHelp  of IconI
	(properties
		view 852
		loop 7
		cel 0
		nsLeft 34
		nsTop 86
		nsRight 0
		nsBottom 0
		state 0
		cursor 150
		type 16384
		message 6
		modifiers 0
		signal 387
		helpStr 10333
		maskView 0
		maskLoop 0
		maskCel 0
		highlightColor 0
		lowlightColor 0
	)
)
/******************************************************************************/
(instance iconOk  of IconI
	(properties
		view 852
		loop 8
		cel 0
		nsLeft 8
		nsTop 106
		nsRight 0
		nsBottom 0
		state 0
		cursor 999
		type 16384
		message 9
		modifiers 0
		signal 451
		helpStr 10378
		maskView 0
		maskLoop 0
		maskCel 0
		highlightColor 0
		lowlightColor 0
	)
)
/******************************************************************************/
(class Person of Actor
	(properties
		x 0
		y 0
		z 0
		heading 0
		noun 0
		nsTop 0
		nsLeft 0
		nsBottom 0
		nsRight 0
		description 0
		sightAngle $6789
		actions 0
		onMeCheck $6789
		approachX 0
		approachY 0
		approachDist 0
		{_approachVerbs} $6789
		lookStr 0
		yStep 2
		view 0
		loop 0
		cel 0
		priority 0
		underBits 0
		signal 0
		lsTop 0
		lsLeft 0
		lsBottom 0
		lsRight 0
		brTop 0
		brLeft 0
		brBottom 0
		brRight 0
		palette 0
		cycleSpeed 0
		script 0
		cycler 0
		timer 0
		detailLevel 0
		illegalBits 32768
		xLast 0
		yLast 0
		xStep 3
		moveSpeed 0
		blocks 0
		baseSetter 0
		mover 0
		looper 0
		viewer 0
		avoider 0
		code 0
		complained 0
	)
	(method (doit)
		(super:doit())
		(if(proc000_6(40))
		    (if(< (self:distanceTo(gEgo)) 30)
		    	proc000_8(40)
		    	(if(global[$19])
		    		(send global[$19]:dispose())
		    	)		
		    	Print(0 59)
		    	Print(0 60)
		    )
		)(else
  			(if(proc000_6(37))
			    (if(< (self:distanceTo(gEgo)) 30)
				    proc000_8(37)
				    (if(global[$19])
				    	(send global[$19]:dispose())
				    )		
				    Print(0 4)
				)
			)(else
			    (if((not global[$9B]) and proc000_6(20) and (not complained)
				   and (< (self:distanceTo(gEgo)) 30))
					    (self:complained(TRUE))
					    (if(global[$19])
					    	(send global[$19]:dispose())
					    )		
					    Print(0 61)
				)
		    )
		)
	)
	(method (doVerb param1)
		(switch(param1)
			(case 3
				(if(global[$19])
					(send global[$19]:dispose())
				)
				Print(0 62)
			)
			(case 4
				FormatPrint(
					0 63
		    		(send (Inv:at(param2)):description)
		    		description
		    	)
			)
			(default 
				(super:doVerb(param1 param2))
		    )
 		)
	)
)
/******************************************************************************/
(procedure public (proc000_1 param1 param2 param3)
	(var temp0)
	= temp0 0
	(send gEgo:view(800))
	(if(> paramTotal 0)
		(send gEgo:loop(param1)
		(if(> paramTotal 1)
			(send gEgo:view(param2)
			(if(> paramTotal 2)
		   	 	= temp0 param3
			)
		)
	)
	(if(not temp0)
		= temp0 809
	)
	(send gEgo:
		normal(TRUE)
		moveHead(TRUE)
		setLoop(-1)
		setLoop(stopGroop)
		setPri(-1)
		setMotion(NULL)
		setCycle(StopWalk temp0)
		setStep(3 2)
		illegalBits($8000)
		ignoreActors(0)
		userSpeed()
	)
)
/******************************************************************************/
(procedure public (proc000_2)
	(var temp0)
	(User:
		canControl(FALSE)
		canInput(FALSE)
	)
	(send gEgo:setMotion(NULL))
	= temp0 (send global_0045:curIcon(NULL))
	(send global_0045:
		disable(
			0
			1
			2
			3
			4
			5
			6
			7
		)
	)
	(send global_0045:curIcon(temp0))
	
	(if(not HaveMouse())
		= global_0077 (send (User:curEvent):x)
		= global_0078 (send (User:curEvent):y)
		(send gGame:setCursor(gLoadingCursor 1 310 180))
	)(else
		(send gGame:setCursor(gLoadingCursor 1))
	)
	(if(global_004D)
		(send global_004D:stop())
	)
)
/******************************************************************************/
(procedure public (proc000_3)
	(User:
		canControl(TRUE)
		canInput(TRUE)
	)
	(send global_0045:
		enable(
			0
			1
			2
			3
			4
			5
			6
			7
		)
	)
	(if(not (send global_0045:curInvIcon))
		(send global_0045:disable(6))
	)
	(if(not HaveMouse())
		(send gGame:setCursor(
		    (send (send global_0045:curIcon):cursor)
		    TRUE
			global_0077 
			global_0078 
		))
	)(else
		(send gGame:setCursor(
		    (send (send global_0045:curIcon):cursor)
		    TRUE
		))
	)
	(send gEgo:userSpeed)
)
/******************************************************************************/
(procedure public (proc000_4 param1)
	(>u MemoryInfo(1) param1)
)
/******************************************************************************/
(procedure public (proc000_5 param1)
	(if(& (send param1:onControl(1)) param2)
		return(1)
	)
)
/******************************************************************************/
(procedure public (proc000_6 param1)
	(& global_006F[/ param1 16] (>> $8000 (% param1 16)))
)
/******************************************************************************/
(procedure public (proc000_7)
	(var temp0)
	= temp0 proc000_6(param1)
	= global_006F[/ param1 16] (| global_006F[/ param1 16] (>> $8000 (% param1 16)))
	return(temp0)
)
/******************************************************************************/
(procedure public (proc000_8)
	(var temp0)
	= temp0 proc000_6(param1)
	= global_006F[/ param1 16] (& global_006F[/ param1 16] bnot(>> $8000 (% param1 16)))
	return(temp0)
)
/******************************************************************************/
(procedure public (proc000_9 param1)
	(if(proc000_6(param1))
		proc000_8(param1) 
	)(else
		proc000_7(param1)
	)
)
/******************************************************************************/
(procedure public (proc000_10 params)
	(var temp0[80])
	Format(@temp0 rest params)
	(send gSounds:eachElementDo(#stop))
	(send global_0064:
		number(190)
		vol($7F)
		loop(1)
		flags(1)
		play()
	)
	(send deathIcon:
		view(global_00A5)
		loop(global_00A6)
		cycleSpeed(* (+ global_0065 1) 4)
	)
	(send gGame:setCursor(999 1))
	Animate( (send gCast:elements) 0 )
	
	(while(1)
  			(switch(Print(
  				@temp0
  				#mode 1
  				#button "Restore" 1
  				#button "Restart" 2
  				#button "    Quit    " 3
  				#icon deathIcon
  				#title @global[170]
  			))
  				(case 1
		    		(send gGame:restore())
		    	)
		    	(case 2
		    		(send gGame:restart())
		    	)
		    	(case 3
		    		= gQuitGame TRUE
		    		return
		    	)
		    )
	)
)
/******************************************************************************/
(procedure public (proc000_11 param1 param2)
	(if(not proc000_6(param1))
		(send gGame:changeScore(param2))
		proc000_7(param1)
		(send pointsSound:play())
	)
)
/******************************************************************************/
(procedure public (proc000_12 param1 param2 param3 param4)
	(var temp0, temp1, temp2, temp3)
	= temp3 0
	(if(IsObject(param2))
		= temp1 (send param2:x)
		= temp2 (send param2:y)
		(if(== paramTotal 3)
			= temp3 param3
		)
	)(else
		= temp1 param2
		= temp2 param3
		(if(== paramTotal 4)
			= temp3 param4
		)
	)
	= temp0 GetAngle(
		(send param1:x)
		(send param1:y)
		temp1
		temp2
	)
	(send param1:
		setHeading(
			temp0
			(if(IsObject(temp3))
				temp3
			)			
		)
	)
)
/******************************************************************************/
(procedure public (proc000_14)
	(if(== (send param1:onControl()) param2)
		return(1)
	)
)
/******************************************************************************/
(procedure public (proc000_15 param1 param2 param3 param4)
	(var temp0[500])
	(if(<u param2 1000)
		GetFarText(param2 param3 @temp0)
	)(else
		StrCpy(@temp0 param2)
	)
	(send babbleIcon:
		view(param1)
		cycleSpeed(* (+ global[$65] 1) 4)
	)

	(if(<u param2 1000)
		Print(
			@temp0
			rest param4
			#icon babbleIcon 0 0
		)
	)(else
		Print(
			@temp0
			param3
			rest param4
			#icon babbleIcon 0 0
		)
	)
)
/******************************************************************************/
(procedure public (proc000_17 param1)
	(var temp0 = 0)
	(if(paramTotal)
		= temp0 param1
	)(else
		= temp0 809
	)
	(send (= global[$79] egoHead):
		init(gEgo)
		view(temp0)
		cycleSpeed(24)
	)
)
/******************************************************************************/
(procedure public (proc000_18)
	(var temp0)
	(if(> (= temp0 (>> global[$99] 12)) 9)
		- temp0 10
	)(else
		+ temp0 2
	)
)
/******************************************************************************/
(procedure public (proc000_19)
	return(& (>> global[$99] 6) $3F)
)
/******************************************************************************/
(procedure public (proc000_20)
	return(& global[$99] $3F)
)
/******************************************************************************/
(procedure public (proc000_21 param1 param2 param3)
	Load(rsSOUND 190)
	Load(rsVIEW (= global[$A5] param1))
	= global[$A6] param2
	(if(> paramTotal 2)
		= global[$A8] param3
	)
)
/******************************************************************************/
(procedure public (proc000_22 param1 param2)
	(var temp0)
	(> paramTotal 1)
		= temp0 param2
	)(else
		= temp0 gRoomNumberExit
	)
	return(== (send (send gInv:at(param1)):owner) temp0)
)
/******************************************************************************/
