;;; Sierra Script 1.0 - (do not remove this comment)
(script# 67)
(include sci.sh)
(use Main)
(use Class_255_0)
(use Cycle)
(use Game)
(use Feature)

(public
	Room67 0
)

(local
	newView
	newProp
)
(instance Room67 of Rm
	(properties
		picture 67
		style $0010
	)
	
	(method (init)
		(Load rsVIEW 510)
		(self setRegions: 603)
		(super init:)
		(= global101 1)
		(if global100
			((Prop new:)
				view: 536
				loop: 1
				cel: 0
				ignoreActors: 1
				posn: 205 129
				init:
				setPri: 12
				setCycle: Fwd
			)
		)
		(if (== gPrevRoomNum 66)
			(gEgo posn: 85 123 view: 4 xStep: 4 yStep: 2 init:)
		)
		(if (== gPrevRoomNum 68)
			(gEgo posn: 264 130 view: 4 xStep: 4 yStep: 2 init:)
		)
		(if (== ((gInv at: 18) owner?) 67)
			((= newView (View new:))
				view: 510
				loop: 0
				cel: 0
				posn: 207 74
				stopUpd:
				init:
			)
		)
		((= newProp (Prop new:))
			view: 510
			loop: 2
			cel: 0
			ignoreActors: 1
			stopUpd:
			posn: 74 101
			init:
			setPri: 8
		)
		(if global131
			(newProp setCel: 255 stopUpd:)
			(gEgo illegalBits: -32768)
		else
			(gEgo illegalBits: -32764)
		)
		(if
			(and
				(< 0 global134)
				(< global134 255)
				(== global133 gCurRoomNum)
			)
			(proc0_10 603 -1)
		)
	)
	
	(method (doit)
		(super doit:)
		(if (& (gEgo onControl: 0) $0040)
			(gEgo illegalBits: -32768)
			(gRoom newRoom: 68)
		)
		(if (and (& (gEgo onControl: 1) $0004) global131)
			(gEgo illegalBits: -32768)
			(gRoom newRoom: 66)
		)
		(if (and (& (gEgo onControl:) $0020) global131)
			(gEgo setPri: 8)
		else
			(gEgo setPri: -1)
		)
	)
	
	(method (handleEvent pEvent)
		(return
			(cond 
				((pEvent claimed?) (return 1))
				((== (pEvent type?) evSAID)
					(cond 
						(
							(or
								(Said 'look[<around][/!*]')
								(Said 'look/room,parlor')
							)
							(Print 67 0)
						)
						((Said 'look>')
							(cond 
								((and (gEgo has: 18) (Said '/book')) ((gInv at: 18) showSelf:))
								((Said '/book,shelf,bookshelf')
									(if (> (gEgo x?) 160)
										(if (== ((gInv at: 18) owner?) 67)
											(Print 67 1)
											(= global128 1)
										else
											(Print 67 2)
										)
									else
										(Print 67 3)
									)
								)
								((Said '<behind,under/painting') (Print 67 4))
								((Said '/painting') (Print 67 5) (= global129 1))
								((Said '/wall<left')
									(cond 
										(global131 (Print 67 6))
										(global129 (Print 67 7) (= global130 1))
										(else (Print 67 8))
									)
								)
								((Said '/wall<right') (Print 67 9))
								((Said '/wall')
									(cond 
										(global131 (Print 67 6))
										(global129 (Print 67 7) (= global130 1))
										(else (Print 67 10))
									)
								)
								((Said '/latch')
									(cond 
										(global131 (Print 67 11))
										(global129
											(if global130
												(if (& (gEgo onControl:) $0020)
													(Print 67 12)
												else
													(Print 67 13)
												)
											)
										)
										(else (Print 67 14))
									)
								)
								((Said '<in/fireplace') (Print 67 15))
								((Said '/fireplace') (Print 67 16))
								((Said '/chandelier') (Print 67 17))
								((Said '/couch') (Print 67 18))
								((Said '/door') (if global131 (Print 67 19) else (Print 67 20)))
								((Said '/cabinet,cabinet') (Print 67 21))
								((Said '/table,chair,chest,furniture') (Print 67 22))
								(
								(or (Said '/dirt,carpet,carpet') (Said '<down')) (Print 67 23))
							)
						)
						((Said 'find/door') (if global131 (Print 67 19) else (Print 67 20)))
						((Said 'sit') (Print 67 24))
						(
						(or (Said 'get/book') (Said 'get/shakespeare'))
							(cond 
								((gEgo inRect: 83 119 127 127) (Print 67 25))
								((& (gEgo onControl:) $0010)
									(cond 
										((!= ((gInv at: 18) owner?) 67) (Print 67 26))
										(global128
											(Print 67 27)
											(gEgo get: 18)
											(gGame changeScore: 2)
											(newView dispose:)
											(= global182 1)
										)
										(else
											(Print 67 28)
											(gEgo get: 18)
											(= global182 1)
											(gGame changeScore: 2)
											(newView dispose:)
										)
									)
								)
								(else (Print 800 1))
							)
						)
						((Said 'get/painting') (Print 67 4))
						((Said 'open/door') (if global131 (Print 67 29) else (Print 67 30)))
						((Said 'open/cabinet,cabinet') (Print 67 21))
						((Said 'close/door') (if global131 (Print 67 31) else (Print 67 32)))
						((Said 'flip,move,lift/latch')
							(if global130
								(cond 
									(global131 (Print 67 33))
									((& (gEgo onControl:) $0020)
										(Print 67 34)
										(gEgo setMotion: 0)
										(newProp setCycle: End)
										(= global131 1)
										(gGame changeScore: 4)
										(gEgo illegalBits: -32768)
									)
									(else (Print 800 1))
								)
							else
								(Print 67 14)
							)
						)
					)
				)
			)
		)
	)
	
	(method (newRoom newRoomNumber)
		(gEgo setPri: -1)
		(super newRoom: newRoomNumber)
	)
)
