(version 2)
(include "sci.sh")
(exports
    0 stalkRg
)
(use "Main")
(use "Class_255_0")
(use "NewFeature")
(use "DPath")
(use "Cycle")
(use "Game")
(use "Obj")
(script 607)



(instance public stalkRg of Rgn
    (properties)

    (method (init param1)
        Load(rsVIEW 19)
        Load(rsPIC 270)
        (self:keep(0))
        (super:init(rest param1))
        (if ((send gEgo:has(20)))
            (send gEgo:put(20))
        )(else
            (send global2:overlay(270 100))
        )
        (if (== gGNumber 70)
            (send global2:setScript(climbDownStalk))
        )
        (bigStalk:init())
    )


    (method (handleEvent pEvent)
        (if ((super:handleEvent(pEvent)))
        )(else
            (if (Said('climb,climb'))
                (if (not & (send gEgo:onControl(1)) $0400)
                    proc255_0(607 0)
                )(else
                    (if (proc0_12(1))
                        proc255_0(607 1)
                    )(else
                        (if ((send global2:script) and (== (send global2:script) climbUpStalk))
                            proc255_0(607 2)
                        )(else
                            (if ((send global2:script))
                                proc255_0(607 3)
                            )(else
                                (send global2:setScript(climbUpStalk))
                            )
                        )
                    )
                )
            )
        )
    )

)
(instance climbUpStalk of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (if (proc0_12(2))
                    (send gGoat:setMotion(0))
                    DisposeScript(971)
                    (send gGoat:setMotion(MoveTo 165 180 self))
                )(else
                    (self:cue())
                )
            )
            (case 1
                proc0_2()
                (send gEgo:
                    ignoreActors()
                    ignoreHorizon()
                    illegalBits(0)
                )
                (if (> (send gEgo:y) 141)
                    (self:changeState(4))
                )(else
                    (if (< (send gEgo:x) 126)
                        (self:changeState(3))
                    )(else
                        (if (> (send gEgo:x) 220)
                            (self:changeState(3))
                        )(else
                            (self:cue())
                        )
                    )
                )
            )
            (case 2
                (send gEgo:setMotion(MoveTo 122 (send gEgo:y) self))
            )
            (case 3
                (send gEgo:setMotion(MoveTo (send gEgo:x) 148 self))
            )
            (case 4
                (send gEgo:setMotion(MoveTo 162 147 self))
            )
            (case 5
                proc0_10(48)
                (send gEgo:
                    posn(162 145)
                    view(19)
                    setLoop(0)
                    cel(0)
                    setPri(14)
                    setStep(4 3)
                    moveSpeed(1)
                    cycleSpeed(1)
                    setCycle(SyncWalk)
                    setMotion(DPath 174 118 175 100 134 53 136 31 145 1 self)
                )
            )
            (case 6
                (send gEgo:cel(0))
                = cycles 6
            )
            (case 7
                proc0_3()
                (send global2:newRoom(70))
            )
        )
    )

)
(instance climbDownStalk of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                proc0_11(2)
                proc0_11(0)
                (send gEgo:
                    illegalBits(0)
                    ignoreActors()
                    posn(144 2)
                    view(19)
                    setLoop(0)
                    cel(0)
                    setPri(14)
                    setStep(4 3)
                    moveSpeed(1)
                    cycleSpeed(1)
                    setCycle(SyncWalk)
                    setMotion(DPath 136 31 134 53 175 100 174 118 162 145 self)
                )
            )
            (case 1
                proc0_11(48)
                proc0_1()
                (send gEgo:
                    posn(162 147)
                    loop(3)
                )
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance bigStalk of NewFeature
    (properties
        x 159
        y 19
        noun 1106
        nsLeft 120
        nsBottom 143
        nsRight 196
        description 1150
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1156
    )

    (method (init param1)
        (super:init(rest param1))
        (send gFeatures:delete(self))
        (send gFeatures:addToFront(self))
    )

)
