/******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 49)
/******************************************************************************/
(use "controls")
(use "cycle")
(use "door")
(use "feature")
(use "game")
(use "inv")
(use "main")
(use "obj")
(local
butt
savedGame_2 = FALSE
)
/******************************************************************************/
(instance public rm049 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(238 91)
					loop(1)
				)
			)
		)
        = savedGame2 FALSE
		SetUpEgo()
		(send gEgo:init())
      Print("You climb out of the tunnel. And voila, you're on the other side of the wall.")
	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
 (method (handleEvent pEvent)
(super:handleEvent(pEvent))
   (if(Said('(get<in),enter,crouch,(climb<in),climb,(crawl<in),crawl/vent,hole,lid,hatch')or(if(Said('(get<in),crouch,(climb<in),(crawl<in)'))))
Print("You just got here. There is no point of going back.")
)

(if(Said('look>'))
(if(Said('/ladder'))
Print("This helped you climb up from the hole.")
)
(if(Said('/wall'))
Print("They are all around you.")
)
(if(Said('/ground'))
Print("Lots of trash everywhere.")
)
(if(Said('/door,(garage<door),window'))
Print("It doesn't look interesting at all.")
)
(if(Said('/trash,garbage'))
Print("Yuck!")
)
(if(Said('/hole,grate,hatch,lid,tunnel'))
Print("It leads back to the Rebels hideout.")
)
(if(Said('/[ /* , !* ]'))
Print("You're between some buildings. On the ground you can see the hole where you came from.")
)
)

)


  (method(changeState newState)
 = state newState
 (switch(state)
 (case 1
 = cycles 1
 (aGuard: loop(4))
(aGuard: init() setCycle(Walk) setMotion(MoveTo 233 149 RoomScript))
 )
 (case 2
 (aGuard2: init() setCycle(Walk) setMotion(MoveTo 113 138 RoomScript))
 )
 (case 3
 (aGuard2: loop(5))
 (aE: init() setMotion(MoveTo 40 1 RoomScript))
 )
 (case 4
 Print("Hey you! Stop! Come here!" #title "Guard:" #icon 778 0 3)
 Print("Who? Me?" #title "Dr.Jummybummy:" #icon 777 0 0)
 Print("Yeah you, you're coming with me!" #title "Guard:" #icon 778 0 3)
 (send gEgo: setMotion(MoveTo 319 149 RoomScript))
 (aGuard: init() setCycle(Walk) setMotion(MoveTo 319 155 RoomScript))
 = butt Print("I recommend to save your game now. Do you want to do it?" #title "Save?" #button "Yes" 0 #button "No" 1)
 (if(== butt 0)
(send gGame:save())
 )

 )
 (case 5
 (aGuard: hide())
  )
 (case 6
 (send gEgo: hide())

 Print("The guard takes you to some lab and ties you to a table. This can't be good...")
)
)
)


 (method(doit)
 (if(==(send gEgo: onControl())ctlRED)
 (if(not(onRed))
= onRed TRUE
  ProgramControl()
  (send gEgo: loop(2))
   (aGuard2: init() setCycle(Walk) setMotion(MoveTo 113 138 RoomScript))

)
)
 )
)
(instance aGuard of Act
(properties
view 128
x 319
y 155
))
(instance aGuard2 of Act
(properties
view 128
x 19
y 188
))
 (instance aE of Act
 (properties
 view 300
 x 1
 y 1
 ))
/******************************************************************************/
