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

		(switch(gPreviousRoomNumber)
			(case 144

				(send gEgo:
					posn(61 125)
					loop(2)
				)
    )
  (case 40
     (send gTheMusic:
			prevSignal(0)
			stop()
			number(5)
			loop(-1)
			play()
		)
= sitting FALSE   SetUpEgo()
(send gEgo: view(700) posn(184 142) loop(3))

)
    
    (default

				(send gEgo:
                   posn(61 125)
					loop(2)
				)
			)
		)

		SetUpEgo()
		(send gEgo:init())
  (aVessel: init())

  (if(== gPreviousRoomNumber 40)

   )
	)
)
/******************************************************************************/
(instance RoomScript of Script
(properties)
(method(doit)
(var dyingScript)
(if(==(send gEgo: onControl())ctlNAVY)
= pY 185
(send gEgo: view(49)posn(Xposn2 pY)setCycle(End))
= dyingScript ScriptID(DYING_SCRIPT)
   Wait(5)(send dyingScript:
    caller(4)

    register("You felt a strong vacuum pulling you down. Next time, be more careful!")
  )
  (send gGame:setScript(dyingScript))


)
(if(not(send gEgo:has(INV_SPACESUIT)))
Wait(20)
Print("...hhghgggggf.....")
Wait(20)
Print("....I..I...")
Wait(20)
Print("....can't....")
Wait(20)
Print("....br..eath...")
Wait(20)
   = dyingScript ScriptID(DYING_SCRIPT)
  (send dyingScript:
    caller(3)
    register("There seems to be no oxygen outside...")
  )
  (send gGame:setScript(dyingScript))

)
)
 (method (handleEvent pEvent)
(super:handleEvent(pEvent))

 (if(Said('look>'))
(if(Said('/vessel'))
(if(send gEgo:has(INV_VESSEL_KEY))
Print("It looks like a modern space vessel to drive around with. Maybe the key you found is for this vessel.")
return
)
Print("It looks like a modern space vessel to drive around with. Too bad it's not yours, but you could use it anyway ... just find the key for it.")
)
(if(Said('/in/vessel'))
Print("Lots of buttons and a steering wheel.")
)
(if(Said('/wheel'))
Print("Haven't you seen one before?")
)
(if(Said('/roof,glass'))
Print("The roof of the Prisocorp prison is made of glass. Of course if the material is glass around here.")
)
(if(Said('/button'))
Print("This button is used for opening the door next to it.")
)
(if(Said('/island'))
Print("This is the flying island that holds up the Prisocorp prison.")
)
(if(Said('/sign'))
Print("\"Prisocorp\"")
)
(if(Said('/building'))
Print("This is the Prisocorp prison complex. You just managed to escape from here.")
)
(if(Said('/prisocorp'))
Print("That's the name of the prison around here. You are outside of it.")
)
(if(Said('/space'))
Print("It looks bottomless... but is it?")
)
(if(Said('/ground,sky'))
Print("You don't see anything special about it.")
)
(if(Said('/wall'))
Print("'Prisocorp' wall. There's a small button next to the door.")
)
(if(Said('/door'))
Print("You can go back in through this door. It's opened by pressing the button next to it.")
)
(if(Said('/stars'))
Print("They look like white dots.")
)
(if(Said('/'))
Print("You're outside the Prisocorp prison complex. There's also a space vessel.")
)
)
(if(Said('exit,leave,(get<out)/vessel,ship') or (if(Said('exit,leave,(get<out)'))))
(if(not(sitting))
Print("You're already out the space vessel.")
return
)
= sitting FALSE
(send gEgo: init() view(700) posn(184 142) loop(3))
(aSit: hide())
)
(if(Said('open/door'))
Print("To open this door, you have to press the button next to it.")
)
(if(Said('press/button'))
(if(==(send gEgo: onControl()) ctlYELLOW)
Print("Ok")
(send gRoom:newRoom(144))
return
)
Print("You're too far away from the door.")
)
(if(Said('drive/vessel,ship')or(if(Said('drive')or(if(Said('start/ship,vessel')or(if(Said('use/key')or(if(Said('use/key/ship,vessel'))))))))))
(if(sitting)
(if(send gEgo:has(INV_VESSEL_KEY))
(if(send gEgo:has(INV_MAP))
Print("Ok, let's drive around a bit!")
 (send gRoom:newRoom(40))
return
)
Print("You could get lost in easily. You need some guidance.")
return
)
Print("It would be a great to start the vessel but for that you need the key.")
return
)
Print("First, you need to get into the vessel.")
)


(if(Said('(get<in),enter/vessel,ship')or(if(Said('(get<in),enter'))))
(if(==(send gEgo: onControl()) ctlRED)
(if(sitting)
Print("You're already in the space vessel.")
return
)
Print("Ok")
= sitting TRUE
(send gEgo: dispose())
(aSit: init() show())
return
)
Print("You're too far away from the vessel.")
)
)
)

(instance aVessel of Act
(properties
view 699
x 189
y 160
))
(instance aSit of Act
(properties
view 698
x 177
y 141
))
/*****************************************************************************/
