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

		(switch(gPreviousRoomNumber)
			(case 114
				(send gEgo:
					posn(167 114)
					loop(2)
				)
			)
   (case 116
				(send gEgo:
					posn(5 144)
					loop(0)
				)
			)
		)

		SetUpEgo()
		(send gEgo:init())
	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
 (method (handleEvent pEvent)
(super:handleEvent(pEvent))
(if(Said('look>'))
(if(Said('/door,doorway'))
Print("It leads to another room.")
)
(if(Said('/floor'))
Print("It's just a stone floor. Looks a bit different than everywhere else.")
)
(if(Said('/marking,markings'))
Print("An arrows is leading right.")
)
(if(Said('/wall'))
Print("On closer look you discover a marking on the wall.")
)
(if(Said('/'))
Print("You're in one of the rooms of the maze. The walls contain lots of scratches and stuff.")
)
)

)
 
  (method(changeState newState)
  (var dyingScript)
 = state newState
 (switch(state)
 (case 0
 )
 (case 1
    (send gEgo: hide())
   (aHole: setMotion(MoveTo (send gEgo: x) yyy RoomScript))
    )
    (case 2
   ShakeScreen(8 ssFULL_SHAKE)


   (send gEgo: hide())
      = dyingScript ScriptID(DYING_SCRIPT)
  (send dyingScript:
    caller(3)
    register("You're flatter than a flat pancake.")
  )
  (send gGame:setScript(dyingScript))
 )
 )
 )
 (method(doit)
 (if(==(send gEgo: onControl()) ctlNAVY)
 (send gRoom: newRoom(114))
 )
 (if(==(send gEgo: onControl()) ctlRED)
 (if(not(over))
 (aHole: ignoreControl(ctlWHITE))

  ProgramControl()
 = over TRUE
 = yyy (send gEgo: y)
 -= yyy 2
 (send gGame: setSpeed(0))
 (aHole: init() posn((send gEgo: x) 0) setMotion(MoveTo (send gEgo: x) yyy RoomScript))

 )
 )



 )
)
(instance aHole of Act
(properties
view 101
x 1
y 1
))

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