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

(public
	Room698 0
)

(local
	local0
	[newView 84]
)
(instance creditMusic of Sound
	(properties)
)

(instance Room698 of Rm
	(properties
		picture 698
		style $0008
	)
	
	(method (init)
		(Load rsVIEW 898)
		(Load rsVIEW 899)
		(super init:)
		(User canControl: 0 canInput: 0)
		(= global205 1)
		(gRoom setScript: creditActions)
	)
	
	(method (dispose)
		(User canControl: 1 canInput: 1)
		(= global205 0)
		(super dispose:)
	)
	
	(method (handleEvent pEvent)
		(if (pEvent claimed?) (return 1))
		(return
			(cond 
				(
					(and
						(== (pEvent type?) evKEYBOARD)
						(== (pEvent message?) KEY_F2)
					)
					(pEvent claimed: 1)
					(DoSound sndSET_SOUND (not (DoSound sndSET_SOUND)))
				)
				(
					(or
						(== (pEvent message?) KEY_x)
						(== (pEvent message?) KEY_X)
					)
					(gGame restart:)
				)
				(else (gRoom newRoom: 120))
			)
		)
	)
)

(instance creditActions of Script
	(properties)
	
	(method (changeState newState)
		(switch (= state newState)
			(0
				(creditMusic number: 2 play: self)
				((= newView (View new:))
					view: 898
					setPri: 0
					setLoop: 0
					setCel: 0
					x: 162
					y: 77
					init:
				)
				(= [newView 1] (View new:))
				([newView 1]
					view: 898
					setPri: 0
					setLoop: 0
					setCel: 1
					x: 162
					y: 111
					init:
				)
				(= seconds 4)
			)
			(1
				(newView dispose:)
				([newView 1] dispose:)
				(= [newView 2] (View new:))
				([newView 2]
					view: 898
					setPri: 0
					setLoop: 1
					setCel: 0
					x: 162
					y: 77
					init:
				)
				(= [newView 3] (View new:))
				([newView 3]
					view: 898
					setPri: 0
					setLoop: 1
					setCel: 2
					x: 162
					y: 112
					init:
				)
				(= seconds 3)
			)
			(2
				([newView 2] dispose:)
				(= [newView 4] (View new:))
				([newView 4]
					view: 898
					setPri: 0
					setLoop: 1
					setCel: 1
					x: 162
					y: 77
					init:
				)
				(= seconds 3)
			)
			(3
				([newView 4] dispose:)
				([newView 3] dispose:)
				(= [newView 6] (View new:))
				([newView 6]
					view: 898
					setPri: 0
					setLoop: 2
					setCel: 0
					x: 162
					y: 77
					init:
				)
				(= [newView 5] (View new:))
				([newView 5]
					view: 898
					setPri: 0
					setLoop: 2
					setCel: 1
					x: 162
					y: 99
					init:
				)
				(= [newView 7] (View new:))
				([newView 7]
					view: 898
					setPri: 0
					setLoop: 2
					setCel: 2
					x: 162
					y: 137
					init:
				)
				(= seconds 3)
			)
			(4
				([newView 6] dispose:)
				([newView 7] dispose:)
				([newView 5] dispose:)
				(= [newView 8] (View new:))
				([newView 8]
					view: 899
					setPri: 0
					setLoop: 0
					setCel: 0
					x: 162
					y: 77
					init:
				)
				(= [newView 9] (View new:))
				([newView 9]
					view: 899
					setPri: 0
					setLoop: 0
					setCel: 1
					x: 162
					y: 109
					init:
				)
				(= [newView 10] (View new:))
				([newView 10]
					view: 899
					setPri: 0
					setLoop: 2
					setCel: 0
					x: 162
					y: 145
					init:
				)
				(= seconds 5)
			)
			(5
				([newView 8] dispose:)
				([newView 9] dispose:)
				([newView 10] dispose:)
				(= [newView 11] (View new:))
				([newView 11]
					view: 898
					setPri: 0
					setLoop: 3
					setCel: 0
					x: 162
					y: 77
					init:
				)
				(= [newView 12] (View new:))
				([newView 12]
					view: 898
					setPri: 0
					setLoop: 4
					setCel: 0
					x: 162
					y: 109
					init:
				)
				(= [newView 8] (View new:))
				([newView 8]
					view: 898
					setPri: 0
					setLoop: 3
					setCel: 2
					x: 162
					y: 145
					init:
				)
				(= seconds 4)
			)
			(6
				([newView 11] dispose:)
				([newView 12] dispose:)
				([newView 8] dispose:)
				(= [newView 13] (View new:))
				([newView 13]
					view: 898
					setPri: 0
					setLoop: 3
					setCel: 1
					x: 162
					y: 77
					init:
				)
				(= [newView 14] (View new:))
				([newView 14]
					view: 898
					setPri: 0
					setLoop: 4
					setCel: 1
					x: 162
					y: 111
					init:
				)
				(= seconds 4)
			)
			(7
				([newView 13] dispose:)
				([newView 14] dispose:)
				(= [newView 15] (View new:))
				([newView 15]
					view: 899
					setPri: 0
					setLoop: 1
					setCel: 0
					x: 162
					y: 77
					init:
				)
				(= [newView 16] (View new:))
				([newView 16]
					view: 899
					setPri: 0
					setLoop: 1
					setCel: 1
					x: 162
					y: 109
					init:
				)
				(= [newView 17] (View new:))
				([newView 17]
					view: 899
					setPri: 0
					setLoop: 1
					setCel: 2
					x: 162
					y: 145
					init:
				)
				(= [newView 18] (View new:))
				(= seconds 4)
			)
			(8
				([newView 16] dispose:)
				([newView 17] dispose:)
				([newView 18]
					view: 899
					setPri: 0
					setLoop: 1
					setCel: 3
					x: 162
					y: 109
					init:
				)
				(= [newView 19] (View new:))
				([newView 19]
					view: 899
					setPri: 0
					setLoop: 1
					setCel: 4
					x: 162
					y: 145
					init:
				)
			)
			(9
				([newView 15] dispose:)
				([newView 18] dispose:)
				([newView 19] dispose:)
				(gRoom newRoom: 120)
			)
		)
	)
)
