/******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 21)
/******************************************************************************/
(use "controls")
(use "cycle")
(use "door")
(use "feature")
(use "game")
(use "inv")
(use "main")
(use "obj")
/******************************************************************************/
(instance public rm021 of Rm
	(properties
		picture scriptNumber
		north 0
		east 0
		south 144
		west 0
	)
	(method (init)
		(super:init())
          (if(not(send gEgo: has(INV_VESSEL_KEY)))
          (aKey: init())
          )

		(self:setScript(RoomScript))

		(switch(gPreviousRoomNumber)
			(default
				(send gEgo:
					posn(93 185)
					loop(3)
				)
			)
		)

		SetUpEgo()
		(send gEgo:init())
  = righty TRUE
	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
 (method (handleEvent pEvent)
(super:handleEvent(pEvent))


(if(Said('open,read,use,(use<with)/drawer,file,cabinet,(file<drawer)') or (if(Said('take/map'))))
(if(==(send gEgo: onControl())ctlRED)
(if(send gEgo: has(INV_MAP))
Print("Now that you have a map, you don't need anything else from this file cabinet.")
return
)
Print("You decide to go through the files.")
Wait(40)
Print("After some searching, you find a map of the local area.")
+= gScore 2
(send gEgo: get(INV_MAP))
return
)
Print("You're too far away from the file cabinet.")
)
(if(Said('take>'))
(if(Said('/painting'))
Print("That would be a theft.")
Print("So, NO!")
)
(if(Said('/key,object'))
(if(==(send gEgo: onControl())ctlYELLOW)
(if(send gEgo: has(INV_VESSEL_KEY))
Print("There's nothing to take anymore.")
return
)
Print("You pick up the key from the desk.")
+= gScore 2
(send gEgo: get(INV_VESSEL_KEY))
(aKey: hide())
return
)
Print("You can't reach the desk from this distance.")
)
)
(if(Said('look>'))
(if(Said('/desk'))
(if(send gEgo: has(INV_VESSEL_KEY))
Print("It's just a regular desk. Nothing special about it.")
return
)
Print("It's just a regular desk. There's a key on the desk.")
)
)
(if(Said('/drawer,file,cabinet,(file<drawer)'))
Print("Usually some important papers are held in those kind of drawers.")
)
(if(Said('/key'))
(if(send gEgo: has(INV_VESSEL_KEY))
Print("It's in your inventory. To see it press TAB.")
return
)
Print("It's just a key on the desk. I wonder what the key is used for. A door? A vehicle?")
)
(if(Said('/window'))
Print("You can see a building on a flying island outside.")
)
(if(Said('/painting'))
Print("It's not very beautiful to look at.")
)
(if(Said('/island'))
Print("They are not connected to anything but they still stay up. Unknown gravity...")
)
(if(Said('/building'))
Print("It looks like a residental building.")
)
(if(Said('/carpet'))
Print("This carpet gives this room a special look...")
)
(if(Said('/floor,wall,ceiling'))
Print("You don't see anything special about it.")
)
(if(Said('/chair'))
Print("This chair looks comfortable, but no time to sit.")
)
(if(Said('/beam'))
Print("I don't see any beams here.")
)
(if(Said('/'))
Print("You're in some office. There's a file drawer, desk, window and some paintings. Through the window you can see a building.")
)
)
)
(instance aKey of Prop
(properties
view 131
x 116
y 90
))

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