(include "sci.sh")
(use "Main")
(use "CueObj")
(use "ForwardCounter")
(use "Cycle")
(use "Sounds")
(use "View")
(use "Obj")
(script 166)


(local
    local0
    local1[200]
    local201

)
(instance public rm166 of Rm
    (properties
        picture 36
        style 32778
    )

    (method (init)
        (super:init())
        (self:setScript(sDoAll))
    )

)
(instance sDoAll of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (send gSq5Music1:
                    number(17)
                    loop(-1)
                    play()
                )
 
                (if ((send gEgo:has(1)))
                    (send gEgo:put(1))
                )
 (head:init()) (shirt:init()) = seconds 2  )
            )
            (case 1
                ((hands:
                    init()
                    setLoop(4)
                    setStep(6 6)
                    setMotion(MoveTo 117 114 self)
                )
  )
            )
            (case 2
                ((eyess:
                    init()
                    setCycle(ForwardCounter 4 self)
                )
  )
            )
            (case 3
                ((send gSQ5:handsOn()) = local201 1 (send gSq5IconBar:disable(0 3 4 5 6)) DrawPic(38 9) GetMessage(0 166 1 0 0 1 @local1) Display(@local1 100 40 45 102 1 105 999 106 240) GetMessage(0 166 1 0 0 2 @local1) Display(@local1 100 40 109 102 1 105 999 106 240) (testResults:init())  )
            )
            (case 4
                ((send gSQ5:handsOff()) = local201 0 DrawPic(36 9) (hands:
                    setLoop(4)
                    setStep(6 6)
                    setMotion(MoveTo 114 148 self)
                )
  )
            )
            (case 5
                ((eyess:dispose()) (hands:dispose()) (head:setLoop(2)) = seconds 5  )
            )
            (case 6
                ((head:setLoop(3)) = seconds 1  )
            )
            (case 7
                (proc0_10(162 100) Joystick(3) Joystick(0 1602 1) = seconds 1  )
            )
            (case 8
                ((shirt:setCel(1)) Joystick(3) Joystick(0 1603 1) = seconds 1  )
            )
            (case 9
                ((hall:init()) = seconds 1  )
            )
            (case 10
                (Joystick(3) Joystick(0 1604 3) = seconds 4  )
            )
            (case 11
                ((send gSq5Music1:fade(80 10 5 0 self))  )
            )
            (case 12
                (Joystick(3) (send gRoom:newRoom(165)) )
            )
        )
    )

)
(instance hall of View
    (properties
        x 82
        y 26
        view 160
        loop 7
        priority 3
        signal 16400
    )
)
(instance shirt of Prop
    (properties
        x 159
        y 146
        view 160
        loop 5
        priority 5
        signal 16400
    )
)
(instance head of Prop
    (properties
        x 139
        y 38
        view 160
        priority 5
        signal 16400
    )
)
(instance eyess of Prop
    (properties
        x 151
        y 67
        view 160
        loop 1
        priority 7
        signal 16400
        cycleSpeed 20
    )
)
(instance hands of Actor
    (properties
        x 117
        y 149
        view 160
        loop 4
        priority 7
        signal 16400
        moveSpeed 1
    )
)
(instance testResults of Feature
    (properties
        y 189
        noun 2
        onMeCheck 2
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 4
                (
                (if (local201)
                    (sDoAll:cue())
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
