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

(public
	Room6 0
)

(local
	local0
	newProp
)
(instance Room6 of Rm
	(properties
		picture 6
	)
	
	(method (init)
		(= south 12)
		(= west 5)
		(= horizon 80)
		(= global101 0)
		(gEgo view: 2 edgeHit: 0)
		(super init:)
		(if global100 (gRoom overlay: 106))
		(self setRegions: 508 511)
		(switch gPrevRoomNum
			(west
				(cond 
					((>= (gEgo y?) 160) (gEgo x: 1 y: 160))
					((<= (gEgo y?) 84) (gEgo x: 2 y: 84))
					(else (gEgo x: 1))
				)
			)
			(south
				(cond 
					((>= (gEgo x?) 265) (gEgo posn: 265 187))
					((<= (gEgo x?) 100) (gEgo posn: 100 187))
					(else (gEgo posn: (gEgo x?) 187))
				)
			)
			(57
				(gEgo loop: 1 x: 200 y: 152)
			)
			(0 (gEgo x: 180 y: 160))
		)
		(= newProp (Prop new:))
		(newProp
			view: 628
			loop: 1
			cel: 0
			x: 247
			y: 34
			setCycle: Fwd
			setPri: 15
			cycleSpeed: 2
			init:
		)
		(gEgo init:)
		(gEgo setStep: 3 2)
	)
	
	(method (doit)
		(super doit:)
		(if (& (= local0 (gEgo onControl: 0)) $0040)
			(= gNewRoomNumber_2 57)
		)
	)
	
	(method (handleEvent pEvent)
		(if (pEvent claimed?) (return 1))
		(return
			(if (== (pEvent type?) evSAID)
				(cond 
					((Said 'look<in,in,in/cave,skull') (Print 6 0))
					(
						(or
							(Said 'look/room')
							(Said 'look/around')
							(Said 'look[<around][/!*]')
						)
						(Print 6 1)
					)
					((Said 'look>')
						(cond 
							((Said '/cave,skull') (Print 6 2))
							((Said '/grass') (Print 6 3))
							((Said '/bush') (Print 6 4))
							((Said '/flora') (Print 6 5))
							((Said 'blossom') (Print 6 6))
							((Said '/forest') (Print 6 7))
							((Said '/boulder') (Print 6 8))
							((or (Said '/sky') (Said '<up'))
								(if (not global100)
									(Print 6 9)
								else
									(Print 6 10)
								)
							)
						)
					)
					((Said 'get/blossom') (Print 6 6))
					((Said 'climb/boulder') (Print 6 11))
					((Said 'look/boulder') (Print 6 12))
					((Said 'look/dirt') (Print 6 13))
					((Said 'climb/forest') (Print 6 14))
					((Said 'kill/forest') (Print 6 15))
				)
			else
				0
			)
		)
	)
)
