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

(public
	Room9 0
)
(synonyms
	(pool water)
)

(local
	newProp
	newProp_2
)
(instance Room9 of Rm
	(properties
		picture 9
	)
	
	(method (init)
		(= north 3)
		(= south 15)
		(= east 10)
		(= west 8)
		(= horizon 75)
		(= global101 0)
		(if (<= (gEgo y?) (+ horizon 1))
			(gEgo y: (+ horizon 2))
		)
		(if (< (gEgo x?) 93) (gEgo x: 93))
		(super init:)
		(gEgo view: 2 init:)
		(if global100 (gRoom overlay: 109))
		(self setRegions: 507 514)
		(if (not global100)
			(if (< (Random 1 100) 50)
				(= newProp (Prop new:))
				(newProp
					view: 342
					loop: 5
					cel: 2
					posn: 283 17
					setPri: 14
					setScript: bird1Actions
					init:
				)
			)
			(if (< (Random 1 100) 50)
				(= newProp_2 (Prop new:))
				(newProp_2
					view: 342
					loop: 4
					cel: 2
					posn: 58 30
					setPri: 14
					setScript: bird2Actions
					init:
				)
			)
		)
	)
	
	(method (handleEvent pEvent)
		(if (pEvent claimed?) (return 1))
		(return
			(if (== (pEvent type?) evSAID)
				(cond 
					((Said 'climb/boulder') (Print 9 0))
					((Said 'look>')
						(cond 
							((Said '/pool') (Print 9 1))
							((Said '/boulder') (Print 9 2))
							((Said '/blossom') (Print 9 3))
							((Said '[<around][/room]') (Print 9 4))
						)
					)
				)
			else
				0
			)
		)
	)
	
	(method (newRoom newRoomNumber)
		(if (gCast contains: gNewAct_5)
			(= global211 global160)
			(= global212 global159)
		)
		(super newRoom: newRoomNumber)
	)
)

(instance bird1Actions of Script
	(properties)
	
	(method (changeState newState)
		(switch (= state newState)
			(0
				(newProp setCycle: Fwd)
				(= seconds (Random 1 12))
			)
			(1
				(newProp setCycle: 0 cel: 0)
				(= seconds (Random 1 8))
			)
			(2 (self changeState: 0))
		)
	)
)

(instance bird2Actions of Script
	(properties)
	
	(method (changeState newState)
		(switch (= state newState)
			(0
				(newProp_2 setCycle: Fwd)
				(= seconds (Random 1 12))
			)
			(1
				(newProp_2 setCycle: 0 cel: 0)
				(= seconds (Random 1 8))
			)
			(2 (self changeState: 0))
		)
	)
)
