(include "sci.sh")
(use "Main")
(use "Sound")
(use "Cycle")
(use "PV")
(use "Obj")
(script 303)


(local
    newProp
    gEgoViewer

)
(instance public playLute of Script
    (properties)

    (method (init)
        Load(rsVIEW 54)
        = global204 1
        (super:init())
    )


    (method (dispose)
        (send gSounds:eachElementDo(172))
        (super:dispose())
    )


    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (proc0_10() = newProp (Prop:new()) 
                (if (== (send gEgo:view()) 2)
                    (send newProp:
                        view(888)
                        ignoreActors()
                        setPri((send gEgo:priority()))
                        cycleSpeed(1)
                        setCycle(Fwd)
                        posn(+ (send gEgo:x()) 13 - (send gEgo:y()) 27)
                        init()
                    )
                )(else
                    (send newProp:
                        view(888)
                        ignoreActors()
                        setPri((send gEgo:priority()))
                        cycleSpeed(1)
                        setCycle(Fwd)
                        posn(+ (send gEgo:x()) 15 - (send gEgo:y()) 37)
                        init()
                    )
                )
 (send gSounds:eachElementDo(172)) (send ((Sound:new())):
                    number(54)
                    play(self)
                )
 = gEgoViewer (send gEgo:viewer()) (send gEgo:
                    viewer(0)
                    view(54)
                    setMotion(0)
                    loop(
                        (if (== (send gEgo:view()) 2)
                            0
                        )(else
                            1
                        )
)
                    cycleSpeed(2)
                    setCycle(Fwd)
                )
  )
            )
            (case 1
                ((send gEgo:
                    viewer(gEgoViewer)
                    view(
                        (if (== (send gEgo:loop()) 0)
                            2
                        )(else
                            4
                        )
)
                )
 (send newProp:dispose()) (send gEgo:
                    viewer(gEgoViewer)
                    script(gGEgoScript)
                    cycleSpeed(0)
                    loop(2)
                    setCycle(Walk)
                )
 proc0_11() DisposeScript(303) )
            )
        )
    )

)
