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

		(switch(gPreviousRoomNumber)
			(case 3
				(send gEgo:
					posn(91 112)
					loop(2)
				)
			)
   (case 66
				(send gEgo:
					posn(xx yy)
					loop(3)
				)
			)
		)

		SetUpEgo()
		(send gEgo:init())
  (aPainting: init())
	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
 (method(doit)
  (if(==(send gEgo: onControl()) ctlRED)
       (send gRoom: newRoom(3))
       )
 )
  	(method (handleEvent pEvent)
        (super:handleEvent(pEvent))
        (if(Said('close/door'))
    Print("This door doesn't close. You once pushed the door too far, so now it's stuck to the floor.")
        )
   (if(Said('(turn<on),activate,press,use,flip,watch>'))
   (if(Said('/tv'))
   Print("There's nothing interesting on at the moment.")
   )
   (if(Said('/button,switch,light,(light<switch,button)'))
   Print("The room is lit enough.")
   )
   )
   (if(Said('sleep,lay'))
   Print("Sleep is for the weak.")
   )
   (if(Said('make/bed'))
   Print("You can do it later.")
   )
(if(Said('look>'))
(if(Said('/door'))
Print("The door is open. And I don't think that it's even possible to close it.")
)
(if(Said('/window'))
Print("You look out of the window and see a street.")
Print("Suprised?")
)
(if(Said('/switch,button'))
Print("This is the light switch for the ceiling light.")
)
(if(Said('/blanket'))
Print("What about it?")
)
(if(Said('/painting'))
Print("It was drawn a few months ago. An interesting thing to note is that the eyes almost look as they are pointing somwhere.")
)
(if(Said('/wall'))
Print("A painting of you is hanging on the wall.")
)
(if(Said('/bed'))
Print("Got to make up the bed some time.")
)
(if(Said('/view'))
Print("It's not very cool. You can see A LOT of houses. And there should be a skyscraper far far away.")
)
(if(Said('/pillow'))
Print("You've got to stop sleeping with your mouth open.")
)
(if(Said('/sheet'))
Print("You don't see anything special about that sheet.")
)
(if(Said('/tv'))
Print("You can watch 4 wonderful channels on this TV.")
)
(if(Said('/drawer'))
(if(send gEgo: has(INV_GLASSES))
Print("You keep your stuff in these drawers. They are totally empty at the moment.")
return
)
Print("You keep your stuff in these drawers. So, they are pretty empty. Your glasses should be in there too.")
)
(if(Said('/wardrobe,clothes'))
Print("If you'd have any other clothes besides two pairs of socks, you would keep them in there.")
)
(if(Said('/'))
Print("You're in your room. There are 2 drawers and a bed. The view from the window is not very cool. A TV is along the left wall. There is also a wardrobe at the back wall.")
        )
        )
        (if(Said('close/drawer,closet'))
        Print("It's already closed.")
        )
        (if(Said('open>'))
        (if(Said('/closet'))
        Print("This closet contains nothing useful for you, so you don't have to open it.")
        )
        (if(Said('/door'))
        Print("Can't you see that it's already opened.")
        )
        (if(Said('/drawer'))
        (if(==(send gEgo: onControl()) ctlNAVY)
        = xx (send gEgo: x)
        = yy (send gEgo: y)
        (send gRoom: newRoom(66))
        return
        )
        Print("You're too far away from the drawer.")
        )
        )
        )
)
(instance aPainting of Prop
(properties
view 86
x 125
y 87
))
/******************************************************************************/
