/******************************************************************************/
/******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 10)
/******************************************************************************/
(use "Controls")
(use "Cycle")
(use "Door")
(use "Feature")
(use "Game")
(use "Inv")
(use "Main")
(use "Obj")
/******************************************************************************/
(instance public rm010 of Rm
	(properties
		picture scriptNumber
		north 0
		east 0
		south 0
		west 0
	)
	(method (init)
		(super:init())
		(self:setScript(RoomScript))
		
		(switch(gPreviousRoomNumber)
			(case 6
			(send gEgo:
      posn(200 180)
      loop(1)
			)
		)
		(case 11
			(send gEgo:
      posn(140 165)
      loop(2)
			)
		)

			(default
				(send gEgo:
					posn(150 130)
					loop(1)
				)			)
		)
		
		SetUpEgo()
		(send (View:new()):view((Meter1:view))loop(0)cel(0)posn((Meter1:x) (Meter1:y))setPri(12)ignoreActors()addToPic())
	(send (View:new()):view((Meter3:view))loop(0)cel(0)posn((Meter3:x) (Meter3:y))setPri(12)ignoreActors()addToPic())
	(send (View:new()):view((Meter2:view))loop(0)cel(0)posn((Meter2:x) (Meter2:y))setPri(12)ignoreActors()addToPic())
	(send (View:new()):view((Backback:view))loop(0)cel(0)posn((Backback:x) (Backback:y))setPri(13)ignoreActors()addToPic())

	(Depdoor:init())
		
		(send gEgo:init())
	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)

	(method (doit)
		(super:doit())
		
		// code executed each game cycle
	)

	(method (handleEvent pEvent)
		(super:handleEvent(pEvent))
		// handle Said's, etc...
		(if(Said('open / door'))
		Print("Forces larger than yourself have conspired to make this the end of your journey.")
		Display("That's the end of the demo, thanks for playing!")
		)
	)

	(method (changeState newState)
		(= state newState)
		(switch (newState)
			(case 0
				// Handle state changes
			)
		)
	)
)
/******************************************************************************/
(instance Meter1 of Prop
	(properties
		x 190
		y 153
		view 64
		loop 0
	)
		
)
(instance Meter2 of Prop
	(properties
		x 255
		y 153
		view 64
		loop 0
	)
		
)
(instance Meter3 of Prop
	(properties
		x 48
		y 153
		view 64
		loop 0
	)
		
)
(instance Backback of Prop
	(properties
		x 314
		y 183
		view 62
		loop 0
	)
		
)
(instance Depdoor of Door
	(properties
		x 128
		y 152
		view 134
		entranceTo 11
		locked TRUE
		doorCtrl $0002
		roomCtrl $0004
		doorBlock $0008
		priority 1
	)
)
