(version 2)
(include "sci.sh")
(exports
    0 rm890
)
(use "Main")
(use "GloryWindow")
(use "IconI")
(use "GameControls")
(use "Cycle")
(use "Game")
(use "View")
(use "Obj")
(script 890)


(local
    local0
    local1[10]
    local11[10]
    local21[10]
    local31[5]

)
(procedure (localproc_0f89)
    Message(0 26 1 0 8 1 @local1)
    Message(0 26 1 0 3 1 @local11)
    Message(0 26 1 0 4 1 @local21)
    Message(0 26 1 0 5 1 @local31)
    (quest:
        init()
        show()
        dispose()
    )
    (switch (local0)
        (case 1
            (send gGame:setCursor(996 1))
            SetCursor(0)
        )
        (case 2
            (send gGame:restart())
            (send gGame:setCursor(996 1))
            SetCursor(0)
        )
        (case 3
            (send gGame:restore())
            (send gGame:setCursor(996 1))
            SetCursor(0)
        )
        (case 4
            = global4 1
        )
    )
)


(instance public rm890 of Rm
    (properties)

    (method (init)
        (super:init())
        (send gGame:setScript(weBeFamous))
    )

)
(instance weBeFamous of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gMainIconBar:disable())
                (send gGame:setCursor(996 1))
                SetCursor(0)
                (send gLongSong:
                    number(231)
                    setLoop(-1)
                    play(127)
                )
                Graph(grFILL_BOX 0 0 200 320 1 22 -1)
                Graph(grUPDATE_BOX -1 -1 201 321 1)
                (iconProp:
                    view(919)
                    x(10)
                    y(110)
                    cel(0)
                    init()
                )
                (signActor:
                    view(920)
                    x(152)
                    y(220)
                    setLoop(0)
                    cel(0)
                    init()
                    setMotion(MoveTo 152 86 self)
                )
            )
            (case 1
                = ticks 240
            )
            (case 2
                (signActor:setCel(1))
                = ticks 300
            )
            (case 3
                (signActor:setMotion(MoveTo 360 86 self))
            )
            (case 4
                (signActor:
                    x(-20)
                    setCel(2)
                    setMotion(MoveTo 152 86 self)
                )
            )
            (case 5
                (iconProp:setCycle(End self))
                (send gLongSong2:
                    number(831)
                    setLoop(1)
                    play()
                )
            )
            (case 6
                = ticks 240
            )
            (case 7
                (signActor:setMotion(MoveTo 152 -20 self))
            )
            (case 8
                (signActor:
                    setLoop(2)
                    cel(0)
                    setMotion(MoveTo 152 86 self)
                )
            )
            (case 9
                = ticks 180
            )
            (case 10
                (signActor:setCel(1))
                = ticks 240
            )
            (case 11
                (signActor:setMotion(MoveTo 152 250 self))
            )
            (case 12
                (iconProp:
                    view(912)
                    x(233)
                    y(112)
                )
                (signActor:
                    y(-20)
                    setLoop(4)
                    setCel(0)
                    setMotion(MoveTo 152 86 self)
                )
            )
            (case 13
                (iconProp:setCycle(End self))
                (send gLongSong2:
                    number(101)
                    setLoop(1)
                    play()
                )
            )
            (case 14
                (send gLongSong2:
                    number(929)
                    setLoop(1)
                    play()
                )
                (signActor:setCel(1))
                = ticks 300
            )
            (case 15
                (signActor:setMotion(MoveTo 152 220 self))
            )
            (case 16
                (signActor:
                    setLoop(6)
                    cel(0)
                    setMotion(MoveTo 152 86 self)
                )
                (iconProp:
                    view(913)
                    x(0)
                    cel(0)
                )
            )
            (case 17
                = ticks 180
            )
            (case 18
                (iconProp:setCycle(End))
                (signActor:cel(1))
                (send gLongSong2:
                    number(940)
                    setLoop(1)
                    play(self)
                )
            )
            (case 19
                (send gLongSong2:
                    number(891)
                    setLoop(1)
                    play()
                )
                = ticks 300
            )
            (case 20
                (signActor:setMotion(MoveTo 330 210 self))
            )
            (case 21
                (iconProp:
                    view(917)
                    x(253)
                    y(20)
                    cel(0)
                )
                (signActor:
                    setLoop(8)
                    cel(0)
                    x(-20)
                    y(-20)
                    setMotion(MoveTo 152 86 self)
                )
            )
            (case 22
                = ticks 120
            )
            (case 23
                (signActor:setCel(1))
                (iconProp:
                    cycleSpeed(12)
                    setCycle(End self)
                )
                (send gLongSong2:
                    number(919)
                    setLoop(-1)
                    play()
                )
            )
            (case 24
                (send gLongSong2:
                    number(931)
                    setLoop(1)
                    play()
                )
                = ticks 120
            )
            (case 25
                (signActor:setMotion(MoveTo 152 220 self))
            )
            (case 26
                (iconProp:
                    view(914)
                    x(0)
                    y(0)
                    setCycle(Fwd)
                )
                (signActor:
                    setLoop(10)
                    cel(0)
                    x(360)
                    y(86)
                    setMotion(MoveTo 152 86 self)
                )
                (send gLongSong:
                    number(890)
                    setLoop(1)
                    play()
                )
            )
            (case 27
                = ticks 240
            )
            (case 28
                (signActor:setCel(1))
                = ticks 240
            )
            (case 29
                (signActor:setMotion(MoveTo 152 220 self))
            )
            (case 30
                (send gLongSong:stop())
                (signActor:
                    setLoop(12)
                    y(-20)
                    cel(0)
                    setMotion(MoveTo 152 86 self)
                )
                (iconProp:
                    view(909)
                    x(230)
                    y(95)
                    cel(0)
                    setCycle(0)
                )
            )
            (case 31
                = ticks 180
            )
            (case 32
                (signActor:setCel(1))
                (iconProp:setCycle(End self))
                (send gLongSong2:
                    number(291)
                    setLoop(1)
                    play(self)
                )
            )
            (case 33
            )
            (case 34
                (send gLongSong:
                    number(407)
                    setLoop(-1)
                    play()
                )
                (signActor:setMotion(MoveTo 152 -20 self))
            )
            (case 35
                (signActor:
                    view(921)
                    setLoop(2)
                    setCel(0)
                    setMotion(MoveTo 152 92 self)
                )
                (iconProp:
                    view(910)
                    x(76)
                    y(184)
                    cel(0)
                )
            )
            (case 36
                = ticks 120
            )
            (case 37
                (iconProp:setCycle(CT 8 1 self))
                (signActor:
                    y(120)
                    setCel(1)
                )
            )
            (case 38
                = ticks 120
            )
            (case 39
                (send gLongSong2:
                    number(905)
                    setLoop(1)
                    play()
                )
                (iconProp:setCycle(End self))
            )
            (case 40
                = ticks 300
            )
            (case 41
                (signActor:setCel(2))
                = ticks 300
            )
            (case 42
                (signActor:setMotion(MoveTo 152 250 self))
            )
            (case 43
                (iconProp:
                    view(911)
                    cel(0)
                    x(189)
                    y(98)
                )
                (signActor:
                    setLoop(0)
                    cel(0)
                    setMotion(MoveTo 152 86 self)
                )
            )
            (case 44
                = ticks 120
            )
            (case 45
                (iconProp:setCycle(CT 3 1 self))
            )
            (case 46
                (send gLongSong2:
                    number(917)
                    setLoop(1)
                    play(self)
                )
            )
            (case 47
                (iconProp:setCycle(CT 6 1 self))
            )
            (case 48
                (send gLongSong2:
                    number(917)
                    setLoop(1)
                    play(self)
                )
            )
            (case 49
                (iconProp:setCycle(End self))
            )
            (case 50
                (signActor:
                    x(152)
                    y(131)
                    setCel(1)
                )
                = ticks 300
            )
            (case 51
                (signActor:setCel(2))
                = ticks 300
            )
            (case 52
                (signActor:setMotion(MoveTo 152 -40 self))
            )
            (case 53
                (iconProp:
                    view(916)
                    cel(0)
                    x(259)
                    y(2)
                )
                (signActor:
                    setLoop(4)
                    x(-20)
                    y(-20)
                    setMotion(MoveTo 152 86 self)
                )
                (send gLongSong:changeTo(408))
            )
            (case 54
                = ticks 300
            )
            (case 55
                (signActor:setCel(1))
                = ticks 180
            )
            (case 56
                (signActor:setMotion(MoveTo -20 220 self))
            )
            (case 57
                (signActor:
                    view(922)
                    setLoop(0)
                    cel(0)
                    setMotion(MoveTo 152 86 self)
                )
            )
            (case 58
                (iconProp:setCycle(End self))
                (send gLongSong2:
                    number(850)
                    setLoop(1)
                    play()
                )
            )
            (case 59
                (send gLongSong2:
                    number(912)
                    setLoop(1)
                    play()
                )
                = ticks 120
            )
            (case 60
                (signActor:
                    y(121)
                    setCel(1)
                )
                = ticks 300
            )
            (case 61
                (signActor:setCel(2))
                = ticks 300
            )
            (case 62
                (signActor:setCel(3))
                = ticks 300
            )
            (case 63
                (signActor:setMotion(MoveTo 152 -40 self))
            )
            (case 64
                (signActor:
                    setLoop(2)
                    x(360)
                    y(220)
                    cel(0)
                    setMotion(MoveTo 152 86 self)
                )
                (iconProp:
                    view(918)
                    cel(0)
                    setCycle(Fwd)
                )
            )
            (case 65
                = ticks 180
            )
            (case 66
                (signActor:
                    setLoop(3)
                    y(121)
                    setCel(2)
                )
                = ticks 180
            )
            (case 67
                (signActor:setLoop(2))
                (iconProp:
                    setCycle(0)
                    loop(1)
                )
                (send gLongSong2:
                    number(403)
                    setLoop(1)
                    play()
                )
                = ticks 240
                (send gLongSong:changeTo(409))
            )
            (case 68
                (signActor:
                    view(922)
                    loop(6)
                    cel(0)
                    y(86)
                )
                = ticks 180
            )
            (case 69
                (signActor:
                    cel(1)
                    y(121)
                )
                = ticks 90
            )
            (case 70
                (signActor:cel(2))
                = ticks 90
            )
            (case 71
                (signActor:setMotion(MoveTo 152 -20 self))
            )
            (case 72
                (iconProp:dispose())
                (signActor:
                    setLoop(4)
                    cel(0)
                    setMotion(MoveTo 152 86 self)
                )
            )
            (case 73
                = ticks 240
            )
            (case 74
                (signActor:setCel(1))
                = ticks 240
            )
            (case 75
                (signActor:setMotion(MoveTo -20 -20 self))
            )
            (case 76
                (signActor:
                    view(923)
                    x(340)
                    y(220)
                    setLoop(0)
                    cel(0)
                    setMotion(MoveTo 152 86 self)
                )
            )
            (case 77
                = ticks 240
            )
            (case 78
                (signActor:setCel(1))
                = ticks 240
            )
            (case 79
                (signActor:setMotion(MoveTo 152 220 self))
            )
            (case 80
                (signActor:
                    setLoop(2)
                    cel(0)
                    setMotion(MoveTo 152 86 self)
                )
            )
            (case 81
                = ticks 240
            )
            (case 82
                (signActor:
                    y(131)
                    setCel(1)
                )
                = ticks 240
            )
            (case 83
                (signActor:setCel(2))
                = ticks 240
            )
            (case 84
                (signActor:setMotion(MoveTo 152 -20 self))
            )
            (case 85
                (iconProp:
                    view(915)
                    x(92)
                    y(130)
                    cel(0)
                    init()
                )
                (signActor:
                    setLoop(4)
                    cel(0)
                    setMotion(MoveTo 152 86 self)
                )
            )
            (case 86
                = ticks 240
            )
            (case 87
                (send gLongSong2:
                    number(930)
                    setLoop(1)
                    play()
                )
                (self:cue())
            )
            (case 88
                (iconProp:setCycle(End self))
                (signActor:
                    y(114)
                    setCel(1)
                )
            )
            (case 89
                = ticks 300
            )
            (case 90
                (signActor:setCel(2))
                = ticks 300
            )
            (case 91
                (send gLongSong:fade(0 6 3 0 self))
            )
            (case 92
                (self:init())
            )
        )
    )


    (method (handleEvent pEvent)
        (send pEvent:claimed(1))
        (if (proc999_5((send pEvent:type) 4 1 256))
            (send gGame:setCursor(999 1))
            SetCursor(1)
            Animate()
            localproc_0f89()
        )
    )

)
(instance iconProp of Prop
    (properties
        signal $4000
    )
)
(instance signActor of Actor
    (properties
        signal $6000
        illegalBits $0000
        moveSpeed 0
    )
)
(instance quest of GameControls
    (properties)

    (method (init param1)
        (send (= window (GloryWindow:new())):
            top(40)
            left(95)
            bottom(125)
            right(220)
            priority(15)
            yourself()
        )
        (self:add(continueIcon restoreIcon restartIcon quitIcon))
        (super:init(rest param1))
    )

)
(instance continueIcon of IconI
    (properties
        view 935
        loop 2
        cel 0
        nsTop 15
        signal $0101
        maskView 361
        maskLoop 3
    )

    (method (show)
        (var temp0[15])
        = nsRight 80
        = nsBottom (+ nsTop 15)
        DrawCel(view loop cel nsLeft nsTop -1)
        Display(@local1 100 20 + nsTop 3 102 17)
    )


    (method (select)
        = local0 1
        (quest:state((& (quest:state) $ffdf)))
    )


    (method (highlight param1)
        (var temp0)
        (if (param1)
            DrawCel(view loop 1 nsLeft nsTop -1)
            = temp0 46
        )(else
            DrawCel(view loop 0 nsLeft nsTop -1)
            = temp0 17
        )
        Display(@local1 100 20 + nsTop 3 102 temp0)
    )

)
(instance restoreIcon of IconI
    (properties
        view 935
        loop 2
        cel 0
        nsTop 30
        signal $0101
        maskView 361
        maskLoop 3
    )

    (method (show)
        (var temp0[15])
        = nsRight 80
        = nsBottom (+ nsTop 15)
        DrawCel(view loop cel nsLeft nsTop -1)
        Display(@local11 100 20 + nsTop 3 102 17)
    )


    (method (select)
        = local0 3
        (quest:state((& (quest:state) $ffdf)))
    )


    (method (highlight param1)
        (var temp0)
        (if (param1)
            DrawCel(view loop 1 nsLeft nsTop -1)
            = temp0 46
        )(else
            DrawCel(view loop 0 nsLeft nsTop -1)
            = temp0 17
        )
        Display(@local11 100 20 + nsTop 3 102 temp0)
    )

)
(instance restartIcon of IconI
    (properties
        view 935
        loop 2
        cel 0
        nsTop 45
        signal $0101
        maskView 361
        maskLoop 3
    )

    (method (show)
        = nsRight 80
        = nsBottom (+ nsTop 15)
        DrawCel(view loop cel nsLeft nsTop -1)
        Display(@local21 100 20 + nsTop 3 102 17)
    )


    (method (select)
        = local0 2
        (quest:state((& (quest:state) $ffdf)))
    )


    (method (highlight param1)
        (var temp0)
        (if (param1)
            DrawCel(view loop 1 nsLeft nsTop -1)
            = temp0 46
        )(else
            DrawCel(view loop 0 nsLeft nsTop -1)
            = temp0 17
        )
        Display(@local21 100 20 + nsTop 3 102 temp0)
    )

)
(instance quitIcon of IconI
    (properties
        view 935
        loop 2
        cel 0
        nsTop 60
        signal $0101
        maskView 361
        maskLoop 3
    )

    (method (show)
        (var temp0[15])
        = nsRight 80
        = nsBottom (+ nsTop 15)
        DrawCel(view loop cel nsLeft nsTop -1)
        Display(@local31 100 20 + nsTop 3 102 17)
    )


    (method (select)
        = local0 4
        (quest:state((& (quest:state) $ffdf)))
    )


    (method (highlight param1)
        (var temp0)
        (if (param1)
            DrawCel(view loop 1 nsLeft nsTop -1)
            = temp0 46
        )(else
            DrawCel(view loop 0 nsLeft nsTop -1)
            = temp0 17
        )
        Display(@local31 100 20 + nsTop 3 102 temp0)
    )

)
