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

		(switch(gPreviousRoomNumber)
			(default
				(send gEgo:
					posn(160 120)
					loop(2)
				)
			)
		)

		SetUpEgo()
  (send gEgo:init() view(197))
  (if(not(send gEgo: has(INV_HOUSE_KEY)))
  (aKey: init())
  )
	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
 (method(doit)
 (if(==(send gEgo: onControl())ctlRED)
 Print("You fell back into the hole.")
  (send gRoom: newRoom(136))
  return
 )
 )
 (method (handleEvent pEvent)
(super:handleEvent(pEvent))
              (if(Said('look>'))
(if(Said('/sign'))
Print("/web,(spider<web)")
Print("These webs are empty. And have been for a long-long time.")
)
(if(Said('/wall'))
Print("These walls look very weak. Some spider-webs in the corners.")
(if(not(send gEgo: has(INV_HOUSE_KEY)))
Print("A small key is hanging on the wall, near the door.")
)
)
(if(Said('/hole'))
Print("This is your way into and out of the shed.")
)
(if(Said('/floor'))
Print("This wooden-board floor contains a hole.")
)
(if(Said('/nail'))
Print("Which one?")
Print("There's quite a few of them in here.")
)
(if(Said('/key'))
(if(send gEgo: has(INV_HOUSE_KEY))
Print("It's in your inventory. Press TAB to see it.")
return
)
Print("It's a small key hanging on a nail.")
)
(if(Said('/'))
(if(send gEgo: has(INV_HOUSE_KEY))
Print("You are inside this old and dusty shed. A hole is the the floor.")
return
)
Print("You are inside this old and dusty shed. A hole is the the floor.")
Print("A small key is hanging on the wall, near the door.")

        )
        )

(if(Said('(get,climb<out,in),climb/hole') or (if(Said('(get,climb<out,in)'))))
Print("You climb back into the hole.")
  (send gRoom: newRoom(136))
  return
)
(if(Said('take/key'))
(if(send gEgo: has(INV_HOUSE_KEY))
Print("Check your pockets dude. You already have the key.")
return
)
Print("Sir, yes sir!")
+= gScore 2
  (aKey: hide())
(send gEgo: get(INV_HOUSE_KEY))
)

)

)
(instance aKey of Act
(properties
view 198
x 122
y 71
))
/******************************************************************************/
