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

		(switch(gPreviousRoomNumber)
  (case 76
  (send gEgo:
					posn(240 126)
					loop(1)
				)
  )
    (case 136
    RestoreSpeed()
   (send gEgo:
					posn(240 126)
					loop(0)
				)
  )

   (case 79
   (send gEgo:
					posn(314 120)
					loop(1)
				)
  )
  (default
   (send gEgo:
					posn(310 187)
					loop(3)
				)
  )
   	(case 75
            (if(== side 1)
            (send gEgo:
					posn(22 139)
					loop(0)
				)
    )       (if(== side 2)
    (send gEgo:
					posn(275 65)
					loop(0)
				)
			))
		)

		SetUpEgo()
		(send gEgo:init()cycleSpeed(0) moveSpeed(0))
	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
  	(method (handleEvent pEvent)
        (super:handleEvent(pEvent))
          (if(Said('open/door'))
        Print("This door is protected with Thief Keeper Mark V. This means it can't be opened. Even by the owner.")
        )
       (if(Said('look>'))
        (if(Said('/roof'))
 Print("It doesn't hold your intrest for long.")
 )
  (if(Said('/tree'))
 Print("Haven't you seen one before? Go out and see then!")
 )
  (if(Said('/forest'))
 Print("'I can't see, the trees are blocking the view.' Haahaa ... very funny!")
 )
  (if(Said('/car'))
 Print("It's in front of the house.")
 )
  (if(Said('/window'))
 Print("The windows are curtained from the inside.")
 )
 (if(Said('/house'))
 Print("The house looks pretty nice from the outside.")
 )
 (if(Said('/lock,picklock'))
 Print("It's the Thief Keeper Mark V. No way to open it.")
 )
  (if(Said('/door'))
 Print("It's only few boards but won't be open that easily. Meaning, it stays closed.")
 )
 (if(Said('/fence'))
 Print("It goes around the house. Looks like it's been built a long time ago.")
 )
   (if(Said('/ground,grass'))
 Print("There's quite a big hole in the ground next to the shed. It goes under it.")
 )
  (if(Said('/shed'))
 Print("Looks like a regular fireplace wood keeping place. A nice dusty shed. The door of the shed is locked with a picklock.")
 )
(if(Said('/'))
Print("You're in back of a house. There's a shed along the back wall of the house.")

         ))
        
   (if(Said('take/shovel,tool'))
   Print("You don't need it anymore.")
   )
        (if(Said('enter,climb,crawl,(climb,crawl,jump,get<in)>'))
        (if(Said('/hole,tunnel,shed,house'))
 (if(==(send gEgo: onControl()) ctlYELLOW)
        Print("You climb into the hole...")
        (send gRoom: newRoom(136))
        return
        )
        Print("You're too far away form the hole in the ground.")
        )
        (if(Said('/'))
        Print("Please specify a bit.")
        )
        )
        
(if(Said('use/shovel') or (if(Said('use/shovel/ground,hole,tunnel') or (if(Said('dig/ground/shovel')or(if(Said('dig/ground,hole,tunnel'))))))))
        Print("You don't have to dig anymore. You already did.")
        )
      )
       (method(doit)
 (if(==(send gEgo: onControl()) ctlSILVER)
 = side 2
 (send gRoom: newRoom(75))
 )
 (if(==(send gEgo: onControl()) ctlNAVY)
 = side 1
 (send gRoom: newRoom(75))
 )
 )
)
/******************************************************************************/
