/******************************************************************************
 SCI Template Game
 By Brian Provinciano
 ******************************************************************************
 rm001.sc
 Contains the first room of your game.
 ******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 7)
/******************************************************************************/
(use "main")
(use "controls")
(use "cycle")
(use "game")
(use "feature")
(use "obj")
(use "inv")
(use "door")
(use "jump")
(use "dpath")
(local
sil
)
/******************************************************************************/
(instance public rm007 of Rm
	(properties
		picture 7
		// Set up the rooms to go to/come from here
		north 0
		east 0
		south 0
		west 0
	)
	(method (init)
		// same in every script, starts things up
  		(super:init())
  		(self:setScript(RoomScript))

  		// Check which room ego came from and position it
  		(switch(gPreviousRoomNumber)
            /******************************************************
             * Put the cases here for the rooms ego can come from *
             ******************************************************/ /*
            (case north
  				(send gEgo:
  					posn(210 110)
  					loop(2)
  				)
  			)*/
            // Set up ego's position if it hasn't come from any room

     (case 2
  				(send gEgo:
  					posn(28 87)
  					loop(2)
  				)
  			)


  		)

		// Set up the ego
		SetUpEgo()
		(send gEgo:init())
   (aTransmitter: init())
   (if(== gPreviousRoomNumber 1)
     Print("The Timegate is fully operational. Now go!")
     )
)
)

/******************************************************************************/
(instance RoomScript of Script
	(properties)

         (method(doit)
           (if(== (send gEgo:onControl()) ctlCYAN)
           = sil FALSE
           )
   (if(== (send gEgo:onControl()) ctlSILVER)
   (if(send gEgo:has(INV_WIRES))
   (if(flash)
   (if(send gEgo:has(INV_CALCULATOR))
   (if(send gEgo:has(INV_BATTERIES))
   )
   Print("Well...unknown place or time or galaxy or whatever, here I come!!")
      (send gRoom:newRoom(8))
      return
      )
      )
      )
            (if(sil)
      return
      )
      = sil TRUE
      Print("Make sure you have everything you need. Go and take a final look around.")
      (send gEgo: loop(2) setMotion(MoveTo Xposn 89))
       = sil TRUE
       return

        )

        return
        )
         (method (handleEvent pEvent)
        (super:handleEvent(pEvent))
         (if(Said('take,grab/wire'))
           (if(== (send gEgo:onControl()) ctlBLUE)
           (if(send gEgo:has(INV_WIRES))

         Print("You have already taken those wires.")
         return
         )
         Print("Ok")
          += gScore 2

           (send gEgo:get(INV_WIRES))
           return
           )
           Print("You can't reach them from here. Move closer to the wires between the Timegate and the computer.")
        )
         (if(Said('use/transmitter'))
       Print("You already used it.")

         )
          (if(Said('(turn<on),start,activate/timegate'))
          Print("It's already working.")
          )
           (if(Said('(turn<on),start,activate,use/computer'))
           (if(== (send gEgo:onControl()) ctlRED)
          Print("You don't need to do that.")
          return
          )
           Print("You're too far away from the computer.")
          )
          (if(Said('(turn<on),press,start,activate/machine,button,generator'))
            (if(== (send gEgo:onControl()) ctlYELLOW)

            Print("You don't have to do it.")
            return


           )
            Print("You're too far away from the generator start button.")
          )
         (if(Said('open/door'))
         (if(== (send gEgo:onControl()) ctlNAVY)
         (send gRoom: newRoom(2))

         return
         )
         Print("You're not close enough to the door.")
        )

        (if(Said('look>'))
            (if(Said('/transmitter'))
Print("This little thingy controls the time and space continuance, preventing mismatches. At least it should do all that.")
            )

            (if(Said('/button,(start<button)'))
            (if(>= (send gEgo: y) 140)
            Print("This is the generator start button.")
            return
            )
            Print("You can't see the button from this position.")
            )
            (if(Said('/generator,machine'))
            Print("This is one big and powerful generator. This started the Timegate.")
            )
            (if(Said('/door'))
            Print("The door is so strong that it can even stand a nuclear explosion...")
            Print("...when it's 300 miles away.")
            )
            (if(Said('/computer,console'))
            Print("This is your mainframe. It controls all the operations, calculations and stuff you need to travel in time. It uses Windows 98(c)")
            )
                         (if(Said('/card,id'))
            (if(postman)
             Print("New Yerk Post Office: \n\n Name: Mike Haley \n\n ID: 4587B2D" #icon 778 0 5)
            return
            )Print("You're losing it man. :P"))
            (if(Said('/timegate,gate'))
            Print("Your latest invention is operational. The transmitter is connected to the Timegate.")
            )
            (if(Said('/wall'))
            Print("The walls are green and they have been build higher recently.")
            )
            (if(Said('/ceiling'))
            Print("An old lamp is hanging from the ceiling. But not for long.")
            )
            (if(Said('/lamp,(old<lamp)'))
            Print("This is about to fall down.")
            )
            (if(Said('/stair,walkway'))
            Print("It's nothing special you know. Makes it easier to get near the Timegate.")
            )
            (if(Said('/screen,monitor,(computer<screen,monitor)'))
            (if(power)
            (if(connected)
            Print("\nTransmitter: ON\nGenerator: ON")
            return
            )
            Print("\nTransmitter: OFF\nGenerator: ON")
            return
            )
            Print("\nTransmitter: OFF\nGenerator: OFF")
            return
            )
            (if(Said('/floor'))
            Print("The floor is untidy and there are different parts laying all over the floor including some wires.")
            )
            (if(Said('/wires'))
            (if(send gEgo: has(INV_WIRES))
            Print("It's in your inventory. Press TAB to see it.")
            return
            )
            Print("There are lots of wires on the floor. Some of them are useless.")
            )
            (if(Said('/'))
            Print("You're in your lab. There's a big generator, computer and the Timegate. This lab has changed a lot during this year. Some wires laying on the floor. And it sure is lighty here!")

        )
         )
       )

     )

 (instance aTransmitter of Prop
(properties
view 359
x 136
y 58
))



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