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

		(switch(gPreviousRoomNumber)

			(default
   (if(holeBroke)
             DrawPic(139)
             )
				(send gEgo:
					posn(178 105)
					loop(1)
				)
			)
   (case 142
          DrawPic(139)
				(send gEgo:
					posn(108 100)
					loop(0)
				)
			)
		)
        SaveSpeed(2)
		SetUpEgo()
		(send gEgo:init() cycleSpeed(1) moveSpeed(1) view(195))
       (if(not(== gPreviousRoomNumber 142))
        Print("...man, it's dark in here. And cold!")
        )
	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
(method(doit)
(if(== savedGame2 77)
(if(holeBroke)
= savedGame2 76
DrawPic(139))
)
)
(method (handleEvent pEvent)
(super:handleEvent(pEvent))
              (if(Said('look>'))
(if(Said('/dirt'))
Print("It's all around you. There's not much else here.")
)
(if(Said('/hole'))
(if(holeBroke)
Print("There are two holes. One leads back outside, another one goes into the shed.")
return
)
Print("This hole leads back outside.")
)
(if(Said('/boards'))
Print("These boards look old. Few hits with something strong, should break those.")
)
(if(Said('/'))
Print("You're in the hole you dug. To the right, you see a way out. To the left, are some wooden-boards.")
        )
        )

(if(Said('break,hit/boards,wood,wall/(axe,tool)') or (if(Said('use,hit/axe/boards,wood,wall'))))
(if(holeBroke)
Print("You have troubles with seeing? It's broke already.")
return
)
(if(==(send gEgo: onControl()) ctlNAVY)
(if(send gEgo: has(INV_AXE))
Print("After few hits with the axe, the boards broke down and you can see inside the shed.")
+= gScore 2
= holeBroke TRUE
DrawPic(139)
return
)
Print("You don't have that strong tool to do it.")
return
)
Print("You're too far away form the boards.")
)
(if(Said('(get,go,climb<out,in),climb/hole,trough') or (if(Said('(get,climb<out,in)'))))
 (if(==(send gEgo: onControl()) ctlRED)
Print("Ok")
(send gRoom: newRoom(77))
return
)
(if(holeBroke)
(if(==(send gEgo: onControl()) ctlNAVY)
Print("You climb into the shed.")
(send gRoom: newRoom(142))
return
)
Print("You're not close to any of these holes. The one you dug and the one you broke with the axe.")
return
)
Print("You're not close enough the hole.")
)
        )
)
/******************************************************************************/
