
/******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 57)
/******************************************************************************/
(use "controls")
(use "cycle")
(use "door")
(use "feature")
(use "game")
(use "inv")
(use "main")
(use "obj")
(local
one
part1
part2
)
/******************************************************************************/
(instance public rm043 of Rm
	(properties
		picture 57
		north 0
		east 0
		south 0
		west 43
	)
	(method (init)
		(super:init())
		(self:setScript(RoomScript))
        (switch(gPreviousRoomNumber)
    (case 43
(send gEgo:
posn(6 149)
loop(2)
)
)
    (case 52
(send gEgo:
posn(122 144)
loop(2)
)
)

(case 56
(send gEgo:
posn(245 150)
loop(2)
)
)

        )

		SetUpEgo()
		(send gEgo:init())
        (Camera: init())
        (aHatch: init())
        = info TRUE


        (if(holeOpen)
        (aHatch: cel(1) posn(241 121))
        )
	)
)
/******************************************************************************/
(instance RoomScript2 of Script
	(properties)

 )
(instance RoomScript of Script
	(properties)
  (method (handleEvent pEvent)
(super:handleEvent(pEvent))
(if(Said('close/hole,hatch,lid,vent,grate,grate,vent,hole,shaft,(vent,hole<shaft,entrance)'))
(if(lidOpen)
Print("You don't have to close it.")
return
)
Print("The grid IS closed.")
)
(if(Said('push/hole,hatch,lid,vent,grate,grate,vent,hole,shaft,(vent,hole<shaft,entrance)'))
(if(lidOpen)
Print("It's already against the wall. You can't push it any further.")
return
)
Print("This grid opens the other way.")
)
(if(Said('climb/fence'))
Print("You're too wuss .. er .. I mean busy to climb over this fence.")
)
(if(Said('open,remove,unscrew,turn/bolt,screw,pin/keycard,card') or (if(Said('use/keycard,card/bolt,screw,pin'))))
(if(send gEgo:has(INV_CARD))
Print("The keycard is too soft to open the bolts. You need something stronger.")
return
)
Print("Keycard who?")
)
(if(Said('open,remove,unscrew,turn/bolt,screw,pin/knife') or (if(Said('use/knife/bolt,screw,pin'))))
(if(==(send gEgo: onControl()) ctlRED)
(if(lidOpen)
Print("These are already opened.")
return
)
Print("Ok")
Print("You use your knife to open the bolts.")
Wait(75)
Print("All done!")
+= gScore 1
= lidOpen TRUE
return
)
Print("You're too far away from the grid.")
)

(if(Said('use/knife,toopen'))
Print("open")
)
(if(Said('open,remove,unscrew,turn/bolt,screw,pin'))
Print("You can't open the bolts with your fingers.")
)

(if(Said('open,remove,raise,pull/hole,hatch,lid,vent,grate,grate,vent,hole,shaft,(vent,hole<shaft,entrance)'))
(if(holeOpen)
Print("The grid is already opened, so you don't have to do it anymore.")
return
)
(if(not(lidOpen))
Print("You can't. The bolts are tightly sealed.")
return
)
(if(==(send gEgo: onControl()) ctlRED)
Print("Ok")
Print("You open up the grid.")
= holeOpen TRUE
+= gScore 2
(aHatch: cel(1) posn(241 121))
return
)
Print("You're too far away from the air-ventilation tunnel.")
)
(if(Said('(get<in),enter,(climb<in),climb,(crawl<in),crawl/vent,hole,shaft,lid,hatch,grate')or(if(Said('(get<in),crouch,(climb<in),(crawl<in)'))))
(if(==(send gEgo: onControl()) ctlRED)
(if(holeOpen)
Print("Ok")
(send gEgo: hide())
Print("After some crawling you reach...")
Wait(40)
(send gRoom: newRoom(56))
return
)
Print("And go trough the grid? I don't think so.")
return
)
Print("You're too far away from the air-ventilation tunnel.")
)
(if(Said('look>'))
(if(Said('/hatch,lid,vent,grate,vent,hole,shaft,(vent,hole<shaft,entrance)'))
(if(holeOpen)
Print("This is the air ventilation tunnel. It's dark in there. Where does it lead?")
return
)
Print("This is the air ventilation tunnel. The grid is blocking the way into the tunnel. It's sealed with four bolts.")
)
(if(Said('/building'))
Print("It's the cargo space port.")
)
(if(Said('/ground'))
Print("You don't see anything special about it.")
)
(if(Said('/in/hole,hatch,lid,vent,shaft'))
Print("It's dark in there.")
)
(if(Said('/wall'))
Print("There's a camera high on the wall. There sure are a lot of them around here.")
Print("In the lower part of the wall you can see a ventilation tunnel, blocked by a grid.")
)
(if(Said('/camera,(security<camera)'))
(if(send gEgo:has(INV_SIGNAL_DEVICE))
Print("It's filming everything that's going on against the wall.")
return
)
Print("It's filming everything what's going on at the door area. Don't get very close.")
)
(if(Said('/bolt,screw,pin'))
(if(holeOpen)
Print("They bolts are unsealed and the grid is open.")
return
)
Print("They are tightly sealed.")
)
(if(Said('/star'))
Print("These stars are not interesting at all to look at.")
)
(if(Said('/fence'))
Print("This fence prevents you from going to the other areas of the facility.")
)
(if(Said('/spaceport,(space,cargo<port),(cargo<(space<port))'))
Print("That's the building. You better try to get inside.")
)
(if(Said('/'))
Print("You're outside the cargo spaceport. There's a camera on the wall and a air-ventilation tunnel.")
)
)
)




 (method(doit)
    (var dyingScript)
(if(==(send gEgo: onControl())ctlYELLOW)
 (if(not(send gEgo: has(INV_SIGNAL_DEVICE)))
 (if(not(one))
 ProgramControl()
  = one TRUE
 Wait(60)
 (Guard: init() setCycle(Walk) setMotion(MoveTo (send gEgo: x) 180 RoomScript))
 )
 )
 )
 )
  (method (changeState newState)  (var dyingScript)
    = state newState
    (switch (state)
    (case 0
    = cycles 1
    )
    (case 1
= dyingScript ScriptID(DYING_SCRIPT)
  (send dyingScript:
    caller(3)
    register("The camera saw you and alerted the guard who arrested you. Try again!")
  )
  (send gGame:setScript(dyingScript))
 )
    )
    )
    )

 (instance aHatch of Prop
(properties
view 354
x 241
y 140
cel 0
))
(instance Camera of Prop
(properties
view 353
x 35
y 18
))
(instance Guard of Act
(properties
view 127
x 317
y 180
moveSpeed 1
cycleSpeed 1
)
)
/******************************************************************************/
