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

		(switch(gPreviousRoomNumber)
			(case 23
               (send gTheMusic:
			prevSignal(0)
			stop()
			number(9)
			loop(-1)
			play()
		)
				(send gEgo:
					posn(90 116)
					loop(1)

				)
    )
    (case 976
                (send gTheMusic:
			prevSignal(0)
			stop()
			number(9)
			loop(-1)
			play()
		)
				(send gEgo:
					posn(90 116)
					loop(1)

				)
    )
    (case 25
        (send gTheMusic:
			prevSignal(0)
			stop()
			number(9)
			loop(-1)
			play()
		)
				(send gEgo:
					posn(22 32)
					loop(2)

				)
			)
		)

		SetUpEgo()
		(send gEgo:init()view(45)moveSpeed(1)cycleSpeed(1))
        (if(== dialog 0)
        = dialog 1
        Print("To move your vessel around, click the left mouse button and the vessel will move there. To get out of the vessel type 'get out' or 'exit'.")
	))
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
  (method (handleEvent pEvent)
(super:handleEvent(pEvent))



(if(Said('exit,leave,(get<out)/vessel,ship') or (if(Said('exit,leave,(get<out)'))))
(if(< (send gEgo:distanceTo(Loc2)) 10)
(send gRoom:newRoom(23))
return
)
(if(< (send gEgo:distanceTo(Loc1)) 10)
Print("You walk right into the club...")
(send gRoom:newRoom(25))
return
)
Print("This is not a good spot to leave your vessel.")
)
(if(Said('look>'))
(if(Said('/island'))
Print("All the buildings around here are on those flying islands.")
)
(if(Said('/club'))
Print("It's the local club. Tonight they have Comedy Night. Go and check it out.")
)
(if(Said('/vessel'))
Print("This is the vessel you use to ride around.")
)
(if(Said('/space'))
Print("Better don't look down.")
)
(if(Said('/prisocorp'))
Print("That's the prison you escaped from. Wouldn't want to go back there.")
)
(if(Said('/star'))
Print("You don't see anything special about those. They are just like on Earth.")
)
(if(Said('/land'))
Print("Now this is one big flying island. You don't see any buildings on it."))
)
(if(Said('/building'))
Print("Lots of building everywhere. You can see a club and the Prisocorp")
)
 (if(Said('/'))
Print("You're hoovering around in the local area. There are some buildings. You can see a local club to the left and the Prisocorp in the lower area. The biggest building is just a residental area.")
)
)
 (method(doit)
 (var dyingScript)
 (if(==(send gEgo: onControl()) ctlNAVY)
 (send gEgo: view(46) setCycle(End))
   = dyingScript ScriptID(DYING_SCRIPT)
  (send dyingScript:
    caller(3)
    register("I think you just crashed!")
  )
  (send gGame:setScript(dyingScript))

 )
 )
)

(instance Loc1 of Act
 (properties
 view 300
 x 18
 y 34
 ))
 (instance Loc2 of Act
 (properties
 view 300
 x 91
 y 112
 ))
/******************************************************************************/
