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

(public
	Room65 0
)
(synonyms
	(caldron caldron)
	(shelf cabinet)
)

(instance Room65 of Rm
	(properties
		picture 65
		style $0010
	)
	
	(method (init)
		(Load rsVIEW 648)
		(Load rsVIEW 536)
		(self setRegions: 603)
		(super init:)
		((View new:)
			view: 536
			loop: 5
			cel: 0
			posn: 238 80
			setPri: 4
			addToPic:
		)
		(if global100
			((View new:)
				view: 648
				loop: 5
				cel: 0
				posn: 280 104
				setPri: 6
				addToPic:
			)
			((Prop new:)
				view: 536
				loop: 1
				posn: 237 73
				setPri: 4
				init:
				setCycle: Fwd
			)
		)
		(if (or (== gPrevRoomNum 64) (== gPrevRoomNum 0))
			(gEgo posn: 245 162 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: 64)
		)
	)
	
	(method (handleEvent pEvent)
		(return
			(cond 
				((pEvent claimed?) (return 1))
				((== (pEvent type?) evSAID)
					(cond 
						(
							(or
								(Said 'look[<around][/!*]')
								(Said 'look/room,kitchen')
							)
							(Print 65 0)
						)
						((Said 'look>')
							(cond 
								((Said '/pantry') (Print 65 1))
								((Said '/fireplace') (Print 65 2))
								((Said '/caldron') (Print 65 3))
								((Said '/butterchurn') (Print 65 4))
								((Said '/window')
									(if (gEgo inRect: 229 124 277 146)
										(Print 65 5)
									else
										(Print 65 6)
									)
								)
								((Said '/barrel') (Print 65 7))
								((Said '/shelf') (Print 65 8))
								((Said '/chandelier') (Print 65 9))
								((Said '/wall') (Print 65 10))
								((or (Said '/dirt') (Said '<down')) (Print 65 11))
								((Said '/ladder') (Print 65 12))
								((Said '/crumbs') (Print 65 13))
								((Said '/bottle')
									(if (gEgo has: 31)
										(pEvent claimed: 0)
									else
										(Print 800 2)
									)
								)
								(else (pEvent claimed: 0))
							)
						)
						((Said 'get>')
							(cond 
								((Said '/caldron') (Print 65 14))
								((Said '/butterchurn') (Print 65 4))
								((Said '/barrel') (Print 65 7))
								((Said '/crumbs') (Print 65 15))
								(else (pEvent claimed: 0))
							)
						)
					)
				)
			)
		)
	)
)
