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

(public
	Room37 0
)

(local
	newAct
	newAct_2
)
(instance doorSound of Sound
	(properties)
)

(instance fairieTheme of Sound
	(properties
		number 33
		priority -1
	)
)

(instance door of Prop
	(properties)
	
	(method (cue)
		(if (!= (door cel?) (door lastCel:))
			(door setCycle: End self)
		else
			(proc0_9)
			(gRoom newRoom: 47)
		)
	)
)

(instance Room37 of Rm
	(properties
		picture 37
	)
	
	(method (init)
		(= north 47)
		(= south 40)
		(= east 38)
		(= west 36)
		(= horizon 93)
		(= global101 0)
		(if global100 (= picture 137))
		(gEgo edgeHit: 0)
		(super init:)
		(self setRegions: 505)
		(Load rsVIEW 613)
		(Load rsVIEW 2)
		(Load rsVIEW 114)
		(door
			view: 613
			loop: 0
			cel: 0
			posn: 158 93
			setPri: 5
			init:
			stopUpd:
		)
		(if (<= (gEgo y?) horizon) (gEgo y: (+ horizon 2)))
		(switch gPrevRoomNum
			(47
				(gEgo posn: 159 (+ horizon 3))
			)
			(36 (gEgo posn: 1 (gEgo y?)))
			(38 (gEgo posn: 317 (gEgo y?)))
			(40 (gEgo posn: 157 188))
		)
		(gEgo view: 2 xStep: 3 yStep: 2 init:)
		(= newAct (Act new:))
		(newAct
			ignoreHorizon:
			posn: 186 36
			view: 110
			setMotion: Wander 10
			illegalBits: -32768
			setCycle: Fwd
			setPri: 15
			xStep: 1
			yStep: 1
			init:
		)
		(= newAct_2 (Act new:))
		(newAct_2
			ignoreHorizon:
			posn: 107 37
			view: 114
			setMotion: Wander 10
			illegalBits: -32768
			setCycle: Fwd
			setPri: 15
			xStep: 1
			yStep: 1
			init:
		)
		(Print 37 0)
		(fairieTheme play:)
	)
	
	(method (handleEvent pEvent &tmp gInvSaidMe)
		(if (== (pEvent type?) evSAID)
			(cond 
				((Said 'look>')
					(cond 
						((Said '/bush') (Print 37 1))
						((Said '/dirt') (Print 37 2))
						((Said '/grass') (Print 37 3))
						((Said '/flora') (Print 37 4))
						((Said '/blossom') (Print 37 5))
						((Said '/forest') (Print 37 6))
						((Said '/garden') (Print 37 7))
						((Said '/castle') (Print 37 8))
						((Said '/beach') (Print 37 9))
						((Said '/ocean,water') (Print 37 10))
						((Said '/door') (Print 37 11))
						((Said '/fairies') (Print 37 12))
						((Said '/bird') (Print 37 13))
						((Said '/path') (Print 37 14))
						((Said '[<around][/room,island]') (Print 37 15))
					)
				)
				((Said 'get/blossom') (Print 37 16))
				((Said 'open/door')
					(if (gEgo inRect: 140 93 180 103)
						(gEgo setMotion: 0)
						(proc0_8)
						(doorSound number: 300 priority: 1 play: door)
						(door setCycle: End)
					else
						(proc0_13)
					)
				)
				((or (Said 'kiss[/!*]') (Said 'kiss/fairies')) (Print 37 17))
				(
				(or (Said 'converse/fairies') (Said 'converse[/!*]')) (Print 37 18))
				((Said 'bang')
					(if (gEgo inRect: 141 94 175 103)
						(Print 37 19)
					else
						(Print 37 20)
					)
				)
				((Said 'get,capture/fairies') (Print 37 21))
				(
				(and (Said 'deliver>') (= gInvSaidMe (gInv saidMe:)))
					(if (gEgo has: (gInv indexOf: gInvSaidMe))
						(Print 37 22)
					else
						(proc0_17)
					)
				)
			)
		)
	)
	
	(method (newRoom newRoomNumber)
		(User canControl: 1)
		(super newRoom: newRoomNumber)
	)
)
