(include "sci.sh")
(use "Main")
(use "PriorityTalker")
(use "Sound")
(use "Cycle")
(use "View")
(use "Obj")
(script 209)



(instance theMusic3 of Sound
    (properties)
)
(instance public sStartViewPort of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((viewPort:
                    init()
                    setCycle(End self)
                )
  )
            )
            (case 1
                ((viewPort:
                    view(register)
                    setLoop(0)
                    setCel(0)
                    setCycle(0)
                    stopUpd()
                )
 (theMusic3:dispose()) = seconds 2  )
            )
            (case 2
                ((self:dispose()) )
            )
        )
    )

)
(instance public sStopViewPort of Script
    (properties)

    (method (dispose param1)
        (super:dispose(rest param1))
        DisposeScript(209)
    )


    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (
                (if (== (viewPort:view) 210)
                    ++state
                )
 = cycles 1  )
            )
            (case 1
                ((viewPort:
                    view(205)
                    setLoop(1)
                    cel(0)
                    setCycle(0)
                )
 = seconds 2  )
            )
            (case 2
                ((viewPort:
                    view(205)
                    setLoop(0)
                    cel(1)
                    setCycle(End self)
                )
  )
            )
            (case 3
                ((theMusic3:dispose()) (viewPort:
                    view(193)
                    setLoop(0)
                    cel(0)
                    setCycle(End self)
                )
  )
            )
            (case 4
                (UnLoad(128 205) = seconds 1  )
            )
            (case 5
                ((viewPort:dispose()) = seconds 1  )
            )
            (case 6
                ((self:dispose()) )
            )
        )
    )

)
(instance public viewPort of Prop
    (properties
        x 110
        y 43
        view 205
        priority 7
        signal 16401
    )

    (method (init param1)
        (self:
            setLoop(0)
            setCel(0)
        )
        (super:init(rest param1))
    )


    (method (setCycle param1 param2)
        (if (param1 and (== view 205))
            (theMusic3:
                number(222)
                loop(1)
                play()
            )
        )
        (super:setCycle(param1 rest param2))
    )

)
(instance public viewPortTalker of PriorityTalker
    (properties
        x 110
        y 43
        view 207
        priority 7
        signal 16401
        talkWidth 100
    )

    (method (init param1)
        (self:setPri(7))
        = font gFont
        (send (= gSq5Win gNewSpeakWindow):
            tailX(225)
            tailY(85)
            xOffset(40)
            isBottom(1)
        )
        (switch (global122)
            (case 24
                ((self:
                    view(207)
                    loop(0)
                )
 (super:init(0 wd40Eyes 0 rest param1))  )
            )
            (case 25
                (
                (switch (global142)
                    (case 0
                        (
                        (if ((== gEurekaCurLocation 5) and proc0_1(93))
                            (send gSq5Win:tailY(100))
                        )
 (self:
                            view(209)
                            loop(0)
                            cel(0)
                        )
 (quirkEyes:
                            view(209)
                            loop(2)
                            cel(0)
                            nsLeft(37)
                            nsTop(16)
                        )
 (quirkMouth:
                            view(209)
                            loop(1)
                            cel(0)
                            nsLeft(37)
                            nsTop(39)
                        )
  )
                    )
                    (case 1
                        ((self:
                            view(210)
                            loop(0)
                            cel(0)
                        )
 (quirkEyes:
                            view(210)
                            loop(3)
                            cel(0)
                            nsLeft(32)
                            nsTop(25)
                        )
 (quirkMouth:
                            view(210)
                            loop(1)
                            cel(0)
                            nsLeft(33)
                            nsTop(43)
                        )
  )
                    )
                    (case 2
                        ((self:
                            view(204)
                            loop(0)
                            cel(0)
                        )
 (quirkEyes:
                            view(204)
                            loop(2)
                            cel(0)
                            nsLeft(22)
                            nsTop(11)
                        )
 (quirkMouth:
                            view(204)
                            loop(1)
                            cel(0)
                            nsLeft(23)
                            nsTop(29)
                        )
 )
                    )
                )
 (super:init(0 quirkEyes quirkMouth rest param1))  )
            )
            (case 47
                ((self:
                    view(208)
                    loop(0)
                    cel(0)
                )
 (super:init(0 0 alienMouth rest param1)) )
            )
        )
    )


    (method (dispose param1)
        = gSq5Win gSq5Win_2
        (super:dispose(rest param1))
    )

)
(instance wd40Eyes of Prop
    (properties
        nsTop 27
        nsLeft 32
        view 207
        loop 1
        priority 7
        signal 16401
    )

    (method (init param1)
        (self:setPri(7))
        (super:init(rest param1))
    )

)
(instance alienMouth of Prop
    (properties
        nsTop 34
        nsLeft 20
        view 208
        loop 1
        priority 7
        signal 16401
    )

    (method (init param1)
        (self:
            setPri(7)
            ignoreActors(1)
        )
        (super:init(rest param1))
    )

)
(instance quirkMouth of Prop
    (properties
        nsTop 39
        nsLeft 37
        view 209
        loop 1
        priority 7
        signal 16401
    )
)
(instance quirkEyes of Prop
    (properties
        nsTop 16
        nsLeft 37
        view 209
        loop 2
        priority 7
        signal 16401
    )
)
