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

(public
	Room64 0
)

(local
	[local0 3]
)
(instance Room64 of Rm
	(properties
		picture 64
		style $0010
	)
	
	(method (init)
		(self setRegions: 603)
		(super init:)
		((View new:)
			view: 536
			loop: 3
			cel: 0
			posn: 153 81
			setPri: 15
			addToPic:
		)
		((View new:)
			view: 536
			loop: 3
			cel: 0
			posn: 166 81
			setPri: 15
			addToPic:
		)
		((View new:)
			view: 536
			loop: 3
			cel: 0
			posn: 178 81
			setPri: 15
			addToPic:
		)
		(if global100
			((View new:)
				view: 648
				loop: 3
				cel: 0
				posn: 219 88
				setPri: 5
				addToPic:
			)
			((View new:)
				view: 648
				loop: 4
				cel: 0
				posn: 266 104
				setPri: 6
				addToPic:
			)
			((Prop new:)
				view: 536
				loop: 2
				cel: 2
				posn: 152 76
				setPri: 15
				init:
				setCycle: Fwd
			)
			((Prop new:)
				view: 536
				loop: 1
				cel: 1
				posn: 166 76
				setPri: 15
				init:
				setCycle: Fwd
			)
			((Prop new:)
				view: 536
				loop: 2
				cel: 4
				posn: 177 76
				setPri: 15
				init:
				setCycle: Fwd
			)
		)
		(if (== gPrevRoomNum 68)
			(gEgo posn: 51 130 view: 4 xStep: 4 yStep: 2 init:)
		)
		(if (== gPrevRoomNum 65)
			(gEgo posn: 210 117 view: 4 xStep: 4 yStep: 2 init:)
		)
		(if
			(and
				(< 0 global134)
				(< global134 255)
				(== global133 gCurRoomNum)
			)
			(proc0_10 603 -1)
		)
	)
	
	(method (doit)
		(super doit:)
		(if (& (gEgo onControl: 0) $0040)
			(gRoom newRoom: 68)
		)
		(if (& (gEgo onControl: 0) $0020)
			(gRoom newRoom: 65)
		)
	)
	
	(method (handleEvent pEvent)
		(return
			(cond 
				((pEvent claimed?) (return 1))
				((== (pEvent type?) evSAID)
					(cond 
						(
						(or (Said 'look[<around][/!*]') (Said 'look/room')) (Print 64 0))
						((Said 'look>')
							(cond 
								((Said '<under/table') (Print 64 1))
								((Said '/table') (Print 64 2))
								((Said '/chair') (Print 64 3))
								((Said '/window')
									(if (gEgo inRect: 231 118 278 139)
										(Print 64 4)
									else
										(Print 800 1)
									)
								)
								((Said '/cabinet') (Print 64 5))
								((Said '/chandelier') (Print 64 6))
								((Said '/wall') (Print 64 7))
								((or (Said '/dirt') (Said '<down')) (Print 64 8))
								((Said '/crumbs') (Print 64 9))
								(else (pEvent claimed: 0))
							)
						)
						((Said 'sit>') (Print 64 10) (pEvent claimed: 1))
						((Said 'get>')
							(if (Said '/crumbs')
								(Print 64 11)
							else
								(pEvent claimed: 0)
							)
						)
					)
				)
			)
		)
	)
)
