(include "sci.sh")
(use "Main")
(use "rmnScript")
(use "SQRoom")
(use "RandCycle")
(use "MCyc")
(use "Class_950_0")
(use "Sound")
(use "Cycle")
(use "PicView")
(script 340)


(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 175 158 6 0 176 153 6 0 172 153 32768 )

)
(instance public rm340 of SQRoom
    (properties
        picture 340
    )

    (method (init)
        (super:init())
        (zondraArm:init())
        (rogerFace:init())
        (zondraFace:init())
        (rogerLegs:init())
        (rightZap:init())
        (leftZap:init())
        (pantsSfx:init())
        (theArea:init())
        (self:setScript(tortureScript))
    )

)
(instance tortureScript of rmnScript
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                = seconds 3
            )
            (case 1
                (send gLongSong:hold(3))
                (zondraFace:
                    init()
                    setCycle(RandCycle)
                )
                (self:save1(proc0_12("\"Comfy, Mr. Wilco?\"" 67 2 1 28 proc0_18(global153 global152) 29 global129 30 1 70 315)))
                = seconds 5
            )
            (case 4
                (rogerFace:setCel(2))
                (zondraArm:
                    cycleSpeed(1)
                    setCycle(End)
                )
                = cycles 3
            )
            (case 5
                (zondraArm:setCycle(Beg))
                (rightZap:setCycle(MCyc @local29))
                (leftZap:setCycle(MCyc @local0 self))
            )
            (case 6
                = start state
                (rogerFace:setCel(3))
                (rightZap:setCycle(Beg))
                (aSound:
                    init()
                    play()
                )
                (leftZap:setCycle(Beg self))
                = cycles 5
            )
            (case 7
                (if (< ++register 5)
                    (self:init())
                )(else
                    (aSound:stop())
                    (pantsSfx:play())
                    (rogerLegs:setCycle(End))
                )
            )
            (case 8
                = cycles 1
            )
            (case 9
                (rogerFace:setCycle(RandCycle 4))
                (self:save1(proc0_12("\"Hey! What are you doing?\"" 67 2 1 28 global140 29 global129 30 1 70 315)))
                = seconds 6
            )
            (case 11
                (rogerFace:setCycle(RandCycle 4))
                (self:save1(proc0_12("\"Let me go b. . . witch!\"" 67 2 1 28 global140 29 global129 30 1 70 315)))
                = seconds 6
            )
            (case 13
                (zondraFace:setCycle(RandCycle))
                (self:save1(proc0_12("\"Shut up! Your whimpering sickens me!\"" 67 2 1 28 proc0_18(global153 global152) 29 global129 30 1 70 315)))
                = seconds 8
            )
            (case 15
                (zondraFace:setCycle(RandCycle))
                (self:save1(proc0_12("\"I'll teach you not to run out on ME!\"" 67 2 1 28 proc0_18(global153 global152) 29 global129 30 1 70 315)))
                = seconds 7
            )
            (case 17
                (zondraFace:setCycle(RandCycle))
                (self:save1(proc0_12("\"Thoreen is quite knowledgeable in the ways of torture.\"" 67 2 1 28 proc0_18(global153 global152) 29 global129 30 1 70 315)))
                = seconds 8
            )
            (case 19
                (zondraFace:setCycle(RandCycle))
                (self:save1(proc0_12("\"I'll let you two get acquainted. Thoreen, do your stuff.\"" 67 2 1 28 proc0_18(global153 global152) 29 global129 30 1 70 315)))
                = seconds 8
            )
            (case 21
                (thoreenFace:
                    init()
                    setCycle(RandCycle 10)
                )
                (self:save1(proc0_12("\"With PLEASURE, Zondra.\"" 67 2 1 28 global130 29 global155 30 1 70 315)))
                = seconds 6
            )
            (case 23
                (send global2:newRoom(345))
            )
            (default 
                (self:restore())
                (rogerFace:setCycle(0))
                (zondraFace:setCycle(0))
                (thoreenFace:setCycle(0))
                = cycles 1
            )
        )
    )

)
(instance thoreenFace of Prop
    (properties
        x 271
        y 34
        view 340
        loop 2
    )
)
(instance aSound of Sound
    (properties
        number 141
        loop -1
    )
)
(instance pantsSfx of Sound
    (properties
        number 151
    )
)
(instance zondraFace of Prop
    (properties
        x 50
        y 40
        view 340
        loop 1
    )

    (method (setCycle param1)
        (if (cel)
            (self:cel(0))
        )
        (super:setCycle(rest param1))
    )

)
(instance zondraArm of Prop
    (properties
        x 35
        y 38
        view 340
    )
)
(instance rogerFace of Prop
    (properties
        x 159
        y 40
        view 340
        loop 3
    )
)
(instance rogerLegs of Prop
    (properties
        x 136
        y 94
        view 340
        loop 7
        priority 10
        signal 16
    )
)
(instance rightZap of Prop
    (properties
        x 150
        y 168
        description "laser"
        view 340
        loop 6
        priority 7
        signal 16
    )
)
(instance leftZap of Prop
    (properties
        x 130
        y 166
        description "laser"
        view 340
        loop 5
        priority 7
        signal 16
    )
)
(instance theArea of Feature
    (properties
        x 156
        y 10
        nsBottom 200
        nsRight 320
        description "sea cave"
        sightAngle 180
        lookStr "How do I get into these situations?"
    )

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

)
