(include "sci.sh")
(use "Main")
(use "AnimDialog")
(use "SpeakWindow")
(use "Blink")
(use "Scaler")
(use "Osc")
(use "n958")
(use "Cycle")
(use "Sounds")
(use "View")
(use "Obj")
(script 1040)



(instance public rm1040 of Rm
    (properties
        picture 128
        style 32778
    )

    (method (init)
        proc958_0(128 688 696 697 687 0)
        proc0_6(0)
        (switch (gGModNum)
            (case 1020
                ((send gRoom:setScript(sRogCaught))  )
            )
            (case 1045
                ((send gRoom:setScript(sFollowWD40))  )
            )
            (case 1050
                ((send gRoom:setScript(sBlobOutside))  )
            )
            (default 
                ((send gRoom:setScript(sGetAway)) )
            )
        )
        (super:init())
        (send gSq5Music2:
            number(654)
            setLoop(-1)
            play()
        )
    )

)
(instance sGetAway of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (rogHead:
                    x(3)
                    y(63)
                    init()
                )
 (droole:
                    init()
                    setCycle(Osc)
                )
 (flo:
                    init()
                    setCycle(Osc)
                )
 = seconds 3  )
            )
            (case 1
                (
                (if (proc0_1(84))
                    (send gTestMessager:say(7 0 0 0 self))
                )(else
                    ++state
                    = cycles 1
                )
 )
            )
            (case 2
                ((send gRoom:newRoom(1060)) (self:dispose())  )
            )
            (case 3
                ((send gTestMessager:say(2 0 0 0 self))  )
            )
            (case 4
                ((blob:
                    view(697)
                    loop(2)
                    cel(0)
                    x(280)
                    y(71)
                    init()
                    setCycle(CT 7 1 self)
                )
 (exAct1:
                    view(697)
                    loop(1)
                    cel(0)
                    x(199)
                    y(72)
                    init()
                    setCycle(CT 7)
                )
  )
            )
            (case 5
                ((blob:setCycle(End self)) (exAct1:setCycle(End)) (ooze3:
                    init()
                    setCycle(End)
                )
  )
            )
            (case 6
                (ShakeScreen(5 2) = seconds 2  )
            )
            (case 7
                (Joystick(0 2100 1) = seconds 2  )
            )
            (case 8
                (proc0_9(44) )
            )
        )
    )

)
(instance sRogCaught of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (pukoid1:init()) (pukoid2:init()) (pukoid3:init()) (pukoid4:init()) (pukoid5:init()) (pukoid6:init()) (pukoid7:init()) (quirk:init()) (quirkArm:init()) (quirkPuke:init()) = seconds 2  )
            )
            (case 1
                ((pukoid1:setCycle(End self))  )
            )
            (case 2
                ((pukoid1:
                    setLoop(1)
                    setCel(0)
                    setCycle(CT 4 1 self)
                )
  )
            )
            (case 3
                ((quirkPuke:setCycle(End)) (send gEgo:
                    view(0)
                    setLoop(-1)
                    setLoop(8)
                    setScale(0)
                    cel(2)
                    x(176)
                    y(148)
                    setCycle(0)
                    init()
                )
 (pukoid1:setCycle(End self))  )
            )
            (case 4
                ((send gTestMessager:say(8 0 0 1 self))  )
            )
            (case 5
                ((send gTestMessager:say(8 0 0 2 self))  )
            )
            (case 6
                ((quirk:setCel(1)) (quirkArm:
                    loop(2)
                    x(140)
                    y(162)
                )
 (quirkPuke:
                    loop(1)
                    cel(0)
                    x(171)
                    y(158)
                    setCycle(End self)
                )
  )
            )
            (case 7
                ((send gTestMessager:say(8 0 0 3 self))  )
            )
            (case 8
                ((send gTestMessager:say(8 0 0 4 self))  )
            )
            (case 9
                (
                (if (not proc0_1(234))
                    (send gTestMessager:say(9 0 0 0 self))
                )(else
                    (send gSq5Music2:
                        number(260)
                        setLoop(1)
                        play()
                    )
                    (wd40:
                        init()
                        setCycle(End self)
                    )
                )
 )
            )
            (case 10
                (
                (if (not proc0_1(234))
                    proc0_9(49)
                )(else
                    (send gSq5Music1:
                        number(35)
                        setLoop(-1)
                        play()
                    )
                    (pukoid1:
                        loop(2)
                        cel(0)
                        setCycle(CT 2 1)
                    )
                    (pukoid2:setCycle(CT 2 1))
                    (pukoid3:setCycle(CT 2 1))
                    (pukoid4:setCycle(CT 2 1))
                    (pukoid5:setCycle(CT 2 1))
                    (pukoid6:setCycle(CT 2 1))
                    (pukoid7:setCycle(CT 2 1))
                    (send gEgo:
                        view(688)
                        setLoop(-1)
                        setLoop(3)
                        setCycle(End self)
                    )
                )
 )
            )
            (case 11
                ((send gRoom:newRoom(1045)) )
            )
        )
    )

)
(instance sBlobOutside of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (blob:
                    init()
                    setCycle(Osc)
                )
 = seconds 3  )
            )
            (case 1
                ((send gSq5Music2:
                    number(103)
                    setLoop(1)
                    play()
                )
 = seconds 2  )
            )
            (case 2
                ((send gSq5Music2:
                    number(654)
                    setLoop(-1)
                    play()
                )
 (send gEgo:
                    init()
                    hide()
                )
 (rogHead:
                    init()
                    setCycle(0)
                    setLoop(-1)
                    setLoop(4)
                    setMotion(MoveTo 3 63 self)
                )
  )
            )
            (case 3
                (= seconds 2  )
            )
            (case 4
                ((send gSq5Music2:
                    number(603)
                    setLoop(1)
                    play(self)
                )
  )
            )
            (case 5
                ((send gSq5Music2:
                    number(654)
                    setLoop(-1)
                    play()
                )
 (send gTestMessager:say(4 0 0 0 self))  )
            )
            (case 6
                ((shuttle:
                    init()
                    setLoop(1)
                    setCycle(0)
                    setScale(Scaler 100 48 120 99)
                    setMotion(MoveTo 189 109 self)
                )
  )
            )
            (case 7
                ((send gTestMessager:say(3 0 0 1 self))  )
            )
            (case 8
                ((shuttle:setMotion(MoveTo 205 102 self))  )
            )
            (case 9
                ((send gTestMessager:say(3 0 0 2 self))  )
            )
            (case 10
                ((shuttle:setMotion(MoveTo 211 99 self))  )
            )
            (case 11
                ((exAct1:
                    init()
                    setCycle(End self)
                )
  )
            )
            (case 12
                ((shuttle:dispose()) (blob:
                    loop(3)
                    cel(0)
                    x(220)
                    y(97)
                    setCycle(Osc 3 self)
                )
  )
            )
            (case 13
                ((exAct1:
                    view(696)
                    loop(4)
                    cel(0)
                    x(225)
                    y(87)
                    setCycle(End self)
                )
  )
            )
            (case 14
                ((send gTestMessager:say(3 0 0 3 self))  )
            )
            (case 15
                ((tkrFlo:
                    normal(0)
                    keepWindow(1)
                    textY(85)
                    curNoun(5)
                    curVerb(0)
                    curCase(1)
                )
 = cycles 1  )
            )
            (case 16
                ((send gSQ5:handsOn()) (send gSq5IconBar:select((send gSq5IconBar:at(2)))) (send gSQ5:setCursor(999)) (send gTestMessager:say(5 0 1 0 self))  )
            )
            (case 17
                ((send gSQ5:handsOff()) (tkrFlo:
                    normal(1)
                    textY(10)
                )
 
                (if (not (tkrFlo:whichSelect))
                    = state (- state 3)
                    = cycles 1
                )(else
                    (switch ((tkrFlo:whichSelect))
                        (case 1
                            (send gTestMessager:say(5 0 2 0 self))
                        )
                        (case 2
                            (send gTestMessager:say(5 0 3 0 self))
                        )
                        (case 3
                            (send gTestMessager:say(5 0 4 0 self))
                        )
                    )
                )
 )
            )
            (case 18
                ((exAct1:setCycle(Beg self))  )
            )
            (case 19
                ((exAct1:hide()) 
                (if (== (tkrFlo:whichSelect) 1)
                    (send gSq5Music1:fade(0 10 10 1))
                    proc0_10(250 20)
                    (send gRoom:newRoom(240))
                )(else
                    (blob:setMotion(MoveTo 225 49 self))
                )
 )
            )
            (case 20
                ((send gSq5Music2:
                    number(250)
                    setLoop(1)
                    play()
                )
 ShakeScreen(5 2) = seconds 2  )
            )
            (case 21
                ((blob:
                    view(697)
                    loop(2)
                    cel(0)
                    x(280)
                    y(71)
                    setCycle(CT 7 1 self)
                )
 (exAct1:
                    view(697)
                    loop(1)
                    cel(0)
                    x(199)
                    y(72)
                    show()
                    setCycle(CT 7)
                )
  )
            )
            (case 22
                ((blob:setCycle(End self)) (exAct1:setCycle(End)) (ooze3:
                    init()
                    setCycle(End)
                )
  )
            )
            (case 23
                (Joystick(0 2100 1) = seconds 4  )
            )
            (case 24
                (
                (if (== (tkrFlo:whichSelect) 2)
                    proc0_9(35)
                )(else
                    proc0_9(39)
                )
 )
            )
        )
    )

)
(instance sFollowWD40 of Script
    (properties)

    (method (doit param1)
        (super:doit(rest param1))
        (if (((< (wd40:x) 50) and (== (send gEgo:mover) 0)) and (== state 3))
            (self:cue())
        )
    )


    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (send gEgo:
                    view(688)
                    cel(0)
                    x(176)
                    y(148)
                    setLoop(-1)
                    setLoop(4)
                    init()
                    setCycle(End self)
                )
 (wd40:
                    view(688)
                    loop(1)
                    cel(0)
                    x(151)
                    y(147)
                    init()
                )
 (wd40head:
                    init()
                    setCycle(Fwd)
                )
 (pukoid1:
                    loop(2)
                    setCel((pukoid1:lastCel()))
                    init()
                )
 (pukoid2:
                    setCel((pukoid2:lastCel()))
                    init()
                )
 (pukoid3:
                    setCel((pukoid3:lastCel()))
                    init()
                )
 (pukoid4:
                    setCel((pukoid4:lastCel()))
                    init()
                )
 (pukoid5:
                    setCel((pukoid5:lastCel()))
                    init()
                )
 (pukoid6:
                    setCel((pukoid6:lastCel()))
                    init()
                )
 (pukoid7:
                    setCel((pukoid7:lastCel()))
                    init()
                )
 (cloud1:
                    init()
                    setCycle(Fwd)
                )
 (cloud2:
                    init()
                    setCycle(Fwd)
                )
 (cloud3:
                    init()
                    setCycle(Fwd)
                )
 (quirk:
                    cel(1)
                    init()
                )
 (quirkArm:
                    loop(2)
                    x(140)
                    y(162)
                    init()
                )
  )
            )
            (case 1
                ((send gTestMessager:say(6 0 0 0 self))  )
            )
            (case 2
                ((wd40:
                    loop(6)
                    cel(0)
                    setCycle(End self)
                )
 (wd40head:dispose()) (send gEgo:
                    setLoop(-1)
                    setLoop(7)
                    cel(0)
                    setCycle(End)
                )
 (send gSq5Music2:fade(0 10 10 1))  )
            )
            (case 3
                ((send gRoom:newRoom(1050)) (self:dispose()) )
            )
        )
    )

)
(instance quirkPuke of Prop
    (properties
        x 158
        y 157
        view 686
        loop 3
        signal 16384
    )
)
(instance wd40 of Actor
    (properties
        x 151
        y 147
        view 688
        signal 16384
    )
)
(instance pukoid1 of Actor
    (properties
        x 198
        y 148
        view 687
        signal 16384
    )
)
(instance pukoid2 of Actor
    (properties
        x 268
        y 175
        view 687
        loop 3
    )
)
(instance pukoid3 of Actor
    (properties
        x 67
        y 157
        view 687
        loop 7
    )
)
(instance pukoid4 of Actor
    (properties
        x 263
        y 132
        view 687
        loop rm1040
    )
)
(instance pukoid5 of Actor
    (properties
        x 157
        y 122
        view 687
        loop 5
        priority 1
        signal 16
    )
)
(instance pukoid6 of Actor
    (properties
        x 302
        y 147
        view 687
        loop 6
    )
)
(instance pukoid7 of Actor
    (properties
        x 98
        y 141
        view 687
        loop 8
    )
)
(instance blob of Actor
    (properties
        x 228
        y 89
        view 696
    )

    (method (doit param1)
        (super:doit(rest param1))
        (if ((== (self:view) 696) and (self:mover))
            (self:scaleX((+ (* (- 89 (self:y)) 2) 128)))
            (self:scaleY((+ (* (- 89 (self:y)) 2) 128)))
            (self:scaleSignal(1))
        )
    )

)
(instance shuttle of Actor
    (properties
        x 166
        y 120
        view 696
        loop 1
        priority 1
        signal 16400
    )
)
(instance exAct1 of Actor
    (properties
        x 213
        y 98
        view 696
        loop 2
        priority rm1040
        signal 16400
    )
)
(instance ooze3 of Prop
    (properties
        x 94
        y 69
        view 697
    )
)
(instance flo of Prop
    (properties
        x 145
        y 102
        view 697
        loop 5
        priority 5
        signal 16400
    )
)
(instance droole of Prop
    (properties
        x 193
        y 104
        view 697
        loop 6
        priority 5
        signal 16400
    )
)
(instance wd40head of Prop
    (properties
        x 149
        y 106
        view 688
        loop 2
        priority 15
        signal 16400
    )
)
(instance cloud1 of Prop
    (properties
        x 242
        y 163
        view 689
        priority 14
        signal 16400
    )
)
(instance cloud2 of Prop
    (properties
        x 25
        y 144
        view 689
        loop 1
        priority 14
        signal 16400
    )
)
(instance cloud3 of Prop
    (properties
        x 190
        y 133
        view 689
        loop 2
        priority 14
        signal 16400
    )
)
(instance public tkrFlo of ChoiceTalker
    (properties
        x 175
        y 1
        view 1008
        talkWidth 85
        textX 65426
        textY 10
        normal 1
    )

    (method (init param1)
        = font gFont
        (if (normal)
            (self:talkWidth(85))
        )(else
            (self:talkWidth(200))
        )
        (super:init(floBust floEyes floMouth rest param1))
    )


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

)
(instance floBust of Prop
    (properties
        view 1008
    )
)
(instance floEyes of Prop
    (properties
        nsTop 33
        nsLeft 39
        view 1008
        loop 2
        signal 16384
    )
)
(instance floMouth of Prop
    (properties
        nsTop 43
        nsLeft 45
        view 1008
        loop 1
        signal 16384
    )
)
(instance public tkrRoger of Talker
    (properties
        y 56
        view 697
        loop rm1040
        talkWidth 150
        textX 10
    )

    (method (init param1)
        = font gFont
        = gSq5Win SpeakWindow
        = talkWidth proc0_12(220 220 220 220 150)
        (send gSq5Win:
            tailX(80)
            tailY(160)
            xOffset(proc0_12(105 105 105 105 65))
        )
        (super:init(rogBust rogEyes rogMouth rest param1))
    )


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

)
(instance rogBust of Prop
    (properties
        view 697
        loop rm1040
    )
)
(instance rogEyes of Prop
    (properties
        nsTop 46
        nsLeft 33
        view 697
        loop 8
    )
)
(instance rogMouth of Prop
    (properties
        nsTop 68
        nsLeft 2
        view 697
        loop 7
    )
)
(instance quirk of Actor
    (properties
        x 132
        y 120
        view 686
        loop rm1040
        priority 8
        signal 16400
    )
)
(instance quirkArm of Actor
    (properties
        x 133
        y 162
        view 686
        signal 16384
    )
)
(instance rogHead of Actor
    (properties
        x 65486
        y 63
        view 697
        loop rm1040
        priority 15
        signal 16
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 32
                ((send gRoom:newRoom(240))  )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
