/******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 151)
/******************************************************************************/
(use "controls")
(use "cycle")
(use "door")
(use "feature")
(use "game")
(use "inv")
(use "main")
(use "obj")
(use "menubar")
(use "rev")
/******************************************************************************/
(instance public rm151 of Rm
	(properties
		picture 151
		north 0
		east 0
		south 0
		west 0
	)
	(method (init)
		(super:init())
		(self:setScript(RoomScript))

        SetUpEgo()
        (SL:disable())

		(send gEgo:init() posn(115 39) loop(1))
        ProgramControl()
        (Light: init() cel(0))
        (aSwitch: init() cel(1))
        (aAction: init() cycleSpeed(1) setCycle(End))
    (aE: init() setMotion(MoveTo 105 180 RoomScript))
        

        
	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
 (method(doit)
  (send gGame:setSpeed(3))
 )
 (method(changeState newState)
 = state newState
 (switch(state)
 (case 1
(aAction: setCycle(Rev RoomScript))
(aE: setMotion(MoveTo 121 180 RoomScript))
 )
 (case 2
 (aAction: dispose())
 (send gEgo: cycleSpeed(1) moveSpeed(1) setMotion(MoveTo 89 39 RoomScript))
 )
 (case 3
 (send gEgo: loop(3))
 (aE: init() setMotion(MoveTo 20 180 RoomScript))
 )
 (case 4
 Print("Waiting Command:\n\nuse keycard|" #at 130 170 #time 4  #icon 363 0 0)
  (aE: moveSpeed(1) setMotion(MoveTo 80 180 RoomScript))
Print("You slip your keycard trough the slot but nothing happens...")
  )
 (case 5
 Print("Eigen! It doesn't work! Some idiot gave me the wrong keycard!" #title "Dr.Jummybummy:" #icon 777 0 0)
   (aE: setMotion(MoveTo 40 180 RoomScript))
   )
 (case 6
  Print("...CUT!..."#title"Eigen:" #icon 777 0 5)
   (aE: setMotion(MoveTo 22 180 RoomScript))
   )
   (case 7
    Print("How many times have I said that take the green one?!"#title"Eigen:" #icon 777 0 5)
      (aE: setMotion(MoveTo 47 180 RoomScript))
        )
 (case 8
 Print("I have the green one. But it doesn't work!" #title "Dr.Jummybummy:" #icon 777 0 0)
   (aE: setMotion(MoveTo 24 180 RoomScript))
      )
   (case 9
    Print("Use the other side!"#title"Eigen:" #icon 777 0 5)
      (aE: setMotion(MoveTo 52 180 RoomScript))
      )
      (case 10
     (send gRoom: newRoom(152))
 )
 )
 )
)
 (instance Light of Prop
  (properties
 view 3
 y 13
 x 81
 ))
 (instance aSwitch of Prop
  (properties
 view 6
 y 136
 x 296
 ))
  (instance aE of Act
 (properties
 view 300
 x 1
 y 180
 ))
   (instance aAction of Act
 (properties
 view 200
 x 220
 y 160
 ))
/******************************************************************************/
