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

		(switch(gPreviousRoomNumber)
			(case 36
				(send gEgo:
					posn(4 137)
					loop(0)
				)
    
			)
   (case 976
				(send gEgo:
					posn(4 137)
					loop(0)
				)
			)
   (case 45
				(send gEgo:
					posn(315 100)
					loop(1)
				)
			)
      (case 47
				(send gEgo:
					posn(285 154)
					loop(1)
				)
			)
      (case 48
				(send gEgo:
					posn(145 180)
					loop(3)
				)
			)
		)

		SetUpEgo()
		(send gEgo:init())
  (aGuy: init())
  (if(paperGiven)
  (aGuy: cel(1))
  )
  (if(not(send gEgo: has(INV_BOARD)))
  (aBoard: init())
  )

 ))
/******************************************************************************/
(instance RoomScript of Script
	(properties)
   (method (handleEvent pEvent)
   (super:handleEvent(pEvent))
   (if(Said('take/board,(wooden<board),wood'))
   (if(< (send gEgo:distanceTo(aGuy)) 40)
   (if(send gEgo: has(INV_BOARD))
   Print("You've already taken the wooden board.")
   return
   )
   (if(paperGiven)
Print("You pick up the board.")
(send gEgo: get(INV_BOARD))
+ gScore 3
(aBoard: dispose())
   return
   )
Print("Hey! Do you think I'm blind and don't see that you're trying to steal my board?" #title"Sitting dude:" #icon 777 0 8)
Print("No, not at all." #title"Dr.Jummybummy:" #icon 777 0 0)
Print("(Hmm... I need to distract him somehow.)" #title"Dr.Jummybummy:" #icon 777 0 0)
   return
   )
   Print("If you want to take the wooden board, move closer.")
   
   )
   (if(Said('give>'))
   (if(Said('/paper,magazine,(free<paper,magazine)'))
   (if(not(paperGiven))
   (if(< (send gEgo:distanceTo(aGuy)) 40)
  (if(not(send gEgo: has(INV_NEWSPAPER)))
  Print("You don't have the magazine.")
  return
  )
Print("Here, take this magazine." #title"Dr.Jummybummy:" #icon 777 0 0)
Print("Thanks! I was just looking for something to read." #title"Sitting dude:" #icon 777 0 8)
= paperGiven TRUE
+= gScore 1
(send gEgo: put(INV_NEWSPAPER))
 (aGuy: cel(1))
return
   )
   Print("Move closer to him.")
   return
   )
   Print("You already gave him the newspaper.")
   )
    (if(Said('/'))
    Print("I don't think he would be interested in it.")
   )
   )
(if(Said('look>'))
           (if(Said('/man,alien'))
           (if(paperGiven)
          Print("He's sitting on the bench and reading his magazine.")
           return
           )
            Print("He's sitting on the bench looking like he has nothing to do.")
            )
             (if(Said('/door'))
            Print("Nothing special with them.")
            )
             (if(Said('/board,(wooden,piece<board,wood),(piece<wood),wood,pole'))
            Print("This must belong to the alien sitting on the bench.")
            )
             (if(Said('/leaves'))
            Print("These palm-tree like leaves don't look interesting.")
            )
             (if(Said('/sand'))
            Print("1 grain of sand, 2 grains of sand, 3 ... Never mind!")
            )
            (if(Said('/tree'))
            Print("This tree sure is tall.")
             )
             (if(Said('/wall'))
            Print("This wall goes around the whole city.")
            )
            (if(Said('/bench'))
            Print("An alien is sitting on it.")
            (if(not(send gEgo: has(INV_BOARD)))
            Print("A wooden board is placed against the bench.")
            )
                )
            (if(Said('/house'))
            Print("They look like regular private houses.")

            )
            (if(Said('/'))
            Print("You're in some town. At least the outside part of it. There's an alien sitting on the bench.")
        )
        )
   (if(Said('open/door'))
   Print("\"I don't think so Tim!\"" #title "Al from Home Improvement" #icon 778 0 6)
   )
   (if(Said('talk/man,alien,salesman'))
   (if(< (send gEgo:distanceTo(aGuy)) 40)
   (if(talkedGuy2)
   Print("You already talked to him.")
   (if(paperGiven)
 Print("Thanks again for the newspaper. It's really interesting." #title"Sitting dude:" #icon 777 0 8)
 return
   )
   return
   )(if(guardT)
 = talkedGuy2 TRUE
Print("Hi again! Do you happen to know a way to the town other than the main gate?" #title"Dr.Jummybummy:" #icon 777 0 0)
Print("I don't know, but maybe the Rebels can help you. They have secret passages to everywhere." #title"Sitting dude:" #icon 777 0 8 #icon 777 0 8)
Print("Where could I find the Rebels?" #title"Dr.Jummybummy:" #icon 777 0 0)
Print("Rumors say that they are down at the Rebel bar." #title"Sitting dude:" #icon 777 0 8)
Print("(That's logical.) Ok, thanks!" #title"Dr.Jummybummy:" #icon 777 0 0)
+= gScore 2
return
)
(if(tt)Print("He has nothing else to say at the moment. You'd better go and check out the main gate.")
return
)
= tt TRUE
Print("Hi!" #title"Dr.Jummybummy:" #icon 777 0 0)Print("Hello!" #title"Sitting dude:" #icon 777 0 8)
Print("What's this place?" #title"Dr.Jummybummy:" #icon 777 0 0)
Print("The Moon Base City." #title"Sitting dude:" #icon 777 0 8)
Print("What's behind the high wall?" #title"Dr.Jummybummy:" #icon 777 0 0)
Print("The real town. Shops, markets, flats and stuff like that." #title"Sitting dude:" #icon 777 0 8)
Print("Can I go there?" #title"Dr.Jummybummy:" #icon 777 0 0)
Print("You could try the main gate." #title"Sitting dude:" #icon 777 0 8)
Print("Ok thanks!" #title"Dr.Jummybummy:" #icon 777 0 0)
return)Print("You're not close enough to the man.")
   ))
   (method(doit)
   (if(==(send gEgo: onControl()) ctlBLACK)
   = on FALSE
   )
(if(==(send gEgo: onControl()) ctlCYAN)
 (if(not(on))
 = on TRUE
 Print("It's not nice to invade other aliens privacy...")
 ))))
(instance aGuy of Act
(properties
view 67
x 250
y 76
cel 0
))
(instance aBoard of Act
(properties
view 67
x 260
y 79
cel 2
))
/******************************************************************************/
