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

(public
	Room690 0
)

(local
	newExtra
	newAct_3
	newAct
	local3
	newAct_2
	newProp_2
	newProp
	newProp_3
	newView
	newProp_4
	newProp_5
)
(instance wave1 of Prop
	(properties)
)

(instance wave2 of Prop
	(properties)
)

(instance fairyCage of Cage
	(properties
		top 52
		left 101
		bottom 92
		right 228
	)
)

(instance Room690 of Rm
	(properties
		picture 40
		horizon 98
	)
	
	(method (init)
		(super init:)
		(self setRegions: 521)
		(= gUserFont gSmallFont)
		(wave1
			view: 664
			loop: 3
			cel: 0
			posn: 40 178
			setPri: 0
			ignoreActors:
			cycleSpeed: 4
			setCycle: Fwd
			init:
		)
		(wave2
			view: 664
			loop: 4
			cel: 2
			posn: 280 178
			setPri: 0
			ignoreActors:
			cycleSpeed: 4
			setCycle: Fwd
			init:
		)
		(= newProp (Prop new:))
		(newProp
			view: 650
			loop: 2
			cel: 2
			posn: 61 84
			setPri: 0
			ignoreActors:
			setCycle: Fwd
			init:
		)
		((View new:)
			view: 613
			loop: 1
			cel: 0
			posn: 155 78
			setPri: 2
			init:
			addToPic:
		)
		((Act new:)
			view: 114
			illegalBits: 0
			posn: 110 59
			setCycle: Walk
			setMotion: Wander
			setPri: 3
			observeBlocks: fairyCage
			moveSpeed: 2
			ignoreHorizon:
			init:
		)
		((Act new:)
			view: 110
			illegalBits: 0
			posn: 190 79
			setCycle: Walk
			setMotion: Wander
			setPri: 3
			observeBlocks: fairyCage
			moveSpeed: 2
			ignoreHorizon:
			init:
		)
		(gEgo
			view: 106
			posn: 158 129
			setLoop: 5
			cel: 0
			setScript: egoActions
			init:
		)
		(= global205 1)
	)
	
	(method (dispose)
		(DisposeScript 988)
		(super dispose:)
	)
)

