(include "sci.sh")
(use "Main")
(use "Scaler")
(use "Osc")
(use "PolyPath")
(use "Polygon")
(use "CueObj")
(use "n958")
(use "Sound")
(use "Cycle")
(use "Sounds")
(use "View")
(use "Obj")
(script 305)


(local
    local0[3]
    local7
    local8
    local14
    local20
    local14
    local20[6] = (160 161 161 160 158 156 )
    local14[6] = (65486 65531 17 44 73 88 )
    local20[6] = (218 189 157 140 128 128 )
    local26

)
(instance public rm305 of Rm
    (properties
        noun 21
        picture 62
        vanishingY 80
    )

    (method (init)
        (self:setRegions(350))
        proc958_0(128 400 416 402 401 412 413 411 410 414 417 426)
        proc0_6(0)
        (send gEgo:actions(ScriptID(350 1)))
        (switch (gGModNum)
            (case 310
                (= style 12 (send gEgo:
                    posn(20 144)
                    loop(0)
                    setScale(Scaler 100 65 172 105)
                    init()
                    edgeHit(0)
                )
  )
            )
            (case 315
                (
                (if (proc0_1(21))
                    proc0_3(21)
                    = style 13
                    (send gEgo:
                        init()
                        hide()
                    )
                    (sRogInTrunk:state(1))
                    (send gRoom:setScript(sRogInTrunk))
                )(else
                    = style 32778
                    (send gRoom:setScript(sFrom315))
                )
 )
            )
            (case 320
                (= style 11 (send gRoom:setScript(sFrom320))  )
            )
            (default 
                ((send gEgo:
                    posn(20 144)
                    loop(0)
                    setScale(Scaler 100 65 172 105)
                    init()
                )
 )
            )
        )
        (if (not proc0_1(10))
            (treeBranch:
                init()
                stopUpd()
            )
        )
        (fruitGrabArea:init())
        (if (proc0_1(16) and not proc0_1(210))
            (wdHead:init())
        )
        (vine:
            init()
            stopUpd()
        )
        (fruit:
            init()
            stopUpd()
        )
        (treeTrunk:
            init()
            setOnMeCheck(1 8192)
        )
        (wd40:init())
        (cave315:
            init()
            setOnMeCheck(1 128)
        )
        (cave320:
            init()
            setOnMeCheck(1 512)
        )
        (extraFruit:
            init()
            setOnMeCheck(1 2)
        )
        (mountains:
            init()
            setOnMeCheck(1 256)
        )
        (pond:
            init()
            setOnMeCheck(1 16)
        )
        (roots:
            init()
            setOnMeCheck(1 64)
        )
        (tree:
            init()
            setOnMeCheck(1 32)
        )
        (wfall:
            init()
            setOnMeCheck(1 8)
        )
        (rightLedge:init())
        (leftLedge:init())
        (super:init())
        (theMusic3:
            number(403)
            owner(self)
            flags(1)
            init()
            setLoop(-1)
            play(75)
        )
        (send gWalkHandler:addToFront(pond tree))
        (if (not proc0_1(10))
            (send gWalkHandler:addToFront(treeBranch))
        )
        (falls:
            init()
            setCycle(Fwd)
        )
        (send gRoom:addObstacle((send ((Polygon:new())):
                type(3)
                init(0 153 55 135 77 118 127 100 119 99 100 106 51 116 24 135 0 142)
                yourself()
            )
 (send ((Polygon:new())):
                type(3)
                init(73 123 97 135 156 140 160 133 104 130 80 119)
                yourself()
            )
 (send ((Polygon:new())):
                type(3)
                init(282 141 249 141 244 159 274 168 317 158 312 125 304 119 301 113 296 122 295 136)
                yourself()
            )
 (send ((Polygon:new())):
                type(3)
                init(255 103 255 106 270 106 270 103)
                yourself()
            )
))
        (if (not (send gRoom:script))
            (send gSQ5:handsOn())
        )
    )


    (method (doit)
        (var temp0)
        (asm
            pushi   #doit
            pushi   0
            super   Rm, 4
            pushi   7
            pushi   6
            pushi   240
            pushi   248
            pushi   5
            pushi   249
            pushi   255
            pushi   65528
            callk   Palette, 14
            pushi   #onControl
            pushi   1
            pushi   1
            lag     gEgo
            send    6
            sat     temp0
            push    
            ldi     128
            eq?     
            bnt     code_04ad
            pushi   90
            pushi   #heading
            pushi   0
            lag     gEgo
            send    4
            lt?     
            bnt     code_048d
            pprev   
            ldi     270
            lt?     
code_048d:  not     
            bnt     code_04ad
            pushi   #script
            pushi   0
            lag     gRoom
            send    4
            not     
            bnt     code_04ad
            pushi   #setScript
            pushi   3
            lofsa   sExitRight
            push    
            pushi   0
            pushi   1
            lag     gRoom
            send    10
            jmp     code_05c6
code_04ad:  lst     temp0
            ldi     512
            eq?     
            bnt     code_04e6
            pushi   90
            pushi   #heading
            pushi   0
            lag     gEgo
            send    4
            lt?     
            bnt     code_04c6
            pprev   
            ldi     270
            lt?     
code_04c6:  not     
            bnt     code_04e6
            pushi   #script
            pushi   0
            lag     gRoom
            send    4
            not     
            bnt     code_04e6
            pushi   #setScript
            pushi   3
            lofsa   sExitRight
            push    
            pushi   0
            pushi   0
            lag     gRoom
            send    10
            jmp     code_05c6
code_04e6:  lst     temp0
            ldi     1024
            eq?     
            bnt     code_050d
            pushi   #script
            pushi   0
            lag     gRoom
            send    4
            push    
            lofsa   sRogSlip
            eq?     
            not     
            bnt     code_050d
            pushi   #setScript
            pushi   1
            lofsa   sRogSlip
            push    
            lag     gRoom
            send    6
            jmp     code_05c6
code_050d:  lst     temp0
            ldi     2048
            eq?     
            bnt     code_053d
            pushi   #script
            pushi   0
            lag     gRoom
            send    4
            not     
            bnt     code_053d
            pushi   #heading
            pushi   0
            lag     gEgo
            send    4
            push    
            ldi     180
            lt?     
            bnt     code_053d
            pushi   #setScript
            pushi   1
            lofsa   sRogInTrunk
            push    
            lag     gRoom
            send    6
            jmp     code_05c6
code_053d:  lst     temp0
            ldi     4096
            eq?     
            bnt     code_056c
            pushi   #script
            pushi   0
            lag     gRoom
            send    4
            not     
            bnt     code_056c
            pushi   #heading
            pushi   0
            lag     gEgo
            send    4
            push    
            ldi     180
            gt?     
            bnt     code_056c
            pushi   #setScript
            pushi   1
            lofsa   sRogInTrunk
            push    
            lag     gRoom
            send    6
            jmp     code_05c6
code_056c:  lst     temp0
            ldi     16384
            eq?     
            bnt     code_05a8
            pushi   #script
            pushi   0
            lofsa   wd40
            send    4
            not     
            bnt     code_05a8
            lsg     gGModNum
            ldi     320
            ne?     
            bnt     code_05a8
            pushi   1
            pushi   14
            callb   proc0_1, 2
            not     
            bt      code_0599
            pushi   1
            pushi   15
            callb   proc0_1, 2
            bnt     code_05a8
code_0599:  pushi   #setScript
            pushi   1
            lofsa   sWD40LandAndAttack
            push    
            lofsa   wd40
            send    6
            jmp     code_05c6
code_05a8:  lst     temp0
            ldi     4
            eq?     
            bnt     code_05c6
            pushi   #script
            pushi   0
            lag     gRoom
            send    4
            not     
            bnt     code_05c6
            pushi   #setScript
            pushi   1
            lofsa   sExitViaScroll
            push    
            lag     gRoom
            send    6
code_05c6:  pushi   5
            pushi   132
            pushi   125
            pushi   165
            pushi   145
            lsg     gEgo
            calle   proc999_4, 10
            bnt     code_060a
            pushi   #script
            pushi   0
            lag     gRoom
            send    4
            not     
            bnt     code_060a
            pushi   #script
            pushi   0
            lofsa   wd40
            send    4
            not     
            bnt     code_060a
            pushi   1
            pushi   14
            callb   proc0_1, 2
            not     
            bnt     code_060a
            pushi   #setScript
            pushi   1
            lofsa   sKnockRogOffTrunk
            push    
            lofsa   wd40
            send    6
code_060a:  ret     
        )
    )


    (method (dispose param1)
        (theMusic3:dispose())
        (send gWalkHandler:delete(pond tree leftLedge))
        (if ((send gWalkHandler:contains(treeBranch)))
            (send gWalkHandler:delete(treeBranch))
        )
        (super:dispose(rest param1))
    )


    (method (doVerb param1 param2)
        (switch (param1)
            (case 1
                (
                (if (proc0_1(16))
                    (send gTestMessager:say(noun param1 2 0))
                )(else
                    (send gTestMessager:say(noun param1 1 0))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance sFrom315 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (send gEgo:
                    posn(275 100)
                    scaleSignal(1)
                    scaleX(51)
                    scaleY(51)
                    init()
                    setPri(1)
                    setMotion(MoveTo 262 105 self)
                )
  )
            )
            (case 1
                ((send gEgo:setHeading(180 self))  )
            )
            (case 2
                ((send gSQ5:handsOn()) (self:dispose()) )
            )
        )
    )

)
(instance sExitViaScroll of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (send gEgo:setMotion(MoveTo 65524 147 self))  )
            )
            (case 1
                ((send gRoom:newRoom(310)) )
            )
        )
    )

)
(instance sWD40LandAndAttack of Script
    (properties)

    (method (doit)
        (if ((> (send gEgo:y) 136) and not local14)
            = seconds 0
            = local14 1
            (self:cue())
        )
        (super:doit())
    )


    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSq5Music1:
                    number(35)
                    loop(-1)
                    play()
                )
 = local26 0 
                (if (proc0_1(15))
                    (wd40:
                        view(416)
                        loop(3)
                        cel(0)
                        scaleSignal(1)
                        scaleX(local20[local26])
                        scaleY(local20[local26])
                        x(local20[local26])
                        y(local14[local26])
                    )
                    = ticks 10
                )(else
                    ++state
                    = ticks 1
                )
 )
            )
            (case 1
                ((wd40:
                    scaleX(local20[local26])
                    scaleY(local20[local26])
                    x(local20[local26])
                    y(local14[local26])
                )
 
                (if (> ++local26 5)
                    ++state
                    = ticks 1
                )(else
                    --state
                    = ticks 10
                )
 )
            )
            (case 2
                ((wd40:
                    view(416)
                    loop(1)
                    cel(0)
                    x(161)
                    y(133)
                    setCycle(End self)
                )
  )
            )
            (case 3
                ((wd40:
                    view(416)
                    loop(2)
                    cel(0)
                    x(161)
                    y(133)
                    setCycle(End self)
                )
  )
            )
            (case 4
                (proc0_2(66) (send gSq5Music2:
                    number(402)
                    setLoop(1)
                    play()
                )
 (fireBall:
                    view(402)
                    loop(0)
                    cel(0)
                    x(175)
                    y(89)
                    setStep(15 5)
                    moveSpeed(0)
                    init()
                    setMotion(MoveTo + (send gEgo:x) 7 - (send gEgo:y) 10 self)
                )
  )
            )
            (case 5
                ((send gSq5Music2:
                    number(4021)
                    setLoop(1)
                    play()
                )
 (fireBall:
                    view(401)
                    loop(4)
                    cel(0)
                    setCycle(End self)
                )
  )
            )
            (case 6
                (= seconds 5  )
            )
            (case 7
                ((send gSq5Music2:
                    number(402)
                    setLoop(1)
                    play()
                )
 (fireBall:
                    view(402)
                    loop(0)
                    cel(0)
                    x(175)
                    y(89)
                    setStep(15 5)
                    moveSpeed(0)
                    setMotion(MoveTo + (send gEgo:x) 2 - (send gEgo:y) 18 self)
                )
  )
            )
            (case 8
                ((fireBall:dispose()) 
                (if ((<= 45 (send gEgo:heading)) and (<= (send gEgo:heading) 135))
                    (send gEgo:loop(3))
                )(else
                    (if ((<= 136 (send gEgo:heading)) and (<= (send gEgo:heading) 225))
                        (send gEgo:loop(0))
                    )(else
                        (if ((<= 226 (send gEgo:heading)) and (<= (send gEgo:heading) 315))
                            (send gEgo:loop(2))
                        )(else
                            (send gEgo:loop(1))
                        )
                    )
                )
 (send gEgo:
                    view(401)
                    cel(0)
                    setCycle(End self)
                )
  )
            )
            (case 9
                (proc0_9(17) (self:dispose()) )
            )
        )
    )

)
(instance sWD40LandOverRog of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (= seconds 4  )
            )
            (case 1
                ((wd40:
                    view(416)
                    loop(3)
                    cel(0)
                    scaleSignal(1)
                    scaleX(local20[= local26 0])
                    scaleY(local20[(send gSq5Music2:
                            number(401)
                            setLoop(1)
                            play(0)
                            fade(127 10 10 0)
                        )
])
                    x(local20[= local26 0])
                    y(local14[= local26 0])
                )
 = ticks 10  )
            )
            (case 2
                ((wd40:
                    scaleX(local20[local26])
                    scaleY(local20[local26])
                    x(local20[local26])
                    y(local14[local26])
                )
 
                (if (> ++local26 5)
                    = ticks 1
                )(else
                    --state
                    = ticks 10
                )
 )
            )
            (case 3
                ((send gSq5Music2:stop()) (wd40:
                    view(416)
                    loop(0)
                    cel(0)
                    x(164)
                    y(132)
                    setCycle(End self)
                )
  )
            )
            (case 4
                (
                (if (not proc0_1(19))
                    proc0_2(19)
                    (send gTestMessager:say(26 0 0 0 self))
                )(else
                    = cycles 1
                )
 )
            )
            (case 5
                ((theMusic3:play(75)) = seconds 5  )
            )
            (case 6
                ((send gSq5IconBar:enable(0)) (send gSq5Music2:
                    number(401)
                    setLoop(1)
                    play()
                )
 (wd40:
                    view(400)
                    setStep(5 10)
                    moveSpeed(0)
                    signal(| (wd40:signal) $6000)
                    setMotion(MoveTo 250 65496 self)
                )
  )
            )
            (case 7
                ((send gSq5Music2:fade()) (theMusic3:play(75)) 
                (if (proc0_1(21))
                    (send gRoom:newRoom(315))
                )(else
                    (self:dispose())
                )
 )
            )
        )
    )

)
(instance sFruitUpWD40 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((rogEyes:hide()) (send gEgo:put(18)) (send gEgo:
                    view(412)
                    loop(4)
                    cel(0)
                    x(173)
                    y(140)
                    show()
                    setCycle(CT 7 1 self)
                )
  )
            )
            (case 1
                ((send gSq5Music2:
                    number(227)
                    setLoop(1)
                    play()
                )
 (send gEgo:setCycle(End self))  )
            )
            (case 2
                (proc0_2(21) proc0_10(209 200) (rogEyes:show()) (self:dispose()) )
            )
        )
    )

)
(instance sSwingFruit of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (send gEgo:setMotion(PolyPath 306 141 self))  )
            )
            (case 1
                ((send gEgo:
                    view(413)
                    setLoop(0)
                    cel(1)
                    x(306)
                    y(141)
                    setCycle(End self)
                )
  )
            )
            (case 2
                (proc0_6(0 1) (send gSQ5:handsOn()) = local14 1 (fruit:setCycle(CT 0 -1 self))  )
            )
            (case 3
                ((fruit:setCycle(Osc 3 self))  )
            )
            (case 4
                ((fruit:setCycle(End self)) = local14 0 
                (if (local8)
                    (send gEgo:
                        view(413)
                        setLoop(1)
                        cel(0)
                        setCycle(CT 3 1)
                    )
                )
 )
            )
            (case 5
                (
                (if (local8)
                    (send gEgo:
                        get(18)
                        setCycle(End)
                    )
                    proc0_10(207 25)
                )
 (fruit:setCycle(CT 1 -1 self))  )
            )
            (case 6
                (
                (if (local8)
                    proc0_6(0 1)
                    (send gSQ5:handsOn())
                    (send gTestMessager:say(13 0 0 0))
                )
 = local8 0 (fruit:setCycle(CT 5 1 self))  )
            )
            (case 7
                ((fruit:setCycle(CT 2 -1 self))  )
            )
            (case 8
                ((fruit:setCycle(CT 4 1 self))  )
            )
            (case 9
                ((fruit:
                    setCel(3)
                    stopUpd()
                )
 (self:dispose()) )
            )
        )
    )

)
(instance sVineSwing of Script
    (properties)

    (method (doit)
        (if ((== (vine:loop) 0) and (== state 5))
            (send gEgo:cel((vine:cel)))
        )
        (super:doit())
    )


    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (send gEgo:setMotion(PolyPath 161 137 self))  )
            )
            (case 1
                ((send gEgo:
                    view(411)
                    loop(1)
                    cel(0)
                    x(166)
                    y(132)
                    setScale(0)
                    scaleX(128)
                    scaleY(128)
                    setCycle(End self)
                )
  )
            )
            (case 2
                ((send gEgo:
                    loop(2)
                    cel(0)
                    setCycle(CT 2 1 self)
                )
  )
            )
            (case 3
                ((send gEgo:setCycle(End self)) (vine:setCycle(End self))  )
            )
            (case 4
                (0  )
            )
            (case 5
                ((send gEgo:
                    loop(3)
                    cel(0)
                    x(207)
                    y(93)
                    setCycle(End self)
                )
 (vine:
                    loop(0)
                    cel(0)
                    setCycle(End self)
                )
  )
            )
            (case 6
                (0  )
            )
            (case 7
                (proc0_6(0) (send gEgo:
                    x(264)
                    y(106)
                    setPri(1)
                    scaleSignal(1)
                    scaleX(51)
                    scaleY(51)
                )
 = local20 0 (send gSQ5:handsOn()) (self:dispose()) )
            )
        )
    )

)
(instance sExitRight of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) 
                (if (register)
                    (send gEgo:setMotion(MoveTo 278 101 self))
                )(else
                    (send gEgo:setMotion(MoveTo 319 118 self))
                )
 )
            )
            (case 1
                (
                (if (register)
                    (send gRoom:newRoom(315))
                )(else
                    (send gEgo:hide())
                    (send gRoom:newRoom(320))
                )
 (self:dispose()) )
            )
        )
    )

)
(instance sRogInTrunk of Script
    (properties)

    (method (doit)
        (if (not (send gEgo:isNotHidden()) and (send gEgo:mover))
            (self:cue())
        )
        (super:doit())
    )


    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) 
                (if ((send gEgo:looper))
                    (send ((send gEgo:looper)):dispose())
                )
 (send gEgo:
                    setCycle(0)
                    setLoop(-1)
                )
 
                (if (proc0_1(15))
                    (wd40:setScript(sWD40LandOverRog))
                )
 
                (if (< (send gEgo:x) 160)
                    (send gEgo:
                        view(410)
                        setLoop(2)
                        cel(0)
                        scaleX(128)
                        scaleY(128)
                        setScale(0)
                        x(69)
                        y(135)
                        setCycle(End self)
                    )
                )(else
                    (send gEgo:
                        view(410)
                        setLoop(0)
                        setPri(-1)
                        cel(0)
                        scaleX(128)
                        scaleY(128)
                        setScale(0)
                        x(249)
                        y(163)
                        setCycle(End self)
                    )
                )
 )
            )
            (case 1
                ((send gEgo:hide()) = seconds 3  )
            )
            (case 2
                ((rogEyes:
                    init()
                    setScript(sEyes)
                )
 (send gSQ5:handsOn()) 
                (if ((wd40:script))
                    (send gSq5IconBar:disable(0))
                )
 )
            )
            (case 3
                ((send gSQ5:handsOff()) (rogEyes:dispose()) = seconds 3  )
            )
            (case 4
                (
                (if (< gPEventX 160)
                    (send gEgo:
                        view(410)
                        setLoop(3)
                        cel(0)
                        x(64)
                        y(136)
                        show()
                        setCycle(End self)
                    )
                )(else
                    (send gEgo:
                        view(410)
                        setLoop(1)
                        cel(0)
                        x(255)
                        y(162)
                        show()
                        setCycle(End self)
                    )
                )
 )
            )
            (case 5
                (proc0_6(0) 
                (if (< (send gEgo:x) 160)
                    (send gEgo:
                        x(64)
                        y(136)
                        setLoop(-1)
                        loop(1)
                        setScale(Scaler 100 65 172 105)
                        setMotion(MoveTo 36 131 self)
                    )
                )(else
                    (send gEgo:
                        x(255)
                        y(162)
                        setLoop(-1)
                        loop(0)
                        setScale(Scaler 95 57 148 111)
                        setMotion(MoveTo 291 152 self)
                    )
                )
 )
            )
            (case 6
                ((send gSQ5:handsOn()) (self:dispose()) )
            )
        )
    )

)
(instance sRogSlip of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) 
                (if (proc0_1(10))
                    (send gTestMessager:say(1 0 0 0))
                    (send gEgo:setMotion(MoveTo 93 112 self))
                )(else
                    ++state
                    = cycles 1
                )
 )
            )
            (case 1
                ((send gSQ5:handsOn()) (self:dispose())  )
            )
            (case 2
                ((send gSq5Music2:
                    number(102)
                    setLoop(1)
                    play()
                )
 (send gEgo:
                    view(414)
                    setLoop(-1)
                    setLoop(0)
                    cel(0)
                    x(118)
                    y(102)
                    setPri(9)
                    ignoreActors()
                    scaleX(128)
                    scaleY(128)
                    setScale(0)
                    setCycle(End self)
                )
  )
            )
            (case 3
                ((send gSq5Music2:
                    number(417)
                    setLoop(1)
                    play()
                )
 = seconds 2  )
            )
            (case 4
                ((send gEgo:
                    view(414)
                    setLoop(-1)
                    setLoop(0)
                    cel((send gEgo:lastCel()))
                    scaleX(128)
                    scaleY(128)
                    setScale(0)
                    setStep(2 6)
                    moveSpeed(0)
                    setMotion(MoveTo 118 150 self)
                )
 (treeBranch:
                    setLoop(-1)
                    setLoop(1)
                    setCel(0)
                    setCycle(0)
                    setStep(2 6)
                    moveSpeed(0)
                    setMotion(MoveTo 127 150)
                )
  )
            )
            (case 5
                ((send gSq5Music2:
                    number(411)
                    setLoop(1)
                    play()
                )
 (send gEgo:
                    view(417)
                    setLoop(-1)
                    setLoop(2)
                    cel(0)
                    x(146)
                    y(158)
                    setCycle(Fwd)
                    setStep(4 6)
                    setMotion(MoveTo 63 172 self)
                    cycleSpeed(6)
                    moveSpeed(6)
                )
  )
            )
            (case 6
                ((send gEgo:
                    view(417)
                    setLoop(-1)
                    setLoop(1)
                    cel(0)
                    x(47)
                    y(169)
                    setStep(3 7)
                    setCycle(0)
                    setMotion(MoveTo 47 205 self)
                )
  )
            )
            (case 7
                ((send gSq5Music2:
                    number(411)
                    setLoop(1)
                    play(self)
                )
 (treeBranch:
                    setLoop(-1)
                    setLoop(1)
                    setCel(0)
                    setCycle(0)
                    setStep(4 6)
                    setMotion(MoveTo 40 169 self)
                    moveSpeed(6)
                )
  )
            )
            (case 8
                ((treeBranch:
                    setLoop(1)
                    setCel(0)
                    setCycle(0)
                    setStep(4 6)
                    setMotion(MoveTo 40 210 self)
                )
  )
            )
            (case 9
                ((treeBranch:dispose()) proc0_2(11) proc0_2(10) (send gRoom:newRoom(300)) (self:dispose()) )
            )
        )
    )

)
(instance sRogClimbOnOffTrunk of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) 
                (if (not register)
                    (send gEgo:setMotion(PolyPath 78 121 self))
                )(else
                    (send gEgo:setMotion(PolyPath 65 132 self))
                )
 )
            )
            (case 1
                (
                (if (not register)
                    = state 3
                )
 = cycles 1  )
            )
            (case 2
                ((send gWalkHandler:addToFront(leftLedge)) (send gEgo:
                    view(410)
                    setLoop(-1)
                    setLoop(4)
                    cel(0)
                    x(74)
                    y(132)
                    scaleX(128)
                    scaleY(128)
                    setScale(0)
                    setCycle(End self)
                )
  )
            )
            (case 3
                (proc0_6(0) (send gEgo:
                    x(78)
                    y(121)
                    loop(4)
                    setPri(15)
                    setScale(myScaler)
                )
 = local20 1 (send gSQ5:handsOn()) (self:dispose())  )
            )
            (case 4
                ((send gEgo:
                    view(410)
                    setLoop(-1)
                    setLoop(4)
                    cel((send gEgo:lastCel()))
                    x(74)
                    y(132)
                    scaleX(128)
                    scaleY(128)
                    setScale(0)
                    setPri(-1)
                    setCycle(Beg self)
                )
 (send gWalkHandler:delete(leftLedge))  )
            )
            (case 5
                (proc0_6(0) (send gEgo:
                    x(70)
                    y(126)
                    setScale(Scaler 100 65 172 105)
                    setMotion(MoveTo 41 130 self)
                )
 = local20 0  )
            )
            (case 6
                ((send gSQ5:handsOn()) (self:dispose()) )
            )
        )
    )

)
(instance sEyes of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (
                (if (== local7 0)
                    (rogEyes:
                        setLoop(Random(0 3))
                        setCel(0)
                    )
                )(else
                    (rogEyes:
                        setLoop(0)
                        setCel(0)
                    )
                )
 = ticks Random(25 40)  )
            )
            (case 1
                ((rogEyes:setCel(1)) = ticks 10  )
            )
            (case 2
                (= state -1 = cycles 1 )
            )
        )
    )

)
(instance sKnockRogOffTrunk of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (= seconds 5  )
            )
            (case 1
                ((send gSQ5:handsOff()) 
                (if (not proc999_4(132 125 165 145 gEgo))
                    (self:dispose())
                )(else
                    (send gEgo:
                        view(411)
                        setLoop(-1)
                        setLoop(4)
                        cel(0)
                        x(140)
                        y(143)
                        setCycle(End self)
                    )
                )
 (send gSq5Music2:
                    number(416)
                    setLoop(1)
                    play()
                )
  )
            )
            (case 2
                ((send gEgo:
                    setLoop(-1)
                    setLoop(4)
                    setCycle(0)
                    setStep(3 10)
                    setMotion(MoveTo 140 215 self)
                )
  )
            )
            (case 3
                ((send gRoom:newRoom(300)) )
            )
        )
    )

)
(instance sGetHead of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (send gEgo:setMotion(PolyPath 37 134 self))  )
            )
            (case 1
                ((send gEgo:setHeading(270 self))  )
            )
            (case 2
                ((send gEgo:
                    view(19)
                    loop(1)
                    cel(0)
                    setCycle(End self)
                )
  )
            )
            (case 3
                ((send gEgo:get(20)) proc0_10(210 25) (wdHead:dispose()) (send gEgo:setCycle(Beg self))  )
            )
            (case 4
                (proc0_6(0) (send gEgo:loop(1)) (send gSQ5:handsOn()) (self:dispose()) )
            )
        )
    )

)
(instance sWalkToTree of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gEgo:setMotion(PolyPath 113 98 self))  )
            )
            (case 1
                ((self:dispose()) )
            )
        )
    )

)
(instance sFrom320 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (send gEgo:
                    posn(318 118)
                    setScale(Scaler 95 57 148 111)
                    init()
                    setPri(8)
                    setMotion(MoveTo 296 125 self)
                )
  )
            )
            (case 1
                ((send gEgo:
                    setPri(-1)
                    setMotion(MoveTo 306 140 self)
                )
  )
            )
            (case 2
                ((send gEgo:setHeading(180 self))  )
            )
            (case 3
                ((send gSQ5:handsOn()) (self:dispose()) )
            )
        )
    )

)
(instance wd40 of Actor
    (properties
        x 20
        y 20
        noun 4
        modNum 301
        view 400
        loop 8
        signal 16384
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 22
                (
                (if ((not proc0_1(21) and (== (wd40:x) 164)) and (== (wd40:y) 132))
                    (send gEgo:setScript(sFruitUpWD40))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance rogEyes of Prop
    (properties
        x 158
        y 142
        view 412
        priority 15
        signal 16400
    )
)
(instance fireBall of Actor
    (properties
        x 175
        y 89
        view 402
        signal 16384
    )
)
(instance treeBranch of Actor
    (properties
        x 127
        y 99
        noun 2
        view 414
        loop 1
        priority 8
        signal 16400
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 4
                (
                (if (< (send gEgo:x) 128)
                    (send gRoom:setScript(sWalkToTree))
                )(else
                    (send gTestMessager:say(12 0 0 0))
                )
 )
            )
            (case 3
                (
                (if (< (send gEgo:x) 128)
                    (send gRoom:setScript(sWalkToTree))
                )(else
                    (send gTestMessager:say(12 0 0 0))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance falls of Prop
    (properties
        x 40
        y 169
        noun 16
        view 417
        priority 1
        signal 16400
    )
)
(instance vine of Prop
    (properties
        x 220
        y 8
        noun 24
        view 415
        loop 1
        signal 16384
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 4
                (
                (if (local20)
                    (send gRoom:setScript(sVineSwing))
                )(else
                    (super:doVerb(param1 rest param2))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance fruit of Prop
    (properties
        x 280
        y 48
        noun 15
        view 413
        loop 2
        cel 3
        priority 8
        signal 16400
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 21
                (
                (if (not proc0_1(207) and proc999_4(280 122 319 189 gEgo))
                    (send gRoom:setScript(sSwingFruit))
                )(else
                    (if (proc0_1(207))
                        (send gTestMessager:say(14 0 0 0))
                    )(else
                        (send gTestMessager:say(6 0 0 0))
                    )
                )
 )
            )
            (case 4
                (
                (if ((fruit:cycler))
                    (fruitGrabArea:doVerb(param1))
                )(else
                    (super:doVerb(param1 rest param2))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance wdHead of Prop
    (properties
        x 19
        y 137
        noun 27
        view sExitRight
        loop 3
        cel 2
        priority 1
        signal 16400
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 4
                (
                (if (not local20 and proc999_4(0 0 120 189 gEgo))
                    (send gRoom:setScript(sGetHead))
                )(else
                    (send gTestMessager:say(6 0 0 0))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance treeTrunk of Feature
    (properties
        x 200
        y 155
        noun 17
        onMeCheck 8192
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 4
                (
                (if (local20)
                    (send gRoom:setScript(sRogClimbOnOffTrunk 0 0))
                )(else
                    (if (> (send gEgo:x) 60)
                        (send gTestMessager:say(7 0 0 0))
                    )(else
                        (send gRoom:setScript(sRogClimbOnOffTrunk 0 1))
                    )
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance fruitGrabArea of Feature
    (properties
        x 280
        noun 15
        nsTop 89
        nsLeft 256
        nsBottom 100
        nsRight 300
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 4
                (
                (if ((fruit:cycler))
                    (if (((== local14 1) and (== (send gEgo:x) 306)) and (== (send gEgo:y) 141))
                        = local8 1
                        (send gSQ5:handsOff())
                    )(else
                        (send gTestMessager:say(11 0 0 0))
                    )
                )(else
                    (super:doVerb(param1 rest param2))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance cave315 of Feature
    (properties
        x 262
        y 98
        noun 3
        onMeCheck 128
    )
)
(instance cave320 of Feature
    (properties
        x 304
        y 110
        noun 4
        onMeCheck 512
    )
)
(instance extraFruit of Feature
    (properties
        x 293
        y 70
        noun 8
        onMeCheck 2
    )
)
(instance mountains of Feature
    (properties
        x 229
        y 111
        noun 18
        onMeCheck 256
    )
)
(instance pond of Feature
    (properties
        x 111
        y sExitViaScroll
        noun 20
        onMeCheck 16
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 3
                ((send gTestMessager:say(noun 4 0 0))  )
            )
            (case 4
                ((send gTestMessager:say(noun param1 0 0))  )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance roots of Feature
    (properties
        x 267
        y 139
        noun 22
        onMeCheck 64
    )
)
(instance tree of Feature
    (properties
        x 115
        y 103
        noun 23
        onMeCheck 32
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 4
                (
                (if (< (send gEgo:x) 128)
                    (send gRoom:setScript(sWalkToTree))
                )(else
                    (send gTestMessager:say(12 0 0 0))
                )
 )
            )
            (case 3
                (
                (if (< (send gEgo:x) 128)
                    (send gRoom:setScript(sWalkToTree))
                )(else
                    (send gTestMessager:say(12 0 0 0))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance wfall of Feature
    (properties
        x 146
        y 81
        noun 25
        onMeCheck 8
    )
)
(instance leftLedge of Feature
    (properties
        x 25
        y 112
        nsTop 112
        nsBottom 189
        nsRight 50
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 1
                (
                (if (proc999_4(265 119 319 189 gEgo))
                    (send gTestMessager:say(19 1 0 0))
                )(else
                    (if (proc0_1(16))
                        (send gTestMessager:say(21 param1 2 0))
                    )(else
                        (send gTestMessager:say(21 param1 1 0))
                    )
                )
 )
            )
            (case 4
                (
                (if (local20)
                    (send gRoom:setScript(sRogClimbOnOffTrunk 0 0))
                )(else
                    (super:doVerb(param1 rest param2))
                )
 )
            )
            (case 3
                (
                (if (local20)
                    (send gRoom:setScript(sRogClimbOnOffTrunk 0 0))
                )(else
                    (super:doVerb(param1 rest param2))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance rightLedge of Feature
    (properties
        x 295
        y 119
        nsTop 119
        nsLeft 265
        nsBottom 189
        nsRight 319
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 1
                (
                (if (proc999_4(0 112 50 189 gEgo))
                    (send gTestMessager:say(19 1 0 0))
                )(else
                    (if (proc0_1(16))
                        (send gTestMessager:say(21 param1 2 0))
                    )(else
                        (send gTestMessager:say(21 param1 1 0))
                    )
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance myScaler of Scaler
    (properties)

    (method (init theClient)
        (if (paramTotal)
            = client theClient
        )
        (self:doit())
    )


    (method (doit)
        (if (> (send gEgo:x) 142)
            (send gEgo:
                scaleSignal(1)
                scaleX(128)
                scaleY(128)
            )
        )(else
            (send gEgo:
                scaleSignal(1)
                scaleX(- 128 (/ (- 142 (send gEgo:x)) 2))
                scaleY((send gEgo:scaleX))
            )
        )
    )

)
(instance theMusic3 of Sound
    (properties
        flags 1
    )
)
