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

(public
	intro 0
	introSc 1
)

(local
	local0
	[local1 17]
	local18
	local19
	local20
	local21
	local22
	[local23 7]
	local30
	local31
	[local32 202]
)
(instance openMusic of Sound
	(properties)
)

(instance intro of Rm
	(properties
		horizon 40
	)
	
	(method (init)
		(Load rsVIEW 750)
		(Load rsVIEW 752)
		(Load rsVIEW 755)
		(Load rsVIEW 756)
		(Load rsVIEW 757)
		(Load rsVIEW 758)
		(Load rsVIEW 759)
		(Load rsVIEW 760)
		(Load rsVIEW 761)
		(Load rsVIEW 762)
		(Load rsVIEW 766)
		(Load rsVIEW 767)
		(Load rsVIEW 768)
		(Load rsVIEW 769)
		(Load rsPIC 201)
		(Load rsPIC 202)
		(Load rsPIC 203)
		(Load rsPIC 204)
		(Load rsPIC 205)
		(self setRegions: 520)
		(super init:)
		(= gIntroSc introSc)
		(gRoom setScript: introSc)
		(= gUserFont gSmallFont)
	)
	
	(method (handleEvent pEvent)
		(cond 
			(
				(and
					(== (pEvent type?) evKEYBOARD)
					(== (pEvent message?) KEY_F2)
				)
				(DoSound sndSET_SOUND (not (DoSound sndSET_SOUND)))
			)
			(
				(and
					(== (pEvent type?) evKEYBOARD)
					(== (pEvent message?) KEY_RETURN)
				)
				(gGame restart:)
			)
		)
	)
	
	(method (newRoom newRoomNumber)
		(if (IsObject local30) (local30 dispose:))
		(super newRoom: newRoomNumber)
	)
)