(instance egoActions of Script
	(properties)
	
	(method (changeState newState)
		(switch (= state newState)
			(0
				(User canControl: 0 canInput: 0)
				(gEgo setCycle: End self)
				(cond 
					((and (gEgo has: 25) (gEgo has: 33)) ((ScriptID 521 1) number: 201 play:))
					((gEgo has: 25) ((ScriptID 521 1) number: 200 play:))
					((gEgo has: 33) ((ScriptID 521 1) number: 203 play:))
					(else ((ScriptID 521 1) number: 202 play:))
				)
			)
			(1
				(= newAct (Act new:))
				(newAct
					posn: 185 129
					view: 106
					setLoop: 4
					cel: 0
					init:
					setCycle: End self
				)
			)
			(2
				(= global120 (Print 690 0 67 -1 0 88))
				(= seconds 5)
			)
			(3
				(proc0_21)
				(if (gEgo has: 33)
					(self changeState: 10)
				else
					(self changeState: 4)
				)
			)
			(4
				(if (gEgo has: 25)
					(self changeState: 20)
				else
					(self changeState: 100)
				)
			)
			(10
				(= global120
					(Print 690 1 67 -1 10 80 {Genesta} 83 88)
				)
				(= seconds 6)
			)
			(11
				(if gModelessDlg (gModelessDlg dispose:))
				(gEgo
					view: 106
					setLoop: 1
					cel: 0
					cycleSpeed: 1
					setCycle: End self
				)
			)
			(12
				(newAct setLoop: 0 cel: 0 setCycle: End self)
				(gEgo setLoop: 5 cel: 5)
				(gGame changeScore: 2)
				((Inv at: 33) moveTo: -1)
			)
			(13
				(newAct loop: 2 cycleSpeed: 1 setCycle: Fwd)
				(= global120 (Print 690 2 67 -1 0 88))
				(= seconds 8)
			)
			(14
				(if gModelessDlg (gModelessDlg dispose:))
				(= global120 (Print 690 3 67 -1 10 80 {Genesta} 88))
				(= seconds 6)
			)
			(15
				(if gModelessDlg (gModelessDlg dispose:))
				(newAct setLoop: 3 cel: 0 setCycle: CT 3 1 self)
			)
			(16
				(newAct setCycle: End)
				(= newAct_2 (Act new:))
				(newAct_2
					view: 360
					xStep: 1
					yStep: 1
					cycleSpeed: 3
					posn: (newAct x?) (+ (newAct y?) 6)
					moveSpeed: 3
					setCycle: Walk
					setMotion: Wander
					illegalBits: -2
					init:
				)
				(= seconds 4)
			)
			(17
				(newAct cycleSpeed: 0)
				(self changeState: 4)
			)
			(20
				(= global120 (Print 690 4 67 -1 10 80 {Genesta} 88))
				(= seconds 15)
			)
			(21
				(if gModelessDlg (gModelessDlg dispose:))
				(= global120 (Print 690 5 67 -1 0 88))
				(= seconds 6)
			)
			(22
				(if gModelessDlg (gModelessDlg dispose:))
				(= global120 (Print 690 6 67 -1 10 80 {Genesta} 88))
				(= seconds 10)
			)
			(23
				(if gModelessDlg (gModelessDlg dispose:))
				(newAct view: 755 loop: 2 cel: 0 setCycle: End self)
			)
			(24
				(= newProp_2 (Prop new:))
				(newProp_2
					view: 680
					cel: 0
					posn: (gEgo x?) (gEgo y?)
					setPri: (+ (gEgo priority?) 1)
					setCycle: CT 5 1 self
					init:
				)
			)
			(25
				(gEgo view: 757 loop: 0 cel: 1)
				(newProp_2 setCycle: End self)
			)
			(26
				(newProp_2 hide:)
				(= global120 (Print 690 7 67 -1 10 80 {Genesta} 88))
				(newAct loop: 3 setCycle: Fwd)
				(= seconds 10)
			)
			(27
				(if gModelessDlg (gModelessDlg dispose:))
				(newAct loop: 2 cel: 0 setCycle: End self)
			)
			(28
				(= newAct_3 (Act new:))
				(newAct_3
					view: 107
					posn: 136 130
					loop: 0
					cel: 0
					setCycle: End self
					init:
				)
			)
			(29
				(gEgo cel: 0)
				(newAct_3 loop: 1 cel: 0 setCycle: End self)
			)
			(30
				(= global120 (Print 690 8 67 -1 10 80 {Genesta} 88))
				(= seconds 8)
				(newAct loop: 3 setCycle: Fwd)
			)
			(31
				(if gModelessDlg (gModelessDlg dispose:))
				(newAct loop: 2 cel: 0 setCycle: End self)
			)
			(32
				(newAct_3 loop: 2 cel: 0 setCycle: End self)
				(newAct setLoop: -1 loop: 3 setCycle: Fwd)
			)
			(33 (= seconds 4))
			(34
				(newAct_3
					view: 108
					loop: 0
					cel: 0
					cycleSpeed: 3
					setCycle: CT 3 1 self
				)
			)
			(35
				(gCast eachElementDo: #hide)
				(gRoom drawPic: 696)
				((= newProp_3 (Prop new:))
					view: 787
					loop: 0
					cel: 0
					posn: 84 127
					ignoreActors:
					init:
				)
				(= newProp_4 (Prop new:))
				(= newProp_5 (Prop new:))
				(newProp_4
					view: 787
					loop: 4
					cel: 1
					posn: 17 111
					setPri: 0
					cycleSpeed: 4
					setCycle: Fwd
					init:
				)
				(newProp_5
					view: 787
					loop: 5
					cel: 3
					posn: 126 94
					setPri: 0
					cycleSpeed: 4
					setCycle: Fwd
					init:
				)
				((= newExtra (Extra new:))
					view: 787
					loop: 3
					cel: 2
					posn: 180 54
					setPri: 13
					pauseCel: 0
					minPause: 30
					maxPause: 30
					minCycles: 4
					maxCycles: 4
					init:
				)
				(= global120 (Print 690 9 67 -1 0 88))
				(= seconds 6)
			)
			(36
				(if gModelessDlg (gModelessDlg dispose:))
				(newProp_3 cycleSpeed: 5 setCycle: End self)
				(= global120 (Print 690 10 67 -1 10 80 {Edgar} 88))
				((= newView (View new:))
					view: 787
					loop: 2
					cel: 0
					posn: 92 192
					setPri: 14
					init:
				)
			)
			(37
				(if gModelessDlg (gModelessDlg dispose:))
				(= global120 (Print 690 11 67 -1 0 88))
				(= seconds 5)
			)
			(38
				(if gModelessDlg (gModelessDlg dispose:))
				(= global120 (Print 690 12 67 -1 0 88))
				(= seconds 5)
			)
			(39
				(if gModelessDlg (gModelessDlg dispose:))
				(= global120 (Print 690 13 67 -1 0 88))
				(= seconds 3)
			)
			(40
				(if gModelessDlg (gModelessDlg dispose:))
				(= global120 (Print 690 14 67 -1 10 80 {Rosella} 88))
				(newProp_3
					view: 787
					loop: 1
					cel: 0
					posn: 72 157
					setPri: 14
				)
				(newView dispose:)
				(= seconds 7)
			)
			(41
				(if gModelessDlg (gModelessDlg dispose:))
				(newProp_3 dispose:)
				(newExtra dispose:)
				(= global120 (Print 690 15 67 -1 10 80 {Rosella} 88))
				(= seconds 4)
			)
			(42
				(if gModelessDlg (gModelessDlg dispose:))
				(newProp_4 dispose:)
				(newProp_5 dispose:)
				(Timer setCycle: self 2)
			)
			(43
				(gRoom drawPic: 40)
				(gCast eachElementDo: #show)
				((View new:)
					view: 613
					loop: 1
					cel: 0
					posn: 156 77
					setPri: 2
					init:
					addToPic:
				)
				(gEgo cel: 1)
				(newAct_3 setCycle: End)
				(= global120 (Print 690 16 67 -1 10 80 {Genesta} 88))
				(= seconds 6)
			)
			(44
				(if gModelessDlg (gModelessDlg dispose:))
				(= global120 (Print 690 17 67 -1 10 80 {Genesta} 88))
				(= seconds 5)
			)
			(45
				(if gModelessDlg (gModelessDlg dispose:))
				(newAct loop: 2 cel: 0 setCycle: End self)
			)
			(46
				(= newProp_2 (Prop new:))
				(newProp_2
					view: 680
					loop: 0
					cel: 0
					posn: (gEgo x?) (gEgo y?)
					setPri: (+ (gEgo priority?) 1)
					setCycle: CT 5 1 self
					init:
				)
			)
			(47
				(gEgo hide:)
				(newProp_2 setCycle: End self)
			)
			(48 (gRoom newRoom: 693))
			(100
				(newAct view: 755 setLoop: 3 cel: 8)
				(= global120 (Print 690 18 67 -1 10 80 {Genesta} 88))
				(= seconds 15)
			)
			(101
				(if gModelessDlg (gModelessDlg dispose:))
				(= global120 (Print 690 19 67 -1 0 88))
				(= seconds 8)
			)
			(102
				(if gModelessDlg (gModelessDlg dispose:))
				(= global120 (Print 690 20 67 -1 10 80 {Genesta} 88))
				(= seconds 10)
			)
			(103
				(newAct setLoop: 2 cel: 0 setCycle: End self)
			)
			(104
				(if gModelessDlg (gModelessDlg dispose:))
				(= newProp_2 (Prop new:))
				(newProp_2
					view: 680
					cel: 0
					posn: (gEgo x?) (gEgo y?)
					setPri: (+ (gEgo priority?) 1)
					setCycle: CT 5 1 self
					init:
				)
			)
			(105
				(gEgo view: 757 loop: 0 cel: 1)
				(newProp_2 setCycle: End self)
			)
			(106
				(newProp_2 hide:)
				(= global120 (Print 690 21 67 -1 10 80 {Genesta} 88))
				(= seconds 10)
			)
			(107
				(if gModelessDlg (gModelessDlg dispose:))
				(newProp_2 cel: 0 show: setCycle: CT 5 1 self)
			)
			(108
				(gEgo hide:)
				(newProp_2 setCycle: End self)
			)
			(109
				(newProp_2 dispose:)
				(gRoom newRoom: 693)
			)
		)
	)
)
