(version 2)
(include "sci.sh")
(exports
    0 climbRg
    1 climbing
    2 fallRight
    3 fallLeft
)
(use "Main")
(use "Class_255_0")
(use "n958")
(use "RFeature")
(use "Cycle")
(use "Game")
(use "PicView")
(use "Obj")
(script 609)



(instance public climbRg of Rgn
    (properties)

    (method (init param1)
        proc958_0(128 34 8 270)
        proc958_0(132 95 17)
        (self:keep(0))
        (super:init(rest param1))
        (send global2:setScript(climbing))
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )(else
            (if ((super:handleEvent(pEvent)))
                return 
            )(else
                (if (Said('look,look/leaf'))
                    proc255_0(609 0)
                )(else
                    (if (Said('climb,climb>'))
                        (if (Said('<up,down'))
                            proc255_0(609 1)
                        )(else
                            proc255_0(609 2)
                            (send pEvent:claimed(1))
                        )
                    )(else
                        (if (Said('get,get/leaf'))
                            proc255_0(609 3)
                        )
                    )
                )
            )
        )
    )

)
(instance public climbing of Script
    (properties)

    (method (doit)
        (super:doit())
        (switch ((send gEgo:onControl(1)))
            (case 128
                (send global2:setScript(fallRight))
            )
            (case 64
                (send global2:setScript(fallLeft))
            )
        )
    )

)
(instance public fallRight of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send (ScriptID(0 21)):
                    number(17)
                    loop(-1)
                    init()
                    play()
                )
                (send gEgo:
                    view(8)
                    setLoop(5)
                    setCycle(Fwd)
                    cycleSpeed(1)
                    cel(0)
                    ignoreActors()
                    illegalBits(0)
                    setStep(4 6)
                    setPri(15)
                    setMotion(MoveTo + (send gEgo:x) 20 214 self)
                )
            )
            (case 1
                (switch (gNumber)
                    (case 72
                        (self:cue())
                    )
                    (case 71
                        (self:changeState(3))
                    )
                    (case 70
                        (self:changeState(4))
                    )
                )
            )
            (case 2
                (send global2:
                    style(42)
                    drawPic(71)
                )
                (send gEgo:
                    posn(168 -10)
                    setStep(4 8)
                    setMotion(MoveTo 180 214 self)
                )
            )
            (case 3
                (send global2:
                    style(42)
                    drawPic(70)
                )
                (send gEgo:
                    posn(182 -10)
                    setStep(4 12)
                    setMotion(MoveTo 210 214 self)
                )
            )
            (case 4
                (send global2:
                    drawPic(gGNumber_4)
                    overlay(270 100)
                )
                (send gEgo:
                    view(34)
                    setCycle(0)
                    setLoop(5)
                    posn(270 -10)
                    setStep(2 15)
                    setMotion(MoveTo 276 170 self)
                )
            )
            (case 5
                (crater:
                    loop(1)
                    init()
                )
                (send (ScriptID(0 21)):
                    number(95)
                    loop(1)
                    play()
                )
                (self:cue())
            )
            (case 6
                (send gEgo:
                    loop(3)
                    cel(0)
                    cycleSpeed(1)
                    posn(276 182)
                )
                proc0_7()
                ShakeScreen(6)
                (send gEgo:setCycle(End))
                = seconds 4
            )
            (case 7
                proc0_16("Looks like you had a bad fall this spring.")
            )
        )
    )

)
(instance public fallLeft of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send (ScriptID(0 21)):
                    number(17)
                    loop(-1)
                    init()
                    play()
                )
                (send gEgo:
                    view(8)
                    setLoop(4)
                    cel(0)
                    setCycle(Fwd)
                    cycleSpeed(1)
                    ignoreActors()
                    illegalBits(0)
                    setStep(4 6)
                    setPri(15)
                    setMotion(MoveTo - (send gEgo:x) 20 214 self)
                )
            )
            (case 1
                (switch (gNumber)
                    (case 72
                        (self:cue())
                    )
                    (case 71
                        (self:changeState(3))
                    )
                    (case 70
                        (self:changeState(4))
                    )
                )
            )
            (case 2
                (send global2:
                    style(42)
                    drawPic(71)
                )
                (send gEgo:
                    posn(148 -10)
                    setStep(4 8)
                    setMotion(MoveTo 120 214 self)
                )
            )
            (case 3
                (send global2:
                    style(42)
                    drawPic(70)
                )
                (send gEgo:
                    posn(118 -10)
                    setStep(4 12)
                    setMotion(MoveTo 106 214 self)
                )
            )
            (case 4
                (send global2:
                    drawPic(gGNumber_4)
                    overlay(270 100)
                )
                (send gEgo:
                    setCycle(0)
                    setLoop(4)
                    view(34)
                    posn(54 -10)
                    setStep(2 15)
                    setMotion(MoveTo 50 170 self)
                )
            )
            (case 5
                (crater:
                    loop(0)
                    posn(50 180)
                    init()
                )
                (send (ScriptID(0 21)):
                    number(95)
                    loop(1)
                    play()
                )
                (self:cue())
            )
            (case 6
                (send gEgo:
                    loop(2)
                    cel(0)
                    cycleSpeed(1)
                    posn(50 180)
                )
                proc0_7()
                ShakeScreen(6)
                (send gEgo:setCycle(End))
                = seconds 4
            )
            (case 7
                proc0_16("Looks like you had a bad fall this spring.")
            )
        )
    )

)
(instance leaf1 of RPicView
    (properties
        description 1781
        view 270
    )
)
(instance crater of View
    (properties
        x 276
        y 182
        description 1792
        view 34
    )
)
