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

		(switch(gPreviousRoomNumber)
			(case 46
				(send gEgo:
					posn(226 184)
					loop(3)
				)
	)
   (case 24
     (send gTheMusic:
			prevSignal(0)
			stop()
			number(606)
			loop(-1)
			play()
		)
				(send gEgo:
					posn(206 117)
					loop(2)
				)
			)
		)

		SetUpEgo()
		(send gEgo:init())
  
  
  (aShelf: init())// setCycle(End RoomScript)
  (aMan: init())
  (if(not(paperTaken))
  (aNewspaper: init())
  )
    (if(showed)
   (aShelf: hide())
   )
	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
 (method(doit)
 (if(==(send gEgo: onControl()) ctlYELLOW)
 (if(firstTime)
 (send gRoom: newRoom(24))
 return
 )
 (send gRoom: newRoom(602))
 )
 )
         (method (handleEvent pEvent)
   (super:handleEvent(pEvent))
   (if(Said('order/water'))
 Print("You're not thirsty.")
   )
     (if(Said('look>'))
(if(Said('/counter'))
Print("The bartender is standing behind it.")
)
(if(Said('/speaker'))
Print("Only one? The result - bad mono sound.")
)
(if(Said('/menu'))
Print("Glass of water -      656\n\nGlass of salted water - 10")
)
(if(Said('/man,bartender'))
Print("He doesn't look interesting. Better talk to him instead of looking.")
)
(if(Said('/bottle'))
Print("These bottles look empty.")
)
(if(Said('/floor'))
Print("Do you think there's anything special on the floor that you can't see, and think I'm going to tell you about it.")
Print("There isn't.")
)
(if(Said('/paper,magazine,(free<paper,magazine)'))
Print("The Window\n\n\n\HOT: New alien detection devices in development. Read more on page 1a6g.")
)
(if(Said('/doorway'))
 (if(showed)
 Print("It leads into the Rebel's hideout.")
 return
 )
Print("That's the way you came in.")
)
(if(Said('/shelf'))
Print("Some bottles. But overall it's empty.")
)
(if(Said('/board,(wood<board),rack'))
(if(paperTaken)
Print("It's empty.")
return
)
Print("A magazine is on this board.")
)
(if(Said('/'))
Print("You're inside the Rebel Bar. The bartender is behind the counter. There's also quite an empty shelf with a menu next to it.")
Print("A wooden rack is along the wall.")
        )
        )
   
   (if(Said('take/paper,magazine,(free<paper,magazine)'))
   (if(==(send gEgo: onControl()) ctlNAVY)
     (if(not(paperTaken))
     Print("You take the free magazine.")
     += gScore 1
     = paperTaken TRUE
       (aNewspaper: dispose())
     (send gEgo: get(INV_NEWSPAPER))
     return
     )
     Print("There's no magazine to take.")
   )
   Print("You have to move closer.")
   )
   (if(Said('give,show/knife'))
   (if(==(send gEgo: onControl()) ctlRED)
   (if(talkBar)
   (if(showed)
   Print("You already showed it to him.")
   return
   )
   = showed TRUE
   Print("Take a look at this knife. Is this proof enough?"#title "Dr.Jummybummy:" #icon 777 0 0)
   Print("Hey man, you may see them...that's the saint Rebels knife. Where did you get it?" #title"Man:" #icon 777 0 7)
   Print("Sonny gave it to me. He's in prison." #title "Dr.Jummybummy:" #icon 777 0 0)
   Print("I'll send some guys later on to get him out." #title"Man:" #icon 777 0 7)
   Print("Ok." #title "Dr.Jummybummy:" #icon 777 0 0)
   Print("Ok, just walk through the doorway to get to the Rebels hideout." #title"Man:" #icon 777 0 7)
   (aShelf: setCycle(End RoomScript))
   += gScore 4
   return
   )
   Print("And why should I do that?")
   return
      )
   Print("You're too far away from the man.")
   )
 (if(Said('give,show>'))
 (if(Said('/you'))
 Print("You want to give yourself to him? Huh?")
 )
 (if(Said('/diamond'))
 Print("I'd like to accept it, but I'm married already." #title"Man:")
 )
 (if(Said('/spacesuit'))
 Print("Can't you see I'm wearing it?" #title"Dr.Jummybummy:" #icon 777 0 0)
 )
  (if(Said('/paper,magazine,(free<paper,magazine)'))
 Print("No thanks! I already read it." #title"Man:" #icon 777 0 7)
 )
 (if(Said('/'))
Print("He wouldn't be interested in it.")
 )
   )
   (if(Said('talk/man,bartender'))
   (if(==(send gEgo: onControl()) ctlRED)
   (if(talkBar)
   Print("Can I see the rebels now?" #title"Dr.Jummybummy:" #icon 777 0 0)
   Print("You haven't shown me any proof." #title"Man:" #icon 777 0 7)
    return
   )
   (if(talkedGuy2)
   Print("Are the Rebels here?" #title"Dr.Jummybummy:" #icon 777 0 0)
   Print("Depends..." #title"Man:" #icon 777 0 7)
   Print("On what?" #title"Dr.Jummybummy:" #icon 777 0 0)
   Print("Proof, to show that you really want to see them." #title"Man:" #icon 777 0 7)
   Print("Ok" #title"Dr.Jummybummy:" #icon 777 0 0)
   += gScore 3
   = talkBar TRUE
   return
   )
   Print("Hi!"  #title"Dr.Jummybummy:" #icon 777 0 0)
   Print("Can I help ya?" #title"Man:" #icon 777 0 7)
   Print("Ummm...no..." #title"Dr.Jummybummy:" #icon 777 0 0)
   return
   )
   Print("You're too far away from the man.")
   )
   )
   (method (changeState newState)
  = state newState
  (switch (state)
    (case 1
= cycles 1
(aShelf: hide())
)
)
)
)

(instance aShelf of Act
(properties
view 68
x 207
y 117
cel 0
cycleSpeed 8
)
)
(instance aMan of Act
(properties
view 69
x 132
y 122
cel 0
)
)
(instance aNewspaper of Act
(properties
view 358
x 255
y 138
)
)
/******************************************************************************/
