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

		(switch(gPreviousRoomNumber)
  (case 145

            (send gEgo:
					posn(175 83)
					loop(1)
				)

			)
			(case 76
            (if(== side 1)
            (send gEgo:
					posn(141 62)
					loop(1)
				)
    )       (if(== side 2)
    (send gEgo:
					posn(310 115)
					loop(1)
				)
			))
   		(case 77
            (if(== side 1)
            (send gEgo:
					posn(141 62)
					loop(1)
				)
    )       (if(== side 2)
    (send gEgo:
					posn(310 115)
					loop(1)
				)
			))
		)

		SetUpEgo()
		(send gEgo:init())
  (aCar: init())
  (if(not(shovelTaken))
   (shovel: init())
  )
	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
(method (handleEvent pEvent)
(super:handleEvent(pEvent))
(if(Said('fill,use,pour/gas,tank,can,(gas<can)'))
Print("I think that the tank is filled.")
)
      (if(Said('look>'))
        (if(Said('/roof'))
 Print("It's been held up by two poles. The roof is covered with thin iron plates.")
 )
  (if(Said('/tree'))
 Print("Haven't you seen one before? Go out then!")
 )
  (if(Said('/forest'))
 Print("I can't see, the trees are blocking the view. Haahaa ... very funny!")
 )
  (if(Said('/car'))
 Print("Doesn't look like it's in very good shape.")
 )
  (if(Said('/window'))
 Print("The windows are curtained inside.")
 )
  (if(Said('/door'))
 Print("This is the front door of the house. It seems to be locked.")
 )
  (if(Said('/house'))
 Print("The house looks pretty nice from the outside.")
 )
 (if(Said('/shovel'))
  (if(not(shovelTaken))
 Print("Looks like a regular redneck shovel.")
 return
 )
 Print("Where do you see one?")
 )
  (if(Said('/fence'))
  (if(not(shovelTaken))
 Print("This fence goes around the whole house. There's a shovel placed against the fence.")
 return
 )
 Print("This fence goes around the whole house.")
 )
(if(Said('/'))
Print("You're in front of a house. There's a car parked. The front door of the house is under a roof. A wooden fence is around the house.")
        )
        )

 (if(Said('drive/car'))
(if(< (send gEgo:distanceTo(aCar)) 30)
(if(send gEgo: has(INV_CAR_KEY))
Print("You unlock the door and hop in.")
Print("... You're on the road again ... lalala" )
(send gRoom: newRoom(140))
return
)
Print("The car door is locked and you don't have the keys. They are probably inside the house.")
return
)
Print("You're too far away from the car.")
)
 (if(Said('drive'))
 Print("What do you want to drive?")
 )
(if(Said('enter>'))
(if(Said('/house'))
(if(==(send gEgo: onControl()) ctlBLUE)
(if(send gEgo: has(INV_HOUSE_KEY))
return
)
Print("You push and pull the door back and forth but what is locked is locked.")
Print("There HAS to be a spare key somewhere. Think!")
return
)
Print("You can't reach the door.")
return
)
(if(Said('/car,(car<door)'))
(if(< (send gEgo:distanceTo(aCar)) 35)
(if(send gEgo: has(INV_CAR_KEY))
Print("You unlock the door and hop in.")
Print("..You're on the road again..")
(send gRoom: newRoom(140))
return
)
Print("The car door is locked and you don't have the keys. They are probably inside the house.")
return
)
Print("You're not close enough to the door.")
return
)
)
(if(Said('open/door,(front<door)'))
(if(==(send gEgo: onControl()) ctlBLUE)
(if(send gEgo: has(INV_HOUSE_KEY))
Print("You unlock the door of the house and step in.")
(send gRoom: newRoom(145))
return
)
Print("You push and pull the door back and forth but what is locked is locked.")
Print("There HAS to be a spare key somewhere. Think!")
return
)
(if(< (send gEgo:distanceTo(aCar)) 30)
(if(send gEgo: has(INV_CAR_KEY))
Print("You unlock the door and hop in.")
Print("..You're on the road again.."#icon 18 0 1)
(send gRoom: newRoom(140))
return
)
Print("The car door is locked and you don't have the keys. They are probably inside the house.")
return
)
Print("You're not close to any of the doors.")
)
(if(Said('take/shovel,tool'))
(if(shovelTaken)
Print("You have already taken it.")
return
)
(if(< (send gEgo:distanceTo(shovel)) 30)
Print("Ok")
Print("What a nice shovel it is.")
+= gScore 3
(send gEgo: get(INV_SHOVEL))
= shovelTaken TRUE
(shovel: hide())
return
)
Print("You're not close enough.")
)
        )
 (method(doit)
 (if(==(send gEgo: onControl()) ctlYELLOW)
 = side 1
 (if(dug)
 (send gRoom: newRoom(77))
 return
 )
 (send gRoom: newRoom(76))
 )
 (if(==(send gEgo: onControl()) ctlNAVY)
 = side 2
 (if(dug)
 (send gRoom: newRoom(77))
 return
 )
 (send gRoom: newRoom(76))
 )
 )
)
(instance aCar of Prop
(properties
view 191
x 25
y 162
))
(instance shovel of Prop
(properties
view 196
x 21
y 63
))
/******************************************************************************/
