(include "sci.sh")
(use "Main")
(use "VelocityMover")
(use "genetix")
(use "Scaler")
(use "CueObj")
(use "Cycle")
(use "Sounds")
(use "View")
(use "Obj")
(script 31)


(local
    local0[11] = (354 259 6 126 65516 65516 16 90 281 280 99 )
    local11[11] = (120 103 123 104 128 150 100 53 126 43 99 )
    local22[11] = (760 740 790 730 760 730 740 790 730 730 99 )

)
(procedure public (proc31_1 param1 param2)
    (send gEgo:
        view(600)
        init()
        signal(12290)
        posn(param1 param2)
        moveSpeed(0)
        ignoreActors(1)
        illegalBits(0)
        setLoop(1)
        setPri(15)
        cycleSpeed(2)
        setStep(7 7)
        setCycle(Fwd)
        setMotion(VelocityMover param1 param2 0 0)
        looper(0)
    )
    (switch ((send gRoom:picture))
        (case 116
            ((send gEgo:
                scaleSignal(| (send gEgo:scaleSignal) $0004)
                setScale(Scaler 64 17 139 24)
            )
  )
        )
        (case 112
            ((send gEgo:
                scaleSignal(| (send gEgo:scaleSignal) $0004)
                setScale(Scaler 64 17 139 24)
                setStep(8 8)
            )
  )
        )
        (case 110
            ((send gEgo:
                scaleSignal(| (send gEgo:scaleSignal) $0004)
                setScale(Scaler 64 17 139 24)
                setStep(3 3)
                moveSpeed(1)
            )
  )
        )
        (case 113
            ((send gEgo:
                scaleSignal(| (send gEgo:scaleSignal) $0004)
                setScale(Scaler 64 17 139 24)
                setStep(3 3)
                moveSpeed(0)
            )
 )
        )
    )
)


(procedure public (proc31_2 param1)
    (var temp0, temp1, temp2)
    = temp1 
        (switch ((= temp0 
            (if (< 150 param1)
                120
            )(else
                (if (< 100 param1)
                    33
                )(else
                    (if (< 59 param1)
                        32
                    )(else
                        31
                    )
                )
            )
))
            (case 31
                (17  )
            )
            (case 32
                (17  )
            )
            (case 33
                (17  )
            )
            (case 120
                (70 )
            )
        )
    = temp2 
        (switch (temp0)
            (case 31
                (
                (if (proc999_5((send gRoom:picture) 112 116))
                    9
                )(else
                    13
                )
 )
            )
            (case 32
                (
                (if (proc999_5((send gRoom:picture) 112 116))
                    9
                )(else
                    13
                )
 )
            )
            (case 33
                (13  )
            )
            (case 120
                (15 )
            )
        )
    (send gEgo:
        setScale(Scaler temp0 temp1 167 80)
        setPri(temp2)
    )
)


