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

		(switch(gPreviousRoomNumber)
			(default
				(send gEgo:
					posn(150 180)
					loop(3)
				)
			)
		)
             (send gTheMusic:
			prevSignal(0)
			stop()
			number(10) //10
			loop(-1)
			play()
		)
     		SetUpEgo()
  = sit FALSE
		(send gEgo:init())
  (adrum: init() setCycle(Fwd))
  (aguitar: init() setCycle(Fwd))
  (aMan: init())
  ProgramControl()

   (if(send gEgo: has(INV_COURSE_KEY))
         Print("Now there's NOTHING to do here anymore.")
         (send gRoom: newRoom(40))
         return
        )
Print("You decide to go and talk to the man.")
(send gEgo: setMotion(MoveTo 154 134 RoomScript))

	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
     (method(changeState newState)
     = state newState
     (switch(state)

     (case 1
       (send gEgo: setMotion(MoveTo 103 134 RoomScript))
       )
       (case 2
        (if(entered)
        (if(enteredTalk)
        (if(roofOpen)
        Print("Ok, I'm back. What is it?" #title "Dr.Jummybummy:" #icon 777 0 0)
        Print("Here, take this course-key. After you take off with the rocket, its course is set to the Black Hole. You need to insert this key to activate the right course."#title "Man:" #icon 777 0 4)
        Print("I would've left without it. Thanks man! Thanks for everything!" #title "Dr.Jummybummy:" #icon 777 0 0)
        Print("And good bye! Hope to see you again." #title "Dr.Jummybummy:" #icon 777 0 0)
        Print("Bye. Don't get killed out there."#title "Man:" #icon 777 0 4)
        += gScore 2
        (send gEgo: get(INV_COURSE_KEY))
           (send gEgo: setMotion(MoveTo 154 134 RoomScript))
        return
        )
        Print("You just spoke to him.")
             (send gEgo: setMotion(MoveTo 154 134 RoomScript))
        return
        )
        = localCode randomCode
        Print("Hi again! I could use your help again. Do you happen to know the authorization code at the monitor room in the space port?" #title "Dr.Jummybummy:" #icon 777 0 0)
        FormatPrint("Yes, of course! The code is %d." localCode)
        Print("Big thanks man! I owe you one." #title "Dr.Jummybummy:" #icon 777 0 0)
        Print("And don't forget to come back here when you're ready to fly the rocket."#title "Man:" #icon 777 0 4)
        Print("You got it!" #title "Dr.Jummybummy:" #icon 777 0 0)
        = enteredTalk TRUE
        += gScore 2
               (send gEgo: setMotion(MoveTo 154 134 RoomScript))
        return
        )
        (if(tManClub)
         Print("Thank you very much for your help!" #title "Dr.Jummybummy:" #icon 777 0 0)
         Print("You're welcome." #title "Man:" #icon 777 0 4)
                (send gEgo: setMotion(MoveTo 154 134 RoomScript))
         return
         )
         (if(info)
         Print("Hello!" #title "Dr.Jummybummy:" #icon 777 0 0)
         Print("Hi. Can I help you with something?" #title "Man:" #icon 777 0 4)
         Print("Yes, do you happen to know anything about the building with the fence around it." #title "Dr.Jummybummy:" #icon 777 0 0)
         Print("It's the cargo space port. It delivers cargo to the space shuttels." #title "Man:" #icon 777 0 4)
         Print("Can I get in there somehow? I can't really tell you why but I hope you can help." #title "Dr.Jummybummy:" #icon 777 0 0)
         Print("Of course, I was just laid off my job there. The first thing you probably noticed was the camera. Every worker around there has a special signal device in his pocket, so the camera can detect it." #title "Man:" #icon 777 0 4)
         Print("You need one too to get pass it." #title "Man:" #icon 777 0 4)
         Print("But you worked there, you should have one." #title "Dr.Jummybummy:" #icon 777 0 0)
         Print("Yes, I have it right here. Maybe we can make an exchange." #title "Man:" #icon 777 0 4)
         Print("I have this calculator, which is very modern and high-tech." #title "Dr.Jummybummy:" #icon 777 0 0)
         Print("Ok, I've been searching for that model for my antique collection." #title "Man:" #icon 777 0 4)
         Print("I'll give you this and you give me the signal device." #title "Dr.Jummybummy:" #icon 777 0 0)
         Print("We have a deal. Here's your signal device." #title "Man:" #icon 777 0 4)
         Print("And here's your calculator. Thanks!" #title "Dr.Jummybummy:" #icon 777 0 0)
         Wait(20)
         Print("By the way, why are there no women around?" #title "Dr.Jummybummy:" #icon 777 0 0)
         Print("Don't you know? Lord Bather has kidnapped them. He's using them in his labs as test rats." #title "Man:" #icon 777 0 4)
         Print("Horrible! I've got to stop that!" #title "Dr.Jummybummy:" #icon 777 0 0)
         Print("I wish you luck!" #title "Man:" #icon 777 0 4)
         Print("Thanks! Got to run now." #title "Dr.Jummybummy:" #icon 777 0 0)

         (send gEgo: get(INV_SIGNAL_DEVICE))
         += gScore 4
         = bayDoor FALSE
         = tManClub TRUE
         (send gEgo: put(INV_CALCULATOR))
                  (send gEgo: setMotion(MoveTo 154 134 RoomScript))
          return
         )
         Print("Hello!" #title "Dr.Jummybummy:" #icon 777 0 0)
         Print("Hi!" #title "Man:" #icon 777 0 4)
         Print("What are you doing here?" #title "Dr.Jummybummy:" #icon 777 0 0)
         Print("Trying to get a good seat for the show tommorow." #title "Man:" #icon 777 0 4)
         Print("Oh, ok." #title "Dr.Jummybummy:" #icon 777 0 0)
                (send gEgo: setMotion(MoveTo 154 134 RoomScript))
         return
        )
        (case 3
          (send gEgo: setMotion(MoveTo 159 145 RoomScript))
          )
          (case 4
        Print("You decide to leave.")
        (if(send gEgo: has(INV_COURSE_KEY))
        Print("You drive straight back to the cargo port...")
        (send gRoom: newRoom(17))
        return
        )
        (send gRoom: newRoom(40))
        ))



)
)

(instance adrum of Act
(properties
view 26
x 72  //72
y 64  // 64
loop 0
))
(instance aguitar of Act
(properties
view 26
x 151  //72
y 62  // 64
loop 1
cycleSpeed 2
))
(instance aMan of Act
(properties
view 37
x 70
y 158
))
(instance aSit of Act
(properties
view 38
x 104
y 157
))


