(include "sci.sh")
(use "Main")
(use "Scaler")
(use "PolyPath")
(use "Polygon")
(use "CueObj")
(use "n958")
(use "Grooper")
(use "Sound")
(use "Cycle")
(use "Sounds")
(use "View")
(use "Obj")
(script 420)



(instance theMusic3 of Sound
    (properties)
)
(instance theMusic4 of Sound
    (properties)
)
(instance theMusic5 of Sound
    (properties)
)
(instance public rm420 of Rm
    (properties
        noun 9
        picture 82
        style 10
    )

    (method (init)
        proc958_0(128 453)
        (send gRoom:addObstacle((send ((Polygon:new())):
                type(3)
                init(221 134 164 130 158 135 223 140 226 152 144 152 36 139 62 155 107 153 115 161 103 172 65 177 110 181 121 179 146 161 206 158 239 157 242 169 259 167 259 158 242 132 236 126 226 126)
                yourself()
            )
))
        (theComputer:init())
        (theFern:init())
        (theHumidifiers:
            init()
            setOnMeCheck(1 4)
        )
        (thePlants:
            init()
            setOnMeCheck(1 2)
        )
        (send gWalkHandler:addToFront(theComputer))
        (send gEgo:
            view(0)
            init()
        )
        (switch (gGModNum)
            (case 410
                (proc0_6(0) (send gEgo:
                    init()
                    setScale(Scaler 126 61 179 130)
                    loop(0)
                    x(10)
                    y(153)
                )
 (send gRoom:setScript(sRogEnter))  )
            )
            (case 440
                ((send gEgo:
                    init()
                    view(454)
                    setLoop(2)
                    cel(0)
                )
 (send gRoom:setScript(sRogSaved))  )
            )
            (case 450
                ((send gRoom:setScript(sInitRoom))  )
            )
            (case 460
                ((send gRoom:setScript(sInitRoom))  )
            )
            (default 
                ((send gRoom:setScript(sPukoidAttack)) )
            )
        )
        (super:init())
    )


    (method (doit)
        (super:doit())
        (if (proc0_5(gEgo 8) and not (send gRoom:script))
            (send gRoom:newRoom(410))
        )
        (if (proc0_5(gEgo 32) and not (send gRoom:script))
            proc0_2(101)
            (send gRoom:newRoom(410))
        )
    )


    (method (dispose param1)
        (send gWalkHandler:delete(theComputer))
        (super:dispose(rest param1))
    )

)
(instance sInitRoom of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (plastic:
                    init()
                    setScript(sPlastic)
                )
 (plastic1:init()) (plastic2:init()) (branch1:init()) (branch2:init()) (drip:
                    init()
                    setScript(sDrip1)
                )
 (dripa:
                    init()
                    hide()
                )
 (drip2:init()) (drip2a:
                    init()
                    hide()
                )
 (drip2f:init()) 
                (if (proc0_1(98))
                    (paper:
                        init()
                        x(117)
                        y(178)
                        setCycle(0)
                        cel(7)
                        setPri(11)
                    )
                )
 
                (if (proc0_1(77))
                    (pukoidFeet:init())
                    (flies:init())
                )
 
                (switch (gGModNum)
                    (case 410
                        (
                        (if (not proc0_1(90))
                            (shadow:
                                init()
                                setScript(sShadow)
                            )
                        )
 )
                    )
                    (case 440
                        ((send gSq5Music1:
                            number(30)
                            setLoop(-1)
                            play()
                        )
 (droole:
                            init()
                            view(455)
                            setLoop(0)
                            cel(0)
                        )
 (send gEgo:
                            init()
                            view(454)
                            setLoop(2)
                            cel(0)
                            x(229)
                            y(159)
                            setScale(0)
                        )
  )
                    )
                    (case 450
                        (proc0_6(0) (send gEgo:
                            init()
                            setScale(Scaler 126 61 179 130)
                            loop(5)
                            x(230)
                            y(155)
                        )
  )
                    )
                    (case 460
                        (proc0_6(0) (send gEgo:
                            init()
                            setScale(Scaler 126 61 179 130)
                            loop(5)
                            x(209)
                            y(155)
                        )
  )
                    )
                    (default 
                        ((droole:
                            init()
                            view(455)
                            setLoop(0)
                            cel(0)
                        )
 (pukoidFeet:init()) (send gEgo:
                            init()
                            view(454)
                            setLoop(2)
                            cel(0)
                            x(230)
                            y(155)
                            setScale(0)
                        )
 )
                    )
                )
 = cycles 1  )
            )
            (case 1
                ((send gSQ5:handsOn()) (self:dispose()) )
            )
        )
    )

)
(instance sRogEnter of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((self:setScript(sInitRoom self))  )
            )
            (case 1
                ((send gSQ5:handsOff()) (send gEgo:setMotion(MoveTo 93 153 self))  )
            )
            (case 2
                ((send gSQ5:handsOn()) (self:dispose()) )
            )
        )
    )

)
(instance public sUseComm of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (send gEgo:
                    view(14)
                    setLoop(0)
                    cel(0)
                    setCycle(End self)
                )
 (send gSq5Music2:
                    number(603)
                    loop(1)
                    play()
                )
  )
            )
            (case 1
                ((send gTestMessager:say(2 32 0 0 self 401))  )
            )
            (case 2
                ((send gEgo:setCycle(Beg self))  )
            )
            (case 3
                (proc0_6(0) (send gEgo:loop(2)) = seconds 1  )
            )
            (case 4
                ((send gEgo:
                    view(6)
                    setLoop(0)
                    cel(15)
                    setCycle(Beg self)
                )
 (send gSq5Music2:
                    number(260)
                    setLoop(1)
                    play()
                )
  )
            )
            (case 5
                ((send gSq5Music1:fade()) (send gRoom:newRoom(240)) )
            )
        )
    )

)
(instance sRogSaved of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((self:setScript(sInitRoom self))  )
            )
            (case 1
                ((send gSQ5:handsOff()) proc0_10(219 50) = seconds 2  )
            )
            (case 2
                ((droole:setCycle(End self))  )
            )
            (case 3
                (= seconds 1  )
            )
            (case 4
                ((droole:
                    setLoop(1)
                    setCycle(End self)
                )
  )
            )
            (case 5
                ((droole:
                    view(30)
                    loop(2)
                    cel(0)
                    setScale(Scaler 126 61 179 130)
                    setCycle(Walk)
                    setLoop(Grooper)
                )
 (send gEgo:setCycle(End self))  )
            )
            (case 6
                (proc0_6(0) (send gEgo:
                    init()
                    setScale(Scaler 126 61 179 130)
                    loop(5)
                    x(230)
                    y(155)
                )
 = cycles 3  )
            )
            (case 7
                ((send gTestMessager:say(3 0 0 0 self))  )
            )
            (case 8
                ((droole:
                    loop(3)
                    setMotion(MoveTo 230 127 self)
                )
  )
            )
            (case 9
                ((droole:
                    loop(0)
                    setMotion(MoveTo 252 124 self)
                )
  )
            )
            (case 10
                ((droole:dispose()) = cycles 3  )
            )
            (case 11
                ((send gTestMessager:say(8 0 0 0 self))  )
            )
            (case 12
                (proc0_3(97) (send gRoom:newRoom(450)) )
            )
        )
    )

)
(instance sExit of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gEgo:setMotion(PolyPath 90 162 self))  )
            )
            (case 1
                ((send gRoom:newRoom(410)) )
            )
        )
    )

)
(instance sComputer of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (send gEgo:setMotion(PolyPath 209 155 self))  )
            )
            (case 1
                (
                (if (not proc0_1(77))
                    proc0_2(77)
                    (self:setScript(sPukoidAttack self))
                )(else
                    = cycles 1
                )
 )
            )
            (case 2
                (
                (if (proc0_1(77))
                    (send gRoom:newRoom(440))
                )(else
                    (send gSQ5:handsOn())
                    (self:dispose())
                )
 )
            )
        )
    )

)
(instance sGotoComputer of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (send gEgo:setMotion(PolyPath 209 155 self))  )
            )
            (case 1
                ((send gEgo:loop(2)) = cycles 2  )
            )
            (case 2
                ((send gRoom:newRoom(460)) )
            )
        )
    )

)
(instance sPukoidAttack of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((paper:
                    init()
                    hide()
                )
 (pukoid:
                    init()
                    setCycle(End self)
                )
 (send gSq5Music1:
                    number(35)
                    setLoop(-1)
                    play()
                )
  )
            )
            (case 1
                ((pukoid:
                    setStep(8 2)
                    setLoop(1)
                    cel(0)
                    x(81)
                    y(179)
                    setCycle(Fwd)
                    setMotion(MoveTo 117 172 self)
                )
  )
            )
            (case 2
                ((pukoid:
                    setStep(15 5)
                    setMotion(MoveTo 168 155 self)
                )
 (paper:setScript(sPaper))  )
            )
            (case 3
                ((pukoid:
                    setLoop(2)
                    cel(0)
                    x(169)
                    y(157)
                    setCycle(0)
                )
 = cycles 1  )
            )
            (case 4
                ((send gEgo:
                    view(454)
                    setLoop(0)
                    setCel(0)
                    setScale(0)
                    setCycle(0)
                    x(229)
                    y(159)
                    setCycle(End self)
                )
  )
            )
            (case 5
                (= seconds 2  )
            )
            (case 6
                ((pukoid:
                    setLoop(2)
                    cel(0)
                    x(169)
                    y(157)
                    setCycle(CT 3 1 self)
                )
  )
            )
            (case 7
                ((theMusic4:
                    number(5042)
                    loop(1)
                    play()
                )
 (send gEgo:
                    view(454)
                    setLoop(1)
                    cel(0)
                    setCycle(End)
                )
 (pukoid:setCycle(End self))  )
            )
            (case 8
                ((theMusic4:
                    number(136)
                    loop(1)
                    play()
                )
 = cycles 1  )
            )
            (case 9
                ((pukoid:setCycle(Beg self))  )
            )
            (case 10
                ((pukoid:
                    setLoop(5)
                    cel(0)
                    setCycle(End self)
                )
  )
            )
            (case 11
                ((self:dispose()) )
            )
        )
    )

)
(instance sGetPaper of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (send gEgo:setMotion(PolyPath 130 172 self))  )
            )
            (case 1
                (proc0_10(220 5) (send gEgo:
                    view(19)
                    setLoop(1)
                    cel(0)
                    setCycle(End self)
                )
  )
            )
            (case 2
                ((send gEgo:
                    get(22)
                    setCycle(Beg self)
                )
 proc0_3(98) (paper:
                    hide()
                    dispose()
                )
  )
            )
            (case 3
                (proc0_6(0) (send gEgo:
                    init()
                    setScale(Scaler 126 61 179 130)
                    loop(1)
                    x(130)
                    y(172)
                )
 = cycles 3  )
            )
            (case 4
                ((send gSQ5:handsOn()) (self:dispose()) )
            )
        )
    )

)
(instance sPaper of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((paper:
                    show()
                    setMotion(MoveTo 117 178 self)
                )
  )
            )
            (case 1
                ((paper:
                    setCycle(0)
                    setCel(7)
                    setPri(11)
                )
 = cycles 1  )
            )
            (case 2
                (proc0_2(98) (self:dispose()) )
            )
        )
    )

)
(instance sPlastic of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (
                (if (< (send gSQ5:detailLevel()) (plastic2:detailLevel()))
                    --state
                )
 = seconds Random(1 3)  )
            )
            (case 1
                ((plastic2:setCycle(End self))  )
            )
            (case 2
                (= seconds 1  )
            )
            (case 3
                ((plastic1:setCycle(End self)) (plastic:setCycle(End self)) (branch1:setCycle(End self)) (branch2:setCycle(End self))  )
            )
            (case 4
                (0  )
            )
            (case 5
                (0  )
            )
            (case 6
                (0  )
            )
            (case 7
                (= seconds Random(2 8)  )
            )
            (case 8
                ((plastic1:setCycle(Beg self)) (plastic:setCycle(Beg self)) (branch1:setCycle(Beg self)) (branch2:setCycle(Beg self))  )
            )
            (case 9
                (0  )
            )
            (case 10
                (0  )
            )
            (case 11
                (0  )
            )
            (case 12
                (= seconds 1  )
            )
            (case 13
                ((plastic2:setCycle(Beg self))  )
            )
            (case 14
                (= state -1 = cycles 2 )
            )
        )
    )

)
(instance sDrip1 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (= seconds 2  )
            )
            (case 1
                ((drip:
                    init()
                    setCycle(End self)
                )
  )
            )
            (case 2
                ((drip:cel(0)) (dripa:
                    x(206)
                    y(43)
                    show()
                    setMotion(MoveTo 206 165 self)
                )
  )
            )
            (case 3
                ((dripa:hide()) (dripe:
                    init()
                    show()
                    setCycle(End self)
                )
 (theMusic3:
                    number(137)
                    loop(1)
                    play()
                )
  )
            )
            (case 4
                ((dripe:
                    cel(0)
                    hide()
                )
 = seconds Random(1 4)  )
            )
            (case 5
                ((drip2:
                    init()
                    setCycle(End self)
                )
  )
            )
            (case 6
                ((drip2:cel(0)) (drip2a:
                    x(152)
                    y(7)
                    show()
                    setMotion(MoveTo 149 175 self)
                )
  )
            )
            (case 7
                ((drip2a:hide()) (drip2f:
                    init()
                    setCycle(End self)
                )
 (theMusic3:
                    number(137)
                    loop(1)
                    play()
                )
  )
            )
            (case 8
                ((drip2f:cel(0)) = state -1 = cycles 2 )
            )
        )
    )

)
(instance sShadow of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (= seconds 4  )
            )
            (case 1
                (proc0_2(90) (shadow:
                    setStep(2 1)
                    setMotion(MoveTo 330 127)
                )
  )
            )
            (case 2
                ((self:dispose()) )
            )
        )
    )

)
(instance pukoid of Actor
    (properties
        x 56
        y 179
        view 457
    )

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

)
(instance pukoidFeet of View
    (properties
        x 214
        y 171
        noun 11
        view 457
        loop theMusic3
        priority 8
    )

    (method (init param1)
        (super:init(rest param1))
        (self:
            setLoop(4)
            cel(0)
            setPri(8)
        )
    )

)
(instance roger of Actor
    (properties
        x 229
        y 159
        view 454
        cel 1
    )
)
(instance shadow of Actor
    (properties
        x 277
        y 127
        view 453
        loop 8
    )

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

)
(instance paper of Actor
    (properties
        x 118
        y 130
        noun 12
        approachX 120
        approachY 120
        view 457
        loop 3
    )

    (method (init param1)
        (super:init(rest param1))
        (self:
            setLoop(3)
            setCycle(Fwd)
        )
    )


    (method (doVerb param1 param2)
        (switch (param1)
            (case 4
                (
                (if (proc0_1(98))
                    (send gRoom:setScript(sGetPaper))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance droole of Actor
    (properties
        x 228
        y 138
        view 455
    )
)
(instance plastic of Prop
    (properties
        x 86
        y 89
        view 453
        detailLevel 2
    )

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

)
(instance plastic1 of Prop
    (properties
        x 85
        view 453
        loop 1
        detailLevel 2
    )

    (method (init param1)
        (super:init(rest param1))
        (self:
            setLoop(1)
            cel(0)
        )
    )

)
(instance plastic2 of Prop
    (properties
        x 247
        view 453
        loop 2
        detailLevel 2
    )

    (method (init param1)
        (super:init(rest param1))
        (self:
            setLoop(2)
            cel(0)
        )
    )

)
(instance branch1 of Prop
    (properties
        x 34
        y 56
        view 453
        loop 3
        detailLevel 2
    )

    (method (init param1)
        (super:init(rest param1))
        (self:
            setLoop(3)
            cel(0)
        )
    )

)
(instance branch2 of Prop
    (properties
        x 47
        y 84
        view 453
        loop theMusic3
        detailLevel 2
    )

    (method (init param1)
        (super:init(rest param1))
        (self:
            setLoop(4)
            cel(0)
        )
    )

)
(instance drip of Prop
    (properties
        x 206
        y 43
        view 453
        loop 5
    )

    (method (init param1)
        (super:init(rest param1))
        (self:
            setLoop(5)
            cel(0)
        )
    )

)
(instance dripa of Actor
    (properties
        x 206
        y 45
        view 453
        loop 7
        signal 16384
    )

    (method (init param1)
        (super:init(rest param1))
        (self:
            setLoop(7)
            setCel(0)
            setStep(3 10)
        )
    )

)
(instance dripe of Prop
    (properties
        x 206
        y 165
        view 453
        loop 6
        priority 12
        signal 16384
    )

    (method (init param1)
        (super:init(rest param1))
        (self:
            setLoop(6)
            cel(0)
            setPri(12)
        )
    )

)
(instance drip2 of Prop
    (properties
        x 152
        y 7
        view 453
        loop 5
    )

    (method (init param1)
        (super:init(rest param1))
        (self:
            setLoop(5)
            cel(0)
        )
    )

)
(instance drip2a of Actor
    (properties
        x 152
        y 22
        view 453
        loop 7
        signal 16384
    )

    (method (init param1)
        (super:init(rest param1))
        (self:
            setLoop(7)
            setCel(0)
            setStep(3 10)
        )
    )

)
(instance drip2f of Prop
    (properties
        x 149
        y 175
        view 453
        loop 6
    )

    (method (init param1)
        (super:init(rest param1))
        (self:
            setLoop(6)
            cel(0)
        )
    )

)
(instance flies of Prop
    (properties
        x 168
        y 115
        noun 5
        view 457
        loop 6
        signal 16384
    )

    (method (init param1)
        (super:init(rest param1))
        (self:setCycle(Fwd))
    )

)
(instance theComputer of Feature
    (properties
        x 152
        y 125
        noun 1
        nsTop 125
        nsLeft 152
        nsBottom 165
        nsRight sInitRoom
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 4
                (
                (if (not proc0_1(77))
                    (send gRoom:setScript(sComputer))
                )(else
                    (send gRoom:setScript(sGotoComputer))
                )
 )
            )
            (case 3
                (
                (if (not proc0_1(77))
                    (send gRoom:setScript(sComputer))
                )(else
                    (send gRoom:setScript(sGotoComputer))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance theFern of Feature
    (properties
        x 10
        y 28
        noun theMusic3
        nsTop 28
        nsBottom 122
        nsRight 48
    )
)
(instance theHumidifiers of Feature
    (properties
        x 160
        y 28
        noun 6
        onMeCheck theMusic3
    )
)
(instance thePlants of Feature
    (properties
        x 320
        y 35
        noun 7
        onMeCheck 2
    )
)
