/******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 20)
/******************************************************************************/
(use "controls")
(use "cycle")
(use "door")
(use "feature")
(use "game")
(use "inv")
(use "main")
(use "obj")
(string
theNum[1]
)
/******************************************************************************/
(instance public rm020 of Rm
	(properties
		picture scriptNumber
		north 0
		east 0
		south 144
		west 0
	)
	(method (init)
		(super:init())
    (if(not(send gEgo:has(INV_SPACESUIT)))
(aSpacesuit: init())
 )
(self:setScript(RoomScript))
(switch(gPreviousRoomNumber)
   (default

				(send gEgo:
					posn(122 166)
     view(0)
     loop(3)

				)
			)
		)


		SetUpEgo()
           = lef TRUE
		(send gEgo:init())


    (if(>= buttonNumber 5)
    (aLight: init())
    )
       )
       

)
/******************************************************************************/
(instance RoomScript of Script
(properties)
  (method(doit)

   (if(==(send gEgo:onControl()) ctlRED)
  (send gRoom:newRoom(144))
   )
   )

(method (handleEvent pEvent)
(super:handleEvent(pEvent))
(if(Said('open/bolts,screw'))
Print("Why do you want to do that?")
)
(if(Said('(take<off),remove/spacesuit'))
 Print("You don't want to do that.")
)
(if(Said('take,grab,wear>'))
(if(Said('/spacesuit'))
   (if(==(send gEgo:onControl()) ctlNAVY)
(if(send gEgo:has(INV_SPACESUIT))
Print("You already have it, dude!")
return
)
Print("Ok")
(SL:doit())
(send gEgo: get(INV_SPACESUIT))
+= gScore 3
(aSpacesuit: hide())
Print("You decide to put the spacesuit on.")
avatar = 0
(send gEgo: view(700))
= gEgoView 700
= showAir TRUE
= oxygen 140
return
)
Print("You can't reach it from this distance.")
return
)
(if(Said('/helmet'))
(if(send gEgo:has(INV_SPACESUIT))
Print("It's not here.")
return
)
Print("There's no use in just wearing the helmet. Take the whole spacesuit.")
)
(if(Said('/tank'))
(if(send gEgo:has(INV_SPACESUIT))
Print("It's not here.")
return
)
Print("There's no use for air-tank only. Take the whole spacesuit.")
)
(if(Said('/crate'))
Print("You don't have to take these crates.")
)
)
(if(Said('press,activate/button,panel,keypad'))
(if(not(==(send gEgo: onControl()) ctlYELLOW))
Print("You have to move closer to the buttons.")
return
)
+= buttonNumber 1
(if(== buttonNumber 1)
Print("You press button number 1. Nothing. Try the next one.")
)
(if(== buttonNumber 2)
Print("You press button number 2. Also nothing happens. Try the next one.")
)
(if(== buttonNumber 3)
Print("You press button number 3. Still nothing. Keep on trying.")
)
(if(== buttonNumber 4)
Print("You press button number 4. This button also did nothing. Try the next one.")
)
(if(== buttonNumber 5)
Print("You press button number 5 and notice a small light going green.")
(aLight: init())
= deactivated TRUE
+= gScore 4
)
(if(> buttonNumber 5)
Print("No need to press any more buttons.")
)
return
)
(if(Said('look>'))
(if(Said('/floor'))
(if(send gEgo: has(INV_SPACESUIT))
Print("There are some crates on the floor. There's also a closet and some buttons on the wall. Some old pipes are laying on the floor.")
return
)
Print("There are some crates on the floor. In front of the shelf you can see a spacesuit. Some old pipes are laying on the floor.")
)
(if(Said('/tank,(air<tank)'))
Print("Together with the helmet, they make up a spacesuit.")
)
(if(Said('/helmet,(spacesuit<helmet)'))
Print("Together with the air-tank, they make up a spacesuit.")
)
(if(Said('/ceiling,box,crate,closet'))
Print("You don't see anything interesting in/on them.")
)
(if(Said('/wall'))
Print("There's a ventilation tunnel entrance on the wall. Also there are some buttons on the wall.")
)
(if(Said('/grid,hatch'))
Print("This grid is blocking the air-ventilation tunnel.")
)
(if(Said('/bolts'))
Print("There are 4 bolts that hold the grid in place. Don't try to open those. These are of no use to you.")
)
(if(Said('/vent,hole,shaft,(vent,hole<shaft,entrance)') or (if(Said('/vent,hole'))))
Print("It's for ventilating the air around here. The bolts seems very tightly sealed.")
)
(if(Said('/closet,wardrobe'))
Print("The doors seem locked but I don't anything from the closet.")
)
(if(Said('/stick,post'))
Print("They are just laying on the ground.")
)
(if(Said('/button,keypad'))
Print("There are five buttons. I wonder what they do.")
)
(if(Said('/pipe'))
Print("What can I say? They are round, strong and useless.")
)
(if(Said('/shelf'))
Print("Nothing interesting on them.")
)
(if(Said('/shadow,(dark<land)'))
Print("This is getting nonsense. Looking at shadows? What next? I know, don't answer!")
)
(if(Said('/spacesuit'))
(if(send gEgo: has(INV_SPACESUIT))
Print("It's in your inventory. To see it press TAB.")
return
)
Print("It's a spacesuit. You could use it.")
)
(if(Said('/'))
(if(send gEgo: has(INV_SPACESUIT))
Print("This looks like some cleaner's room. Some crates and a shelf.")
return
)
Print("This looks like some cleaner's room. There are some crates and a shelf here. Also you can see a spacesuit near the shelves.")
)
)
)
)

(instance aSpacesuit of Prop
(properties
view 21
x 145
y 99
))
(instance aLight of Prop
(properties
view 361
x 173
y 71
))



/******************************************************************************/
