(include "sci.sh")
(use "Main")
(use "Osc")
(use "CueObj")
(use "n958")
(use "Cycle")
(use "Sounds")
(use "View")
(use "Obj")
(script 1005)



(instance public rm1005 of Rm
    (properties
        noun rm1005
        picture 121
        style 32778
    )

    (method (init)
        proc958_0(128 667)
        proc0_6(0)
        (send gEgo:
            init()
            hide()
        )
        (if (proc0_1(59))
            (lightPulse:loop(4))
            (lightCurve:loop(5))
            (statusLight:cel(0))
            (onOffText:cel(1))
        )
        (lightPulse:init())
        (lightCurve:init())
        (statusLight:init())
        (onOffText:init())
        (recepticle:
            init()
            setOnMeCheck(1 1024)
        )
        (if (proc0_1(59))
            (send gRoom:setScript(sOnLine))
        )(else
            (send gRoom:setScript(sOffLine))
        )
        (super:init())
        (send gWalkHandler:addToFront(self))
        (send gSQ5:handsOn())
    )


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


    (method (doVerb param1)
        (switch (param1)
            (case 1
                (
                (if (proc0_1(59))
                    (send gTestMessager:say(noun param1 1 0))
                )(else
                    (send gTestMessager:say(noun param1 2 0))
                )
 )
            )
            (default 
                (
                (if (== gGModNum 1000)
                    (send gRoom:newRoom(1000))
                )(else
                    (send gRoom:newRoom(1001))
                )
 )
            )
        )
    )

)
(instance sOffLine of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) = seconds 3  )
            )
            (case 1
                ((lightPulse:
                    loop(0)
                    cel(0)
                    setCycle(End self)
                )
 (lightCurve:
                    loop(2)
                    cel(0)
                    setCycle(End)
                )
  )
            )
            (case 2
                ((lightFlash:
                    loop(1)
                    cel(0)
                    init()
                    setCycle(Osc 1 self)
                )
  )
            )
            (case 3
                ((lightFlash:dispose()) (lightPulse:setCycle(Osc)) (lightCurve:setCycle(Osc)) (send gSQ5:handsOn())  )
            )
            (case 4
                (= next sInstallCap (self:dispose()) )
            )
        )
    )

)
(instance sInstallCap of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((cap:init()) proc0_10(245 100) (capTop:
                    init()
                    setCycle(0)
                    setLoop(-1)
                    setLoop(8)
                    setMotion(MoveTo 104 26 self)
                )
  )
            )
            (case 1
                ((send gSq5Music2:
                    number(651)
                    setLoop(1)
                    play()
                )
 proc0_2(59) (send gEgo:put(3)) (send gTestMessager:say(1 0 0 0 self))  )
            )
            (case 2
                ((send gSQ5:handsOn()) = next sOnLine (self:dispose()) )
            )
        )
    )

)
(instance sOnLine of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (cap:init()) (capTop:
                    x(104)
                    y(26)
                    init()
                )
 (lightPulse:
                    loop(4)
                    cel(0)
                    setCycle(End self)
                )
 (lightCurve:
                    loop(5)
                    cel(0)
                    setCycle(End)
                )
 (statusLight:
                    cel(0)
                    x(210)
                    y(43)
                )
 (onOffText:cel(1))  )
            )
            (case 1
                ((lightFlash:
                    loop(6)
                    cel(0)
                    init()
                    setCycle(Osc 1 self)
                )
  )
            )
            (case 2
                ((lightFlash:dispose()) (lightPulse:setCycle(Osc)) (lightCurve:setCycle(Osc)) (send gSQ5:handsOn())  )
            )
            (case 3
                ((self:dispose()) )
            )
        )
    )

)
(instance lightPulse of Prop
    (properties
        x 121
        y 95
        noun 2
        view 667
        signal 16384
    )
)
(instance lightFlash of Prop
    (properties
        x 133
        y 96
        noun 2
        view 667
        loop 1
        signal 16384
    )
)
(instance lightCurve of Prop
    (properties
        x 172
        y 93
        noun 2
        view 667
        loop 2
        signal 16384
    )
)
(instance statusLight of View
    (properties
        x 224
        y 45
        noun 2
        view 667
        loop 9
        cel 1
        signal 16384
    )
)
(instance onOffText of View
    (properties
        x 134
        y 139
        noun 2
        view 667
        loop 3
        signal 16384
    )
)
(instance cap of Actor
    (properties
        x 113
        y 43
        noun 3
        view 667
        loop 7
        priority 6
        signal 24592
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 1
                (
                (if (proc0_1(59))
                    (send gTestMessager:say(noun param1 1 0))
                )(else
                    (send gTestMessager:say(noun param1 2 0))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance capTop of Actor
    (properties
        x 104
        y 65526
        noun 3
        view 667
        loop 8
        priority 8
        signal 24592
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 1
                (
                (if (proc0_1(59))
                    (send gTestMessager:say(noun param1 1 0))
                )(else
                    (send gTestMessager:say(noun param1 2 0))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance recepticle of Feature
    (properties
        x 160
        y 95
        noun 3
        onMeCheck "sInstallCap"
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 19
                ((sOffLine:cue())  )
            )
            (case 1
                (
                (if (proc0_1(59))
                    (send gTestMessager:say(noun param1 1 0))
                )(else
                    (send gTestMessager:say(noun param1 2 0))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
