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

		(switch(gPreviousRoomNumber)
			(default
				(send gEgo:
					posn(150 130)
					loop(1)
				)
			)
		)

    = gTimeSeconds2 0
  (aBack: init())
   (aRope1: init() cel(rope1))
     (aRope2: init()cel(rope2))
       (aRope3: init()cel(rope3))
       Print("Click on the rope to move it.")
	)
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
 (method(doit)
 (if(== rope1 2)
 (if(== rope2 0)
 (if(== rope3 1)
 (if(not(bridgeDown))
 = bridgeDown TRUE
 += gScore 1
 Print("...click....click....click....!!")
 )
 )
 )
 )
(if(>= gTimeSeconds 1)
= r1 FALSE
= r2 FALSE
= r3 FALSE
)
 )
 (method (handleEvent pEvent)
		(if( not (super:handleEvent(pEvent)) )
(if(not (& (send pEvent:modifiers) emRIGHT_BUTTON))
(if(> (send pEvent:x) 7 and (if(< (send pEvent:x) 33)))
(if(< (send pEvent:y) 22 and (if(> (send pEvent:y) 2)))
 (if(bridgeDown)
(send gRoom: newRoom(123))
return
)
(send gRoom: newRoom(119))
    )
    )
    (if(> (send pEvent:x) 63 and (if(< (send pEvent:x) 87)))
(if(< (send pEvent:y) 184 and (if(> (send pEvent:y) 0)))
(if(not(r1))
= r1 TRUE
+= rope1 1
(if(== rope1 3)
= rope1 0
(aRope1: cel(rope1))
= gTimeSeconds 0
return
)
(aRope1: cel(rope1))
= gTimeSeconds 0
)
)
)

    (if(> (send pEvent:x) 138 and (if(< (send pEvent:x) 162)))
(if(< (send pEvent:y) 184 and (if(> (send pEvent:y) 0)))
(if(not(r2))
= r2 TRUE
+= rope2 1
(if(== rope2 3)
= rope2 0
(aRope2: cel(rope2))
= gTimeSeconds 0
return
)
(aRope2: cel(rope2))
= gTimeSeconds 0
)
)
)
   (if(> (send pEvent:x) 213 and (if(< (send pEvent:x) 237)))
(if(< (send pEvent:y) 184 and (if(> (send pEvent:y) 0)))
(if(not(r3))
= r3 TRUE
+= rope3 1
(if(== rope3 3)
= rope3 0
(aRope3: cel(rope3))
= gTimeSeconds 0
return
)
(aRope3: cel(rope3))
= gTimeSeconds 0
)
)
)

)
)
)
)
(instance aBack of Prop
(properties
view 104
x 20
y 15
loop 2
cel 0
))
(instance aRope1 of Prop
(properties
view 105
x 75
y 184
cel 0
))
(instance aRope2 of Prop
(properties
view 105
x 150
y 184
cel 0
))
(instance aRope3 of Prop
(properties
view 105
x 225
y 184
cel 0
))
/******************************************************************************/
