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

(public
	Room_36 0
)
(synonyms
	(lake pool lake)
)

(local
	newAct
	local1
	newProp_4
	newProp_5
	newProp
	newProp_2
	newProp_3
	newProp_6
)
(instance Room_36 of Rm
	(properties
		picture 36
		name "Room 36"
	)
	
	(method (init)
		(= north 33)
		(= south 39)
		(= east 37)
		(= horizon 82)
		(= global101 0)
		(super init:)
		(self setRegions: 505)
		(Load rsVIEW 345)
		(Load rsVIEW 21)
		(Load rsVIEW 2)
		(= newProp (Prop new:))
		(= newProp_2 (Prop new:))
		(= newProp_3 (Prop new:))
		(newProp
			isExtra: 1
			view: 663
			loop: 0
			cel: 1
			posn: 114 68
			setPri: 3
			setCycle: Fwd
			cycleSpeed: 2
			ignoreActors:
			cycleSpeed: 2
			init:
		)
		(newProp_2
			isExtra: 1
			view: 663
			loop: 1
			cel: 1
			posn: 23 81
			setPri: 4
			setCycle: Fwd
			cycleSpeed: 2
			ignoreActors:
			cycleSpeed: 2
			init:
		)
		(newProp_3
			isExtra: 1
			view: 663
			loop: 2
			cel: 3
			posn: 12 93
			setPri: 5
			setCycle: Fwd
			cycleSpeed: 2
			ignoreActors:
			cycleSpeed: 2
			init:
		)
		(= newProp_4 (Prop new:))
		(= newProp_5 (Prop new:))
		(newProp_4
			isExtra: 1
			view: 650
			loop: 5
			cel: 0
			posn: 156 118
			setPri: 8
			setCycle: Fwd
			ignoreActors:
			init:
		)
		(newProp_5
			isExtra: 1
			view: 650
			loop: 6
			cel: 3
			posn: 218 130
			setPri: 9
			setCycle: Fwd
			ignoreActors:
			init:
		)
		(= newProp_6 (Prop new:))
		(newProp_6
			isExtra: 1
			view: 341
			loop: 4
			cel: 2
			posn: 84 30
			setPri: 0
			setCycle: Fwd
			cycleSpeed: 1
			ignoreActors:
			init:
		)
		(gEgo view: 2 xStep: 3 yStep: 2 init:)
		(self setScript: Ego_drinking_water)
		(if global100 (= picture 136))
		(cond 
			((== gPrevRoomNum 33) (gEgo posn: 100 85))
			((== gPrevRoomNum 39) (gEgo x: 165 y: 186))
		)
		(= newAct (Act new:))
		(newAct
			posn: 188 120
			view: 345
			setCycle: Walk
			moveSpeed: 2
			setMotion: Wander
			illegalBits: -32767
			xStep: 1
			yStep: 1
			init:
		)
	)
	
	(method (handleEvent pEvent &tmp gInvSaidMe)
		(if (== (pEvent type?) evSAID)
			(cond 
				((Said 'deliver>')
					(if (= gInvSaidMe (gInv saidMe:))
						(if (gEgo has: (gInv indexOf: gInvSaidMe))
							(Print 36 0)
						else
							(proc0_17)
						)
					)
				)
				(
					(or
						(Said 'enter,capture/fish')
						(Said 'fish[/!*]')
						(Said 'cast/pole')
					)
					(Print 36 1)
				)
				((Said 'look>')
					(cond 
						((Said '<in/lake,water') (Print 36 2))
						((Said '<under/bridge') (Print 36 3))
						((Said '/beach') (Print 36 4))
						((Said '/bush') (Print 36 5))
						((Said '/dirt') (Print 36 6))
						((Said '/grass') (Print 36 7))
						((Said '/flora') (Print 36 8))
						((Said '/blossom') (Print 36 9))
						((Said '/forest') (Print 36 10))
						((Said '/garden') (Print 36 11))
						((Said '/lake,water') (Print 36 12))
						((Said '/bridge') (Print 36 13))
						((Said '/path') (Print 36 14))
						((Said '/bench') (Print 36 15))
						((Said '/castle') (Print 36 16))
						((Said '/ocean') (Print 36 17))
						((Said '/swan') (Print 36 18))
						((Said '/parrot,bird,cockatoo') (Print 36 19))
						((Said '[<around][/room,island]') (Print 36 20))
					)
				)
				((Said 'get,capture/bird,parrot,cockatoo') (Print 36 0))
				((Said 'converse/bird,parrot,cockatoo') (Print 36 21))
				((Said 'get/blossom') (Print 36 22))
				((Said 'wade,bathe,dive') (Print 36 23))
				((Said 'get/water') (Print 36 24))
				((or (Said 'drink') (Said 'get/drink'))
					(if (& (= local1 (proc0_2 gEgo 15)) $0002)
						(Ego_drinking_water changeState: 1)
					else
						(Print 800 1)
					)
				)
				((Said 'sit') (Print 36 25))
				((Said 'converse/swan') (Print 36 26))
				((Said 'converse/parrot,bird,cockatoo') (Print 36 27))
				((Said 'get,capture/swan') (Print 36 28))
				((Said 'kiss') (Print 36 29))
			)
		)
	)
)

(instance Ego_drinking_water of Script
	(properties
		name "Ego drinking water"
	)
	
	(method (changeState newState)
		(switch (= state newState)
			(1
				(proc0_8)
				(gEgo setMotion: 0 view: 21 cel: 255 setCycle: End self)
			)
			(2
				(= global120 (Print 36 30 67 -1 10 88))
				(Timer setReal: self 5)
			)
			(3 (gEgo setCycle: Beg self))
			(4
				(gEgo view: 2 setCycle: Walk)
				(proc0_21)
				(proc0_9)
			)
		)
	)
)
