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

   (case 125
				(send gEgo:
					posn(4 184)
					loop(0)
				)
    = power TRUE
			)

(case 97
				(send gEgo:
					posn(154 148)
					loop(2)
				)
			)
   (case 160
   PlayerControl()
				(send gEgo:
					posn(154 148)
					loop(2)
				)
			)
   (case 96
   (if(== colorN 0)
				(send gEgo:
					posn(306 174)
					loop(1)
				)
			)
   (if(== colorN 1)
   (send gEgo:
					posn(70 107)
					loop(2))
   )
   )
		)

		SetUpEgo()
		(send gEgo:init())
  (if(not(vari1))
  (if(repaired)
  = vari1 TRUE
  = lineIs TRUE
  )
  )
  (if(== gPreviousRoomNumber 125 and (if(not(seenText))))
      (send gTheMusic:
			prevSignal(0)
			stop()
			number(5) //2
			loop(-1)
			play()
		)
  = seenText TRUE
  += gScore 1
  Print("Looks like you''ve reached some kind of bar. Go inside. Maybe you can find out something about Lord Bather and other stuff.")

  )
	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
      (method (handleEvent pEvent)
(super:handleEvent(pEvent))
(if(Said('take,pull/grass'))
Print("You would hurt your hands if you'd try to pull the grass.")
)
(if(Said('cut/grass/knife') or (if(Said('use/knife/grass'))))
(if(not(power))
Print("You already cut the grass. You don't need more.")
return
)
(if(==(send gEgo: onControl()) ctlCYAN)
(send gEgo: get(INV_GRASS))
Print("You cut yourself a handful of grass.")
+= gScore 1
= power FALSE
return
)
Print("You have to get closer to the grass to cut it.")
)
(if(Said('cut/grass') or (if(Said('use/knife'))))
Print("With what, I ask.")
)
(if(Said('close/door'))
Print("If you'd have to close the door, you would. But you don't.")
)
(if(Said('open/door'))
Print("You blindass! The door of the bar is already opened.")
)
 (if(Said('look>'))
 (if(Said('/bar,building'))
Print("It's a small bar for the local alien bums. A bit of grass is growing on the left side of the bar.")
)
(if(Said('/sky'))
Print("You look up in the sky, and see some clouds pass by.")
)
(if(Said('/grass'))
Print("This grass looks very dry. I bet it would burn well.")
)
(if(Said('/table'))
Print("You don't see anything special about that table inside the bar.")
)
(if(Said('/stool'))
Print("It's some regular stool under the table.")
)
(if(Said('/sand'))
Print("Just like everywhere else. A bit of grass is growing on it on the left side of the bar.")
)
(if(Said('/window'))
Print("You can see some tables and stools through the window.")
)
(if(Said('/sign,(big<sign)'))
Print("It says: 'BAR'. Was that the Formula 1 team?")
)
(if(Said('/door'))
Print("It's a glass door and it's wide open.")
)
(if(Said('/'))
Print("You're outside some bar. A big sign is on the roof. You can walk right in, since the door is opened.")
        )
        )
        
        )
 
 (method(doit)
 (if(==(send gEgo: onControl()) ctlRED)
 = colorN 0
 (send gRoom: newRoom(96))
 )
  (if(==(send gEgo: onControl()) ctlNAVY)
  (if(not(bartender))
  (send gRoom: newRoom(160))
  return
  )
 (send gRoom: newRoom(97))
 )
  (if(==(send gEgo: onControl()) ctlYELLOW)
  = colorN 1
  (send gRoom: newRoom(96))
 )
 )
)
/******************************************************************************/
