(include "sci.sh")
(use "Main")
(use "Class_255_0")
(use "SQRoom")
(use "Osc")
(use "MCyc")
(use "Class_950_0")
(use "ForwardCounter")
(use "Rev")
(use "Sound")
(use "Cycle")
(use "IconI")
(use "PicView")
(use "Obj")
(script 341)


(local
    local0[29] = (5 0 86 157 5 0 82 156 5 0 78 155 5 0 79 151 5 0 80 148 5 0 81 144 5 0 84 144 32768 )
    local29[29] = (6 0 160 168 6 0 166 167 6 0 173 166 6 0 174 162 6 0 176 158 6 0 177 153 6 0 174 153 32768 )

)
(instance public rm341 of SQRoom
    (properties
        picture 341
        south 350
    )

    (method (init)
        proc0_14(10)
        (super:init())
        (rogerFace:init())
        (leftTentacle:
            init()
            setCycle(Rev)
        )
        (rightTentacle:
            init()
            setCycle(Osc)
        )
        (send global32:
            add(egoTorso activator belt lSpark rSpark light1 light2 tray egoLegs theArea)
            eachElementDo(102)
            doit()
        )
        (self:setScript(grabScript))
    )

)
(instance grabScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_3()
                (send gIconBar:disable(0))
                (grabScript:register(1))
                (rogerFace:setCel(3))
                = seconds 5
            )
            (case 1
                (belt:setCycle(End self))
                (rogerFace:setCel(2))
            )
            (case 2
                (rightTentacle:
                    setLoop(3)
                    setCel(0)
                    x(182)
                    y(86)
                    cycleSpeed(0)
                    setCycle(End)
                )
                (leftTentacle:
                    setLoop(2)
                    setCel(0)
                    x(109)
                    y(110)
                    cycleSpeed(0)
                    setCycle(End self)
                )
            )
            (case 3
                (grabScript:register(0))
                = seconds 8
            )
            (case 4
                (send global2:newRoom(350))
            )
        )
    )

)
(instance escapeScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (rogerFace:setCel(0))
                (hand:init())
                = seconds 2
            )
            (case 1
                (hand:dispose())
                (rightZap:
                    init()
                    setCycle(MCyc @local0)
                )
                (leftZap:
                    init()
                    setCycle(MCyc @local29 self)
                )
            )
            (case 2
                (rightZap:setCycle(ForwardCounter 7 self))
                (rSpark:
                    init()
                    setCycle(ForwardCounter 3)
                )
                (leftZap:setCycle(ForwardCounter 7))
                (lSpark:
                    init()
                    setCycle(ForwardCounter 3)
                )
            )
            (case 3
                proc0_11(46 5)
                = cycles 1
            )
            (case 4
                (rSpark:setCel(0))
                (rightTentacle:
                    setLoop(3)
                    setCel(0)
                    x(182)
                    y(86)
                    setCycle(Beg)
                )
                (leftTentacle:
                    setLoop(2)
                    setCel(0)
                    x(109)
                    y(110)
                    setCycle(Beg self)
                )
            )
            (case 5
                (rightTentacle:
                    x(182)
                    y(89)
                    loop(1)
                    cel(0)
                    setCycle(Osc)
                )
                (leftTentacle:
                    x(104)
                    y(109)
                    loop(0)
                    cel(0)
                    setCycle(Fwd)
                )
                = cycles 3
            )
            (case 6
                (send global2:newRoom(335))
            )
        )
    )

)
(instance rogerFace of Prop
    (properties
        x 159
        y 40
        description "Roger"
        sightAngle 180
        lookStr "Roger Wilco, space guy."
        view 340
        loop 3
        cel 4
    )

    (method (doVerb param1)
        (asm
            lsp     param1
            pushi   #doVerb
            pushi   1
            lsp     param1
            super   Prop, 6
            toss    
            ret     
        )
    )

)
(instance aSound of Sound
    (properties
        number 141
    )
)
(instance rightZap of Prop
    (properties
        x 150
        y 150
        description "laser"
        sightAngle 90
        lookStr "ACME laser nodes, for all your torture needs."
        view 340
        loop 6
        priority 7
        signal 16
    )
)
(instance leftZap of Prop
    (properties
        x 130
        y 150
        description "laser"
        sightAngle 90
        lookStr "ACME laser nodes for all your torture needs."
        view 340
        loop 5
        priority 7
        signal 16
    )
)
(instance belt of Prop
    (properties
        x 145
        y 82
        description "restraint"
        sightAngle 90
        lookStr "It's a Mantrap restraint system."
        view 340
        loop 8
        cycleSpeed 1
    )

    (method (doVerb param1)
        (asm
            lsp     param1
            pushi   #doVerb
            pushi   1
            lsp     param1
            super   Prop, 6
            toss    
            ret     
        )
    )

)
(instance hand of Prop
    (properties
        x 118
        y 80
        view 340
        loop 4
        priority 8
    )
)
(instance leftTentacle of Prop
    (properties
        x 104
        y 109
        description "tentacle"
        sightAngle 90
        lookStr "It's a slimy slug tongue."
        view 341
        cycleSpeed 1
    )

    (method (doVerb param1)
        (asm
            lsp     param1
            pushi   #doVerb
            pushi   1
            lsp     param1
            super   Prop, 6
            toss    
            ret     
        )
    )

)
(instance rightTentacle of Prop
    (properties
        x 182
        y 89
        description "tentacle"
        sightAngle 90
        lookStr "It's a slimy slug tongue."
        view 341
        loop 1
        cycleSpeed 1
    )

    (method (doVerb param1)
        (asm
            lsp     param1
            pushi   #doVerb
            pushi   1
            lsp     param1
            super   Prop, 6
            toss    
            ret     
        )
    )

)
(instance activator of Feature
    (properties
        x 86
        y 79
        nsTop 76
        nsLeft 79
        nsBottom 82
        nsRight 93
        description "laser activator"
        sightAngle 180
        lookStr "This switch activates a laser."
    )

    (method (doVerb param1)
        (switch (param1)
            (case 2
                (if ((grabScript:register))
                    Print("Desperately you try to push the button\nbut the restraints are just too tight!")
                )(else
                    proc0_2()
                    (send global2:setScript(escapeScript))
                )
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance light1 of Feature
    (properties
        x 104
        y 14
        nsLeft 79
        nsBottom 28
        nsRight 130
        description "surgical lights"
        sightAngle 180
        lookStr "Hot lights glare in your face and make you very uncomfortable."
    )

    (method (doVerb param1)
        (asm
            lsp     param1
            pushi   #doVerb
            pushi   1
            lsp     param1
            super   Feature, 6
            toss    
            ret     
        )
    )

)
(instance light2 of Feature
    (properties
        x 225
        y 17
        nsLeft 201
        nsBottom 34
        nsRight 250
        description "surgical lights"
        sightAngle 180
        lookStr "Hot lights glare in your face and make you very uncomfortable."
    )

    (method (doVerb param1)
        (asm
            lsp     param1
            pushi   #doVerb
            pushi   1
            lsp     param1
            super   Feature, 6
            toss    
            ret     
        )
    )

)
(instance tray of Feature
    (properties
        x 223
        y 71
        nsTop 62
        nsLeft 198
        nsBottom 80
        nsRight 249
        description "surgical tray"
        sightAngle 180
        lookStr "Shiny stainless steel instruments cover the surgical tray. Some of them look vaguely familiar as veterinary instruments."
    )

    (method (doVerb param1)
        (asm
            lsp     param1
            pushi   #doVerb
            pushi   1
            lsp     param1
            super   Feature, 6
            toss    
            ret     
        )
    )

)
(instance rSpark of Prop
    (properties
        x 166
        y 136
        view 28
    )

    (method (doit param1)
        (super:doit(rest param1))
        (if (not (IconBar:state) and (== cel 1))
            (aSound:play())
        )
    )

)
(instance lSpark of Prop
    (properties
        x 94
        y 125
        view 28
        priority 10
        signal 16
    )
)
(instance egoTorso of Feature
    (properties
        x 147
        y 69
        nsTop 42
        nsLeft 121
        nsBottom 89
        nsRight 201
        description "Roger"
        sightAngle 180
        lookStr "Roger Wilco, space guy."
    )

    (method (doVerb param1)
        (asm
            lsp     param1
            pushi   #doVerb
            pushi   1
            lsp     param1
            super   Feature, 6
            toss    
            ret     
        )
    )

)
(instance theArea of Feature
    (properties
        x 156
        nsBottom 200
        nsRight 320
        description "sea cave"
        sightAngle 180
        lookStr "You are in a crude state-of-the-art sea cave."
    )

    (method (doVerb param1)
        (asm
            lsp     param1
            pushi   #doVerb
            pushi   1
            lsp     param1
            super   Feature, 6
            toss    
            ret     
        )
    )

)
(instance egoLegs of Feature
    (properties
        x 130
        y 133
        nsTop 79
        nsLeft 96
        nsBottom 186
        nsRight 168
        description "Roger"
        sightAngle 180
        lookStr "Roger Wilco, space guy."
    )

    (method (doVerb param1)
        (asm
            lsp     param1
            pushi   #doVerb
            pushi   1
            lsp     param1
            super   Feature, 6
            toss    
            ret     
        )
    )

)