(instance introSc of Script
	(properties)
	
	(method (changeState newState &tmp temp0)
		(gAddToPics dispose:)
		(switch (= state newState)
			(0
				(User canControl: 0 canInput: 0)
				(gRoom drawPic: 201)
				(openMusic number: 103 play:)
				(= local19
					((Act new:)
						view: 750
						loop: 0
						posn: 130 130
						stopUpd:
						init:
						yourself:
					)
				)
				(= local20
					((Act new:)
						view: 769
						loop: 2
						posn: 140 119
						stopUpd:
						init:
						yourself:
					)
				)
				(= local21
					((Act new:)
						view: 760
						posn: 220 148
						loop: 1
						cel: 5
						stopUpd:
						init:
						yourself:
					)
				)
				(= local18
					((Act new:)
						view: 759
						loop: 1
						posn: 212 135
						stopUpd:
						init:
						yourself:
					)
				)
				(= local22
					((Act new:)
						view: 767
						posn: 48 120
						xStep: 4
						yStep: 2
						loop: 0
						cycleSpeed: 0
						cel: 3
						stopUpd:
						init:
						yourself:
					)
				)
				((View new:)
					view: 768
					posn: 158 64
					setPri: 0
					ignoreActors:
					addToPic:
				)
				((View new:)
					view: 769
					loop: 3
					posn: 48 139
					setPri: 0
					ignoreActors:
					addToPic:
				)
				(Timer setReal: self 2)
			)
			(1
				(= local30 (Print 120 0 67 -1 10 70 300 88))
				(Timer setReal: self 10)
			)
			(2
				(local19 setCycle: Walk setMotion: MoveTo 145 140 self)
			)
			(3
				(local19 setMotion: MoveTo 48 144 self)
			)
			(4
				(local22 hide:)
				(local19 setMotion: MoveTo 130 140 self)
			)
			(5
				(if gModelessDlg (gModelessDlg dispose:))
				(local19 setMotion: MoveTo 134 131 self)
			)
			(6
				(local19 setLoop: 0)
				(= local30 (Print 120 1 70 300 67 -1 12 88))
				(= seconds 11)
			)
			(7
				(local19 view: 750 setLoop: 2 cel: 255 setCycle: End self)
			)
			(8
				(local22
					show:
					posn: (+ (local19 x?) 10) (- (local19 y?) 20)
					setCycle: Rev
					moveSpeed: 1
					ignoreActors:
					illegalBits: 0
					setMotion: MoveTo 220 70 self
				)
				(local21
					view: 761
					setLoop: 0
					setCycle: Walk
					setMotion: MoveTo 275 145
				)
				(local18
					view: 761
					setLoop: 1
					setCycle: Walk
					setMotion: MoveTo 275 135
				)
			)
			(9
				(local19 setLoop: 3 setCycle: End stopKing)
				(= seconds 1)
			)
			(10
				(local22 stopUpd:)
				(= seconds 1)
			)
			(11
				(if gModelessDlg (gModelessDlg dispose:))
				(gCast eachElementDo: #hide)
				(gRoom drawPic: 202)
				(local22
					show:
					setLoop: 1
					setCel: 0
					posn: 105 99
					ignoreActors:
					setStep: 4 2
					moveSpeed: 0
					cycleSpeed: 0
					setCycle: Rev
					setMotion: MoveTo 275 120
				)
				(= local30 (Print 120 2 30 1 67 -1 150 88))
				(Timer setReal: self 3)
			)
			(12
				(if gModelessDlg (gModelessDlg dispose:))
				(= local30 (Print 120 3 67 -1 150 88))
				(Timer setReal: self 3)
			)
			(13
				(if gModelessDlg (gModelessDlg dispose:))
				(local22 hide:)
				(= local31
					((Act new:)
						view: 769
						loop: 0
						posn: 160 114
						cycleSpeed: 5
						cel: 255
						setCycle: End stopKing
						init:
						yourself:
					)
				)
				(= local30 (Print 120 4 67 -1 140 88))
				(Timer setReal: self 7)
			)
			(14
				(if gModelessDlg (gModelessDlg dispose:))
				(local31 dispose:)
				(gRoom drawPic: 201)
				(local19
					cycleSpeed: 0
					view: 769
					posn: 135 130
					setLoop: 1
					cel: 255
					setCycle: End stopKing
					ignoreActors:
					show:
				)
				(local18
					show:
					view: 759
					setLoop: 1
					xStep: 2
					setCycle: Walk
					setMotion: MoveTo 227 136
				)
				(local21
					show:
					view: 760
					loop: 1
					xStep: 2
					setCycle: Walk
					setMotion: MoveTo 216 147 self
				)
				(local20
					show:
					view: 769
					cycleSpeed: 4
					setLoop: 2
					setCycle: End stopQueen
				)
				((View new:)
					view: 768
					posn: 158 64
					ignoreActors:
					addToPic:
				)
				((View new:)
					view: 769
					loop: 3
					posn: 48 139
					setPri: 0
					ignoreActors:
					addToPic:
				)
				(local22
					show:
					setCel: 3
					setLoop: 0
					posn: 300 144
					stopUpd:
				)
				(= local30
					(Print 120 5 80 {King Graham} 67 53 155 88)
				)
			)
			(15
				(if gModelessDlg (gModelessDlg dispose:))
				(Timer setReal: self 3)
			)
			(16
				(gCast eachElementDo: #hide)
				(gRoom drawPic: 203)
				(local22 show: setCel: 0 setLoop: 2 posn: 180 99 stopUpd:)
				(= local30 (Print 120 6 67 -1 152 88))
				(Timer setReal: self 5)
			)
			(17
				(if gModelessDlg (gModelessDlg dispose:))
				(local22 dispose:)
				(gRoom drawPic: 204)
				((View new:)
					view: 752
					loop: 2
					cel: 0
					posn: 123 89
					ignoreActors:
					setPri: 0
					addToPic:
				)
				((View new:)
					view: 752
					loop: 2
					cel: 0
					posn: 204 89
					ignoreActors:
					setPri: 0
					addToPic:
				)
				((Prop new:)
					view: 752
					loop: 4
					posn: 123 63
					cycleSpeed: 0
					setCycle: Fwd
					init:
					yourself:
				)
				((Prop new:)
					view: 752
					loop: 4
					posn: 204 63
					cycleSpeed: 0
					setCycle: Rev
					init:
					yourself:
				)
				((View new:)
					view: 752
					loop: 3
					posn: 47 139
					ignoreActors:
					addToPic:
				)
				(local19
					show:
					setPri: 15
					view: 752
					setLoop: 0
					setCel: 0
					posn: 162 144
					stopUpd:
				)
				(local20
					show:
					view: 756
					setPri: 9
					setLoop: 1
					setCel: 0
					ignoreActors:
					posn: 85 177
					stopUpd:
				)
				(local21
					show:
					view: 756
					setPri: 9
					loop: 0
					cel: 0
					ignoreActors:
					posn: 228 176
					stopUpd:
				)
				(local18
					show:
					view: 756
					setPri: 10
					loop: 2
					cel: 0
					posn: 251 177
					stopUpd:
				)
				(= local0 (Timer setReal: checkHang 15))
				(self cue:)
			)
			(18
				(if (!= (openMusic prevSignal?) -1)
					(-- state)
					(Timer setReal: self 2)
				else
					(Timer setReal: self 5)
					(if (IsObject local0) (local0 dispose:))
				)
			)
			(19
				(gCast eachElementDo: #hide)
				(gRoom drawPic: 205)
				(openMusic dispose:)
				((ScriptID 520 1) play:)
				(local19
					show:
					view: 752
					setLoop: 1
					setCel: 0
					posn: 162 119
					setPri: 8
				)
				(= local30 (Print 120 7 67 -1 134 88))
				(Timer setReal: self 7)
			)
			(20
				(proc0_21)
				(gRoom drawPic: 204)
				(gCast eachElementDo: #show)
				((View new:)
					view: 752
					loop: 3
					posn: 47 139
					ignoreActors:
					addToPic:
				)
				((View new:)
					view: 752
					loop: 2
					cel: 0
					posn: 123 89
					ignoreActors:
					setPri: 0
					addToPic:
				)
				((View new:)
					view: 752
					loop: 2
					cel: 0
					posn: 204 89
					ignoreActors:
					setPri: 0
					addToPic:
				)
				(local19
					view: 752
					setPri: 15
					setLoop: 0
					setCel: 0
					posn: 163 137
					stopUpd:
				)
				(local20 setCel: 255 stopUpd:)
				(local21 setCel: 255 stopUpd:)
				(local18
					setStep: 4 -1
					setCycle: End
					setMotion: MoveTo 340 176
				)
				(= local30 (Print 120 8 67 -1 10 70 300 88))
				(Timer setReal: self 4)
			)
			(21
				(= global205 1)
				(if gModelessDlg (gModelessDlg dispose:))
				(gRoom newRoom: 221)
			)
		)
	)
)

(instance stopKing of Script
	(properties)
	
	(method (cue)
		(local19 stopUpd:)
	)
)

(instance stopQueen of Script
	(properties)
	
	(method (cue)
		(local20 stopUpd:)
	)
)

(instance stopSon of Script
	(properties)
	
	(method (cue)
		(local21 stopUpd:)
	)
)

(instance stopRosella of Script
	(properties)
	
	(method (cue)
		(local18 stopUpd:)
	)
)

(instance checkHang of Script
	(properties)
	
	(method (cue)
		(gTimers eachElementDo: #dispose 84)
		(introSc changeState: 19)
	)
)
