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

		(switch(gPreviousRoomNumber)
			(case 47
            (send gTheMusic:
			prevSignal(0)
			stop()
			number(602) //2
			loop(-1)
			play()
		)
				(send gEgo:
					posn(135 67)
					loop(2)
				)
    )
             (default
				(send gEgo:
					posn(234 103)
					loop(1)
				))
		)

		SetUpEgo()
		(send gEgo:init())
  (aFlag: init())
  (aMan1: init() cel(1))
  (aMan2: init())
  (aMan3: init() cel(2))




	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
 	(method (handleEvent pEvent)
        (super:handleEvent(pEvent))
        (if(Said('take>'))
        (if(Said('/flag'))
        Print("\"We don't need no stinkin' flags!\"")
        )
        (if(Said('/map'))
        Print("What would you do with the map?")
        )

        )
        (if(Said('give>'))
        (if(Said('/knife'))
Print("Here take this knife. I think this belongs to you. Sonny gave it to me." #title "Dr.Jummybummy:" #icon 777 0 0)
Print("Keep it. If Sonny gave it to you, then it's a sign of trust." #title"Leader of the Rebels:" #icon 777 0 6)
        )
        (if(Said('/'))
        = rand3 Random(4)
        (if(== rand3 1)Print("They wouldn't be interested in it."))
        (if(== rand3 2)Print("What would they do with it?"))
        (if(== rand3 3)Print("You'd rather keep it."))
        (if(== rand3 4)Print("Don't give that away. You might need it later."))
        )
        )
          (if(Said('read/map'))
          (if(==(send gEgo: onControl()) ctlNAVY)
       Print("You can't understand more about the map than it shows the local area.")
          return
          )
       Print("The map is too far away from you.")
          )
        (if(Said('open/closet'))
        Print("Better not. It would only upset the rebels. They probably keep all their Top-Secret stuff in that closet.")
        Print("...Nah!")
        )
        (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)'))))
        (if(==(send gEgo: onControl()) ctlYELLOW)
        (if(talkRebel)
        (if(not(send gEgo: has(INV_RADIO)))
        Print("You still have to go and get the radio.")
        return
        )
        Print("Ok")
        += gScore 1
        (send gRoom: newRoom(49))
        return
        )
        Print("First talk to the rebels.")
        return
        )
        Print("You're too far away from the tunnel.")
        )
        (if(Said('talk/man,rebel,chief,(rebel<chief)'))
        (if(< (send gEgo:distanceTo(aMan1)) 45)
        Print("You don't have to talk to the rebels again.")
        return
        )
        Print("You're too far away from the alien at the table.")
        )


      (if(Said('look>'))
(if(Said('/table'))
Print("There's a map on the table.")
)
(if(Said('/map'))
(if(==(send gEgo: onControl()) ctlNAVY)
Print("This is the map of the Moon Base moon.")
return
)
Print("The map is too far away from you.")
)
(if(Said('/closet'))
Print("The closet doesn't seem to be interesting.")
)
(if(Said('/stair'))
Print("Without it, the door would be too high from the floor.")
)
(if(Said('/handrail'))
Print("This prevents you from falling down from the horribly high stairs.")
)
(if(Said('/cloth,logo,sign,flag'))
Print("This is the rebels flag.")
)
(if(Said('/wall'))
Print("There's a flag on the wall.")
)
(if(Said('/brick'))
Print("The stair is built of these.")
)
(if(Said('/door'))
Print("It leads back to the bar.")
)
(if(Said('/man,rebel'))
Print("These guys are the Rebels. They fight for the rights of regular people.")
)
(if(Said('/vent,hole,lid,hatch,grate'))
Print("It sure is small.")
)
(if(Said('/'))
Print("You're at the rebels hideout. There are three Rebels. There's also a table, stairs and a closet.")
))
)
 (method(doit)
 (if(==(send gEgo: onControl()) ctlRED)
 (send gRoom: newRoom(47))
 )
 )
)
(instance aFlag of Prop
(properties
view 24
x 200
y 40
))
(instance aMan1 of Prop
(properties
view 75
x 76
y 101
))
(instance aMan2 of Prop
(properties
view 76
x 30
y 124
cel 0
))
(instance aMan3 of Prop
(properties
view 76
x 140
y 106
cel 1
))
 (instance aE of Act
 (properties
 view 300
 x 1
 y 1
 ))

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