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

(public
	Room62 0
)
(synonyms
	(room bedroom)
)

(instance Room62 of Rm
	(properties
		picture 62
		style $0010
	)
	
	(method (init)
		(self setRegions: 603)
		(Load rsVIEW 536)
		(super init:)
		(if global100
			((Prop new:)
				view: 536
				loop: 1
				cel: 0
				posn: 114 77
				init:
				setPri: 4
				setCycle: Fwd
			)
			((Prop new:)
				view: 536
				loop: 2
				cel: 1
				posn: 205 77
				init:
				setPri: 4
				setCycle: Fwd
			)
		)
		(if (== gPrevRoomNum 59)
			(gEgo posn: 47 129 view: 4 xStep: 4 yStep: 2 init:)
		)
		(if (== gPrevRoomNum 68)
			(gEgo posn: 244 157 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: 59)
		)
	)
	
	(method (handleEvent pEvent)
		(return
			(cond 
				((pEvent claimed?) (return 1))
				((== (pEvent type?) evSAID)
					(cond 
						((Said 'look>')
							(cond 
								((Said '<under/bed') (Print 62 0))
								((Said '/bed') (Print 62 1))
								((Said '/window') (Print 62 2))
								((Said '<in/chest,dresser,drawer') (Print 62 3))
								((Said '/chest,dresser')
									(if (< (gEgo x?) 150)
										(Print 62 4)
									else
										(Print 62 5)
									)
								)
								((Said '/wall') (Print 62 6))
								((Said '/chandelier') (Print 62 7))
								((or (Said '/dirt') (Said '<down')) (Print 62 8))
								((Said '/mirror')
									(if
										(or
											(gEgo inRect: 19 148 80 168)
											(gEgo inRect: 191 133 271 162)
										)
										(Print 62 9)
									else
										(Print 62 10)
									)
								)
								((Said '/carpet') (Print 62 11))
								((Said '[<around][/room]') (Print 62 12))
							)
						)
						((Said 'open/chest,dresser,drawer') (Print 62 3))
						(
							(or
								(Said 'get[<in,on]/bed')
								(Said 'lay,sleep[<in,on,down]')
							)
							(Print 62 13)
						)
					)
				)
			)
		)
	)
)
