/******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 137)
/******************************************************************************/
(use "controls")
(use "cycle")
(use "feature")
(use "game")
(use "inv")
(use "main")
(use "obj")
(local
breaked
cy
mov
canCel = 0
)
/******************************************************************************/
(instance public rm137 of Rm
	(properties
		picture scriptNumber
	)
	(method (init)
		(super:init())

       //= gPreviousRoomNumber 140
                  (aWindow: init())
       (aBarrel: init())
		(switch(gPreviousRoomNumber)
   			(case 148
        (send gEgo: dispose())
= onBarrel TRUE
= canCel 3
(onBarrel2: ignoreControl(ctlWHITE) init())
 (aWindow: cel(1))
= windowOpen TRUE
(aBarrel: init() posn(23 93))
= pushed TRUE
= breaked TRUE
  (car2: init())
DrawPic(149)
			)
)
 (self:setScript(RoomScript))


))
/******************************************************************************/
(instance RoomScript of Script
	(properties)
(method (handleEvent pEvent)
(super:handleEvent(pEvent))
(if(Said('break,hit,use/axe,barrel,can,(water,fuel<can,barrel)'))
(if(breaked)
Print("You've already broke the water out. (That kinda sounds like something else ... ;) )")
return
)
(if(not(==(send gEgo: onControl()) ctlYELLOW) )
Print("You're too far away from the can.")
return
)
Print("After two hits with your axe, the water starts running out.")
= breaked TRUE
+= gScore 1
= canCel 3
(aBarrel: cel(canCel))
DrawPic(149)
)
              (if(Said('look>'))
(if(Said('/window'))
Print("This window seems like it's open.")
)
(if(Said('/door'))
Print("There are two doors visible. One is the door of the gas station, another one is a car door.")
)
(if(Said('/roof,grass,ground,sky'))
Print("It's not that interesting.")
)
(if(Said('/barrel,can'))
Print("It seems to be a water barrel.")
)
(if(Said('/car'))
(if(not(gasTanked))
Print("This the car you \"borrowed\". It's out of gas and goes nowhere at the moment.")
return
)
Print("Your car is tanked and ready to roll!")
)
(if(Said('/'))
Print("Here you are, in the middle of knownplace. This gas station right here, seems to be closed.")
Print("A barrel is next to the wall. There's also a small window on the side of the gas station.")
        )
        )

(if(Said('fill,fuel,use,pour/gas,tank,can,car,(gas<can)'))
(if(gasTanked)
Print("The gas-tank is already filled.")
return
)
(if(==(send gEgo: onControl()) ctlCYAN)
(if(send gEgo: has(INV_GAS))
+= gScore 2
Print("You fill the gas tank.")
= gasTanked TRUE
return
)
Print("You don't have any fuel.")
return
)
Print("You're not close enough to your car.")
)

(if(Said('close>'))
(if(Said('/window'))
(if(onBarrel)
(if(windowOpen)
Print("Ok")
= windowOpen FALSE
(aWindow: cel(0))
return
)
Print("It's already closed.")
return
)
Print("You can't reach the window to close it.")
)
)
(if(Said('open>'))
(if(Said('/window'))
(if(onBarrel)
(if(windowOpen)
Print("It is already opened.")
return
)
Print("OK")
(aWindow: cel(1))
= windowOpen TRUE
return
)
Print("You can't reach the window to open it. You need to be higher.")
return
)
(if(Said('/door,(car<door)'))
(if(==(send gEgo: onControl()) ctlNAVY)
Print("This door is locked. And since it's a gas-station door, it stays locked.")
Print("If you want to get inside, find another way.")
return
)
(if(==(send gEgo: onControl()) ctlCYAN)
(if(gasTanked)
Print("You enter the car.")
(send gRoom: newRoom(141))
return
)
Print("This car goes nowhere. It's out of fuel.")
return
)

Print("You're too far away from any of the door. Move closer to either the car door or gas-station door.")
)
)
(if(Said('use,jump,(go,climb,get<in,up,on,off,down,trough),climb,enter>'))
(if(Said('/barrel,can,(water<barrel,can)'))
(if(pushed)
(if(not(onBarrel))
Print("You climb on the barrel.")
(send gEgo: dispose())
= onBarrel TRUE
(onBarrel2: ignoreControl(ctlWHITE) init())
return
)
Print("You climb down the barrel.")
(send gEgo: posn(31 100) init())
(onBarrel2: dispose())
= onBarrel FALSE
return
)
Print("Currently, there's no point for climbing the barrel.")


)
(if(Said('/window'))
(if(onBarrel)
(if(windowOpen)
Print("You climb trough the back window of the gas-station...")
(send gRoom: newRoom(148))
return
)
Print("You can't go trough a closed window.")
return
)
Print("You don't reach the window to climb trough it.")
)
(if(Said('/(gas,station),house,building'))
(if(onBarrel)
(if(windowOpen)
Print("You climb trough the back window of the gas-station...")
(send gRoom: newRoom(148))
return
)
Print("You can't go trough a closed window.")
return
)
Print("You don't reach the window to climb trough it.")
)
(if(Said('/car'))
(if(gasTanked)
(if(==(send gEgo: onControl()) ctlCYAN)
Print("You enter the car.")
(send gRoom: newRoom(141))
return
)
Print("You're too far away form the door of the car to enter.")
return
)
Print("This car goes nowhere. It's out of gas.")
)
(if(Said('/'))
Print("What do you want to climb?")
)
)

(if(Said('pull>'))
(if(Said('/window'))
(if(onBarrel)
(if(windowOpen)
Print("Ok")
= windowOpen FALSE
(aWindow: cel(0))
return
)
Print("It's already closed.")
return
)
Print("You can't reach the window to close it.")
)
(if(Said('/barrel,can,(water<can,barrel)'))
Print("Better try pushing it.")
)
(if(Said('/'))
Print("What do you want to pull.")
)
)
(if(Said('push>'))
(if(Said('/barrel,can,(water<can,barrel)'))
(if(pushed)
Print("You've already pushed it.")
return
)
(if(not(breaked))
Print("You try to push the can one way; the other way. Nothing! It's too heavy.")
Print("You have to get it to weigh less.")
return
)
Print("You start pushing the barrel near the window.")
Print("But you know... you're not some gym-worked-out-muscle-dude, so it takes a while.")
(aBarrel: moveSpeed(3) setMotion(MoveTo 23 93))
= cy (send gEgo: cycleSpeed)
= mov (send gEgo: moveSpeed)
(send gEgo: moveSpeed(3) cycleSpeed(3) setMotion(MoveTo 35 99))
+= gScore 2
= pushed TRUE
 )
(if(Said('/window'))
(if(onBarrel)
(if(windowOpen)
Print("It is already opened.")
return
)
Print("OK")
(aWindow: cel(1))
= windowOpen TRUE
return
)
Print("You can't reach the window to open it. You need to be higher.")
return
)
(if(Said('/car'))
Print("Why would you push your car?")
)
(if(Said('/'))
Print("What do you want to push?")
)
)
)
 (method(doit)
   (super: doit())
(if(== savedGame2 77)
(if(breaked)
= savedGame2 76
DrawPic(149)
)
)
     (if(breaked)
     (if(not(== gPreviousRoomNumber 148))
     (send gEgo: moveSpeed(mov) cycleSpeed(cy))
     )
     )
     )
 (method(changeState newState)
 = state newState
 (switch(state)
 (case 0
 (car2: init() cel(0))
 (if(== gPreviousRoomNumber 266)
 (send gEgo: init() posn(60 175) loop(2))
 SetUpEgo()
 RestoreSpeed()
             (send gTheMusic:
			prevSignal(0)
			stop()
			number(643)
			loop(-1)
			play()
		)
  Print("At least you car roll this far. Now you seriously need some fuel for your car.")
  )
))
 )
 
)
(instance car2 of Act
(properties
view 191
x 55
y 181
))
(instance aWindow of Act
(properties
view 193
x 29
y 38
))
(instance aBarrel of Act
(properties
view 194
x 70
y 108
cel 0
))
(instance onBarrel2 of Act
(properties
view 194
x 23
y 95
cel 1
))


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