(include "sci.sh")
(use "Main")
(use "SQRoom")
(use "StopWalk")
(use "Cycle")
(use "User")
(use "Obj")
(script 808)


(local
    local0
    local1
    local2
    gEgoSignal
    gEgoPriority
    gEgoIllegalBits
    gEgoCycleSpeed

)
(instance public nosePick of Code
    (properties)

    (method (doit)
        (if ((((((((((((User:canControl()) and (User:canInput())) and IsObject(global2)) and (send global2:isKindOf(SQRoom))) and not (send global2:script)) and (send gEgo:normal)) and not (& (send gEgo:signal) $0008)) and (send gEgo:isStopped())) and IsObject((send gEgo:cycler))) and (send ((send gEgo:cycler)):isKindOf(StopWalk))) and (== (send gEgo:view) (send ((send gEgo:cycler)):vStopped))) and (== (send ((send gEgo:cycler)):vStopped) 4))
            (if (<> local0 GetTime(1))
                = local0 GetTime(1)
                (if (> ++local1 120)
                    proc0_2()
                    (send global2:setScript(nPS))
                )
            )
        )(else
            = local1 0
        )
    )

)
(instance nPS of Script
    (properties)

    (method (changeState newState)
        (var temp0, temp1)
        (switch (= state newState)
            (case 0
                Load(rsVIEW 65)
                (if (<> (send gEgo:loop) 2)
                    (send gEgo:setHeading(180 self))
                )(else
                    = cycles 1
                )
            )
            (case 1
                = temp0 Random(0 2)
                = gEgoSignal (send gEgo:signal)
                = gEgoPriority (send gEgo:priority)
                = gEgoIllegalBits (send gEgo:illegalBits)
                = gEgoCycleSpeed (send gEgo:cycleSpeed)
                (send gEgo:
                    view(65)
                    setLoop(temp0)
                    cycleSpeed(1)
                    cel(0)
                    setCycle(End self)
                )
                Animate((send gCast:elements) 0)
                (if (not temp0)
                    (if (< (send gEgo:y) 85)
                        = temp1 65516
                    )(else
                        = temp1 80
                    )
                    = local2 proc0_12("\"So why am I\nstanding around?\"" 67 100 (- (send gEgo:y) temp1))
                )
            )
            (case 2
                (if (not (send gEgo:loop))
                    = seconds 3
                )(else
                    = cycles 1
                )
            )
            (case 3
                (if (not (send gEgo:loop))
                    proc0_12(local2)
                )
                proc0_1(2 0 4)
                (send gEgo:
                    signal(gEgoSignal)
                    priority(gEgoPriority)
                    illegalBits(gEgoIllegalBits)
                    cycleSpeed(gEgoCycleSpeed)
                )
                = local0 (= start 0)
                = local1 0
                proc0_3()
                (self:dispose())
            )
        )
    )

)