(class genetix of Rgn
    (properties
        script 0
        number 0
        modNum -1
        noun 0
        timer 0
        keep 0
        initialized 0
    )

    (method (dispose param1)
        (send gSq5Music1:stop())
        (send gSq5Music2:stop())
        (super:dispose(rest param1))
    )


    (method (newRoom param1)
        = keep proc999_5(param1 730 740 750 760 770 790)
        = initialized 0
        (super:newRoom(param1))
    )

)
(instance public sGenInNout of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gEgo:setMotion(MoveTo local0[register] local11[(send gSQ5:handsOff())] self))  )
            )
            (case 1
                (
                (if (proc0_1(23) and proc999_5((send gRoom:curPic) 110 112 113))
                    = seconds 2
                )(else
                    = cycles 2
                )
 )
            )
            (case 2
                (
                (if (== gRoom local22[register])
                    (send gSQ5:handsOn())
                    (self:dispose())
                )(else
                    (send gSQ5:handsOn())
                    (send gRoom:newRoom(local22[register]))
                )
 )
            )
        )
    )

)
(class MyFeature of Feature
    (properties
        x 0
        y 0
        z 0
        heading 0
        noun 0
        modNum -1
        nsTop 0
        nsLeft 0
        nsBottom 0
        nsRight 0
        sightAngle 26505
        actions 0
        onMeCheck 26505
        state 0
        approachX 0
        approachY 0
        approachDist 0
        _approachVerbs 0
    )

    (method (init)
        (var theOnMeCheck)
        = theOnMeCheck onMeCheck
        (super:init())
        (self:setOnMeCheck(1 theOnMeCheck))
    )


    (method (handleEvent pEvent param2)
        return 
            (if ((send pEvent:claimed))
                return 1
            )(else
                (if (not proc0_1(22))
                    (super:handleEvent(pEvent rest param2))
                )(else
                    (if ((((& (send pEvent:type) $4000) and (self:onMe(pEvent))) and (self:isNotHidden())) and proc0_1(22))
                        (send pEvent:claimed(1))
                        (self:doVerb((send pEvent:message)))
                        return (send pEvent:claimed)
                    )
                )
            )
    )

)
(class MyProp of Prop
    (properties
        x 0
        y 0
        z 0
        heading 0
        noun 0
        modNum -1
        nsTop 0
        nsLeft 0
        nsBottom 0
        nsRight 0
        sightAngle 26505
        actions 0
        onMeCheck 26505
        state 0
        approachX 0
        approachY 0
        approachDist 0
        _approachVerbs 0
        yStep 2
        view -1
        loop 0
        cel 0
        priority 0
        underBits 0
        signal 0
        lsTop 0
        lsLeft 0
        lsBottom 0
        lsRight 0
        brTop 0
        brLeft 0
        brBottom 0
        brRight 0
        scaleSignal 0
        scaleX 128
        scaleY 128
        maxScale 128
        cycleSpeed 6
        script 0
        cycler 0
        timer 0
        detailLevel 0
        scaler 0
    )

    (method (handleEvent pEvent param2)
        return 
            (if ((send pEvent:claimed))
                return 1
            )(else
                (if (not proc0_1(22))
                    (super:handleEvent(pEvent rest param2))
                )(else
                    (if ((((& (send pEvent:type) $4000) and (self:onMe(pEvent))) and (self:isNotHidden())) and proc0_1(22))
                        (send pEvent:claimed(1))
                        (self:doVerb((send pEvent:message)))
                        return (send pEvent:claimed)
                    )
                )
            )
    )

)
(class MyActor of Actor
    (properties
        x 0
        y 0
        z 0
        heading 0
        noun 0
        modNum -1
        nsTop 0
        nsLeft 0
        nsBottom 0
        nsRight 0
        sightAngle 26505
        actions 0
        onMeCheck 26505
        state 0
        approachX 0
        approachY 0
        approachDist 0
        _approachVerbs 0
        yStep 2
        view -1
        loop 0
        cel 0
        priority 0
        underBits 0
        signal 0
        lsTop 0
        lsLeft 0
        lsBottom 0
        lsRight 0
        brTop 0
        brLeft 0
        brBottom 0
        brRight 0
        scaleSignal 0
        scaleX 128
        scaleY 128
        maxScale 128
        cycleSpeed 6
        script 0
        cycler 0
        timer 0
        detailLevel 0
        scaler 0
        illegalBits 32768
        xLast 0
        yLast 0
        xStep 3
        origStep 770
        moveSpeed 6
        blocks 0
        baseSetter 0
        mover 0
        looper 0
        viewer 0
        avoider 0
        code 0
    )

    (method (handleEvent pEvent param2)
        return 
            (if ((send pEvent:claimed))
                return 1
            )(else
                (if (not proc0_1(22))
                    (super:handleEvent(pEvent rest param2))
                )(else
                    (if ((((& (send pEvent:type) $4000) and (self:onMe(pEvent))) and (self:isNotHidden())) and proc0_1(22))
                        (send pEvent:claimed(1))
                        (self:doVerb((send pEvent:message)))
                        return (send pEvent:claimed)
                    )
                )
            )
    )

)
(instance cliffy of MyActor
    (properties
        noun 1
        view 20
        signal 16384
    )
)
