(include "sci.sh")
(use "Main")
(use "SQRoom")
(use "MCyc")
(use "Class_950_0")
(use "ForwardCounter")
(use "n958")
(use "Sound")
(use "Cycle")
(use "PicView")
(use "Obj")
(script 350)


(local
    local0[41] = (3 3 177 138 3 0 177 138 3 1 177 138 3 1 177 144 3 1 177 148 3 1 177 158 3 1 177 168 3 1 177 178 3 1 177 188 0 0 65436 65436 32768 )
    local41[41] = (0 0 135 110 0 1 135 110 0 2 135 110 0 3 135 110 0 4 135 110 3 0 162 104 3 1 160 104 3 2 158 104 3 3 156 104 3 4 154 104 32768 )
    local82[41] = (1 0 135 110 1 1 135 110 1 2 135 110 1 3 135 110 1 4 135 110 2 0 162 104 2 1 160 104 2 2 158 104 2 3 156 104 2 4 154 104 32768 )

)
(instance public rm350 of SQRoom
    (properties
        picture 350
    )

    (method (init)
        proc0_14(10)
        proc958_0(128 350 351 338)
        proc958_0(132 140 103 840)
        (bSound:init())
        (theMaw:init())
        (switch (global12)
            (case 341
                (rogerTongue:init())
                (self:setScript(dieScript))
                (mouth:init())
                (finDrip:
                    init()
                    setScript(finDripScript)
                )
            )
            (case 335
                (if (proc0_6(4))
                    (rogerTongue:init())
                    (self:setScript(dieScript))
                    (mouth:init())
                    (finDrip:
                        init()
                        setScript(finDripScript)
                    )
                    (headSwell:init())
                    (steam:init())
                )(else
                    (mouth:init())
                    (egoStruggle:
                        init()
                        setCycle(Fwd)
                    )
                    (finDrip:
                        init()
                        setScript(finDripScript)
                    )
                    (eye:
                        init()
                        setPri(13)
                        setScript(grabEgoScript)
                    )
                    (headSwell:init())
                    (steam:init())
                )
            )
            (default 
                (mouth:init())
                (super:init())
                (egoStruggle:
                    init()
                    setCycle(Fwd)
                )
                (finDrip:
                    init()
                    setScript(finDripScript)
                )
                (eye:
                    init()
                    setPri(13)
                    setScript(grabEgoScript)
                )
            )
        )
        (super:init())
    )

)
(instance grabEgoScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (mouth:setCycle(End self))
            )
            (case 1
                (spit:
                    init()
                    setPri(12)
                    setCycle(MCyc @local0)
                )
                (eye:cel(1))
                (tentacles:
                    init()
                    setCycle(Fwd self)
                )
                = seconds 5
            )
            (case 2
                (tentacles:dispose())
                (mouth:setCycle(End self))
            )
            (case 3
                (spit:setCycle(MCyc @local0))
                (eye:cel(0))
                (tongue:
                    init()
                    setCycle(End self)
                )
            )
            (case 4
                (send global2:newRoom(341))
            )
        )
    )

)
(instance dieScript of Script
    (properties)

    (method (doit)
        (super:doit())
        (if ((== (self:state) 2) and (== (mouth:cel) 0))
            (aSound:playBed())
        )
    )


    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (mouth:setCel(3))
                (if (== (send ((send global9:at(7))):owner) gEgo)
                    (self:setScript(feedSlugScript))
                )(else
                    proc0_2()
                    (rogerTongue:setCycle(MCyc @local41 self))
                )
            )
            (case 1
                proc0_3()
                (rogerTongue:dispose())
                = cycles 1
            )
            (case 2
                (send gLongSong:stop())
                (aSound:init())
                (mouth:setCycle(ForwardCounter 8 self))
            )
            (case 3
                (mouth:setCycle(Beg self))
            )
            (case 4
                (aSound:dispose())
                = cycles 5
            )
            (case 5
                (cSound:init())
                (mouth:setCycle(Beg))
                (cSound:play())
                = seconds 3
            )
            (case 6
                proc0_10(4 0)
            )
        )
    )

)
(instance feedSlugScript of Script
    (properties)

    (method (doit)
        (super:doit())
        (if ((== (self:state) 3) and (== (mouth:cel) 0))
            (aSound:playBed())
        )
    )


    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (rogerTongue:setCycle(MCyc @local82 self))
            )
            (case 1
                proc0_3()
                (rogerTongue:
                    setLoop(2)
                    cel(0)
                    setCycle(Fwd)
                )
                = seconds 7
            )
            (case 2
                proc0_2()
                (tongue:dispose())
                (rogerTongue:dispose())
                = cycles 1
                (aSound:init())
            )
            (case 3
                (send gLongSong:stop())
                (mouth:setCycle(ForwardCounter 4 self))
            )
            (case 4
                (mouth:setCycle(Beg self))
            )
            (case 5
                (aSound:dispose())
                (headSwell:z(0))
                (mouth:dispose())
                (steam:z(0))
                = cycles 5
            )
            (case 6
                (steam:setCycle(ForwardCounter 3 self))
                (bSound:play())
            )
            (case 7
                proc0_10(4 27)
            )
        )
    )

)
(instance throwTankScript of Script
    (properties)

    (method (doit)
        (super:doit())
        (if ((== (self:state) 2) and (== (mouth:cel) 0))
            (aSound:playBed())
        )
    )


    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (rogerTongue:
                    setCycle(0)
                    setLoop(4)
                    x(167)
                    y(132)
                    setCycle(End self)
                )
                (send gEgo:put(7))
            )
            (case 1
                proc0_11(48 5)
                (tongue:dispose())
                (mouth:setCycle(Beg))
                (rogerTongue:
                    x(225)
                    y(136)
                    setLoop(5)
                    setCycle(End self)
                )
                (aSound:init())
            )
            (case 2
                (send gLongSong:stop())
                (mouth:setCycle(ForwardCounter 2 self))
            )
            (case 3
                (aSound:dispose())
                (headSwell:z(0))
                (mouth:dispose())
                (steam:z(0))
                = cycles 5
            )
            (case 4
                (steam:setCycle(ForwardCounter 3 self))
                (bSound:play())
            )
            (case 5
                (send global2:newRoom(335))
            )
        )
    )

)
(instance finDripScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (finDrip:setCycle(Fwd))
                = cycles 5
            )
        )
    )

)
(instance theMaw of Feature
    (properties
        x 151
        y 97
        nsTop 63
        nsLeft 121
        nsBottom 131
        nsRight 182
        description "slug mandibles"
        sightAngle 90
        lookStr "It's the slug's intake orifice. Looks pretty disgusting, don't you think?"
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 3
                (switch (param2)
                    (case 7
                        (if (== (send ((send global9:at(7))):owner) gEgo)
                            (send global2:setScript(throwTankScript))
                        )(else
                            (super:doVerb(param1))
                        )
                    )
                    (default 
                        (super:doVerb(param1))
                    )
                )
            )
        )
    )

)
(instance aSound of Sound
    (properties
        number 140
    )
)
(instance bSound of Sound
    (properties
        number 103
        vol 100
    )
)
(instance cSound of Sound
    (properties
        number 840
    )
)
(instance egoStruggle of Prop
    (properties
        x 292
        y 97
        view 350
    )
)
(instance mouth of Prop
    (properties
        x 148
        y 101
        description "slug tongue"
        sightAngle 180
        lookStr "My, this slug has a very dexterous mouth."
        view 350
        loop 1
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 2
            )
            (case 3
                (theMaw:doVerb(param1 param2))
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance finDrip of Prop
    (properties
        x 13
        y 187
        description "Drip"
        lookStr "Sea water and slug slime slowly ooze down the fin of this hideous creature."
        view 350
        loop 2
        cycleSpeed 2
    )
)
(instance spit of Prop
    (properties
        x 177
        y 138
        description " slug slobber"
        lookStr "It's slug spit! Looks appetizing, huh."
        view 350
        loop 3
        cycleSpeed 1
    )
)
(instance eye of Prop
    (properties
        x 144
        y 82
        description "Red eye"
        lookStr "Staring contests were never your thing."
        view 350
        loop 4
        priority 13
    )
)
(instance tongue of Prop
    (properties
        x 157
        y 99
        description "tentacles"
        lookStr "These things look like they have a life of their own."
        view 350
        loop 6
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 2
            )
            (case 3
                (theMaw:doVerb(param1 param2))
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance tentacles of Prop
    (properties
        x 157
        y 96
        description "tentacles"
        lookStr "These things look like they have a life of their own."
        view 350
        loop 7
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 2
            )
            (case 3
                (theMaw:doVerb(param1 param2))
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance rogerTongue of Actor
    (properties
        x 135
        y 110
        description "tentacles"
        lookStr "Feels like being licked by a large dog with incredibly bad breath."
        view 351
        priority 4
        signal 16
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 2
            )
            (case 3
                (theMaw:doVerb(param1 param2))
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance headSwell of Prop
    (properties
        x 150
        y 142
        z 1000
        description "Swollen slug head"
        sightAngle 180
        lookStr "It looks like the internal pressure of the slug is starting to exceed its external strength."
        view 338
        priority 13
        signal 16400
    )
)
(instance steam of Prop
    (properties
        x 186
        y 92
        z 1000
        description "Steam"
        sightAngle 180
        lookStr "Better take cover. It looks like slimey slug guts are gonna fly."
        view 338
        loop 1
        priority 13
        signal 16400
    )
)
