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

(public
	Room32 0
)

(local
	newProp
	newProp_2
	newProp_3
	newProp_4
	newView
)
(instance Room32 of Rm
	(properties
		picture 32
	)
	
	(method (init)
		(Load rsVIEW 9)
		(= north 40)
		(= west (= east (= south 31)))
		(= horizon 114)
		(super init:)
		(self setRegions: 504 519)
		(= newProp (Prop new:))
		(= newProp_2 (Prop new:))
		(= newProp_3 (Prop new:))
		(= newProp_4 (Prop new:))
		((= newView (View new:))
			view: 613
			loop: 2
			cel: 0
			posn: 163 62
			setPri: 2
			init:
			stopUpd:
		)
		(newProp
			view: 660
			loop: 0
			cel: 1
			posn: 79 81
			ignoreActors:
			setPri: 4
			setCycle: Fwd
			cycleSpeed: 3
			init:
		)
		(newProp_2
			view: 660
			loop: 1
			cel: 2
			posn: 118 92
			ignoreActors:
			setPri: 5
			setCycle: Fwd
			cycleSpeed: 3
			init:
		)
		(newProp_3
			view: 660
			loop: 2
			cel: 0
			posn: 214 93
			ignoreActors:
			setPri: 5
			setCycle: Fwd
			cycleSpeed: 3
			init:
		)
		(newProp_4
			view: 660
			loop: 3
			cel: 3
			posn: 266 86
			ignoreActors:
			setPri: 5
			setCycle: Fwd
			cycleSpeed: 3
			init:
		)
		(if global100 (= picture 132))
		(if (>= (gEgo x?) 319) (gEgo x: 1))
		(if (<= (gEgo x?) 0) (gEgo x: 318))
		(switch gPrevRoomNum
			(41
				(gEgo posn: 226 (+ horizon 1))
			)
			(40
				(gEgo posn: 164 (+ horizon 1))
			)
			(39
				(gEgo posn: 100 (+ horizon 1))
			)
		)
		(if (< (gEgo y?) horizon)
			(gEgo y: (+ horizon (gEgo yStep?) 1))
		)
		(gEgo view: 9 setCycle: Fwd init:)
	)
	
	(method (handleEvent pEvent)
		(if (pEvent claimed?) (return 1))
		(return
			(if
			(and (== (pEvent type?) evSAID) (Said 'look>'))
				(cond 
					((Said '/tamir') (Print 32 0))
					((Said '/island') (Print 32 1))
					((Said '/castle') (Print 32 2))
					((Said '/fish') (Print 32 3))
					((Said '[<around][/room]') (Print 32 4))
				)
			else
				0
			)
		)
	)
	
	(method (newRoom newRoomNumber)
		(if (== (gEgo edgeHit?) 1)
			(cond 
				((< (gEgo x?) 115) (super newRoom: 39))
				((> (gEgo x?) 198) (super newRoom: 41))
				(else (super newRoom: 40))
			)
		else
			(super newRoom: newRoomNumber)
		)
	)
)
