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

		(switch(gPreviousRoomNumber)
			(default
				(send gEgo:
					posn(150 130)
					loop(1)
				)
			)
		)

ProgramControl()
  (send gTheMusic:
			prevSignal(0)
			stop()
			number(108) //2
			loop(-1)
			play()
		)

   = anim 0

   /*
   */


 )
)


  
/******************************************************************************/
(instance startScript of Script
	(properties)
 (method(changeState newState)
 = state newState
 (switch(state)
 (case 0
 (aScreen2: init() setCycle(End startScript))
 )
 (case 1
 (if(connected)
  += gScore 4
      Wait(25)
      Print("Here we go!")
      Wait(20)
      (send gRoom: newRoom(62))
   return
   ) //else
 (aScreen3: init() cel(0) setCycle(End startScript))
 )
 (case 2
 (aScreen3: cel(0) setCycle(End startScript))
  )
 (case 3
 (aScreen3: cel(0) setCycle(End startScript))
   )
 (case 4
 (aScreen3: cel(0) setCycle(End startScript))
 )
 (case 5
 (aScreen3: loop(1) cel(0) setCycle(End startScript))
  )
 (case 6
 (aScreen3: loop(1) cel(0) setCycle(End startScript))
   )
 (case 7
 (aScreen3: loop(1) cel(0) setCycle(End startScript))
 )
 (case 8
 Print("Electrical fault in left ignition system!" #title "Fault:")
 Print("And you remove the key and get out.")
 (send gRoom: newRoom(63))
 )
 )
 )
 )
(instance RoomScript of Script
	(properties)
 (method(doit)
 (if(== anim 0)
 = button4 Print("Welcome aboard the P.S.S.Vessel, the most advanced cargo freight. Please make your destination choice:\n\n\n" #button "Desert" 0 #button "Army Base" 1 #button "Stay" 2 #title "P.S.S.Vessel")
 (if(== button4 1)
 Print("The Army Base is on authorization level 5, which means you can't go there.")
 = anim 0
 return
 )
  = anim 1
  (if(== button4 0)
        Print("\"Please enter the key for authorization.\"" #at 150 20)
    (if(send gEgo: has(INV_CARGO_KEY))

      Print("You enter the key.")
      (aKey: init())
     (aScreen1: init() setCycle(End startScript))
     return
      )
      Print("You don't have the key. You need it to start the shuttle.")
       (send gRoom:newRoom(63))
      return

  
 )
    (send gRoom:newRoom(63))
 = anim 1
 )
 )


)
(instance aKey of Act
(properties
view 90
x 125
y 138
))
(instance aScreen1 of Act
(properties
view 92
x 177
y 131
))
(instance aScreen2 of Act
(properties
view 92
x 186
y 131
))
(instance aScreen3 of Act
(properties
view 96
x 223
y 131
cycleSpeed 4
))
/******************************************************************************/
