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

		(switch(gPreviousRoomNumber)
			(default
(send gEgo:
					posn(4 149)
					loop(0)
				)
    
    (if(not(guardD))
        Print("Status report, guard XD7.")
        Print("All clear!" #title "XD7")
                 )
    
			)
   		(case 15
(send gEgo:
					posn(169 72)
					loop(2)
				)
			)
		)

		SetUpEgo()
		(send gEgo:init())
       (Door2: init())
       (Door1: init())

       (if(bigDoorOpen)
       (Door1: hide())
       (Door2: posn(169 10))

       )
  (if(not(guardD))
  (aGuard: init())
  )
  
	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
   (method (handleEvent pEvent)
(super:handleEvent(pEvent))
(if(Said('talk/man,guard'))
(if(not(guardD))
Print("Better not!")
return
)
Print("Guard? Where?")
)
(if(Said('open/door'))
Print("You can't. It's tightly locked.")
)
(if(Said('look>'))
(if(Said('/door'))
(if(bigDoorOpen)
Print("It looks like a guard-room door. And the big door is opened too.")
return
)
Print("It looks like a guard-room door. And the big door...guess it's blocking your way to some importand area.")
)
(if(Said('/guard'))
(if(not(guardD))
Print("He looks dangerous. Better not get very close to him.")
return
)
Print("Huh? Where?")
)
(if(Said('/wall,floor,ceiling'))
Print("I don't see anything special about it.")
)
(if(Said('/'))
(if(not(guardD))
Print("You're at some hall with a big door. There's a guard at the door. The small door seems to lead to another room.")
return
)
Print("You're at some hall with a big door. The small door seems to lead to another room.")
)
)
 )
 (method(doit)
 (var dyingScript)
 (if(==(send gEgo: onControl()) ctlBLUE)
 (send gRoom: newRoom(15))
 )
 (if(==(send gEgo: onControl()) ctlRED)
 (if(not(guardD))
 (aGuard:loop(1) setCycle(End))
 Wait(20)
 Print("Hey, you! What are you doing here?"#title"Guard:")
 Print("Ummm..aaa...hmmm...dunno."#title"Dr Jummybummy:")
 Print("Then die!"#title"Guard:")
 = dyingScript ScriptID(DYING_SCRIPT)
  (send dyingScript:
    caller(3)
register("The guard shot you and killed you. Too bad...")
  )
  (send gGame:setScript(dyingScript))
 )
 return
 )
 )
 
(method (handleEvent pEvent)
(super:handleEvent(pEvent))



)
)
(instance aGuard of Act
(properties
view 650
x 168
y 90
))
(instance Door1 of Act
(properties
view 652
x 169
y 63
))
(instance Door2 of Act
(properties
view 653
x 169
y 62
))
/******************************************************************************/
