(version 2)
(include "sci.sh")
(exports
    0 rm51
)
(use "Main")
(use "Class_255_0")
(use "Blk")
(use "ForwardCounter")
(use "n958")
(use "Follow")
(use "Cycle")
(use "Game")
(use "User")
(use "PicView")
(use "Obj")
(script 51)


(local
    local0
    local1
    local2
    local3[10]
    local13[10] = (102 126 100 184 43 195 34 173 33 31 )
    local23[10] = (113 87 53 67 78 102 95 129 122 67 )
    local33[20] = (10 8 12 10 8 3 12 11 10 14 14 14 14 14 14 14 14 14 3 3 )

)
(procedure (localproc_1d4c)
    proc255_0(51 66)
)


(instance rockBlock of Blk
    (properties
        top 108
        left 34
        bottom 131
        right 105
    )
)
(instance public rm51 of Rm
    (properties
        picture 51
        east 52
        west 50
        picAngle 60
    )

    (method (init)
        (self:style(
            (switch (gGNumber)
                (case west
                    3
                )
                (case east
                    2
                )
            )
))
        proc958_0(132 37 66)
        (if (not proc0_12(82))
            proc958_0(128 22 146 145)
            proc958_0(132 64 63)
            (if ((send gEgo:has(10)))
                Load(rsSCRIPT 784)
                Load(rsVIEW 41)
            )
            (if (proc0_12(9) and (send gEgo:has(8)))
                proc958_0(128 50 148)
                Load(rsSOUND 63)
            )
            (if ((send gEgo:has(0)))
                proc958_0(128 51 147)
                proc958_0(132 65 18)
            )
        )
        (super:init())
        proc0_19(98 1)
        (switch (gGNumber)
            (case east
                (send gEgo:posn(315 140))
            )
            (case west
                (send gEgo:posn(13 130))
            )
            (default 
                (send gEgo:posn(13 130))
            )
        )
        (send gEgo:init())
        proc0_1()
        (if (not proc0_12(84))
            (mirror:
                setPri(2)
                init()
                stopUpd()
            )
            (if (>= global101 1)
                (mirror:setScript(flashMirror))
            )
        )
        (if (proc0_12(82))
            (send gAddToPics:
                add(rock)
                eachElementDo(#init)
                doit()
            )
            (send gEgo:observeBlocks(rockBlock))
            (if (not proc0_12(84))
                (mirror:posn(134 90))
            )
        )(else
            (dragBod:
                priority(1)
                signal(| (dragBod:signal) $4010)
                init()
            )
            (if (proc0_12(83))
                (dragHead:
                    view(147)
                    loop(2)
                    cel(1)
                    posn(102 145)
                    init()
                )
                (send gAddToPics:
                    add(dragHead dragKneck)
                    eachElementDo(#init)
                    doit()
                )
            )(else
                (dragHead:
                    init()
                    stopUpd()
                )
                (smoke:
                    init()
                    setCycle(Fwd)
                )
            )
            (rock:
                x(1)
                y(134)
                init()
            )
            (send gAddToPics:doit())
            (send gEgo:illegalBits(-16384))
        )
    )


    (method (doit)
        (var temp0)
        (if (script)
            (send script:doit())
        )(else
            = temp0 
                (switch ((send ((User:alterEgo)):edgeHit))
                    (case 1
                        north
                    )
                    (case 2
                        east
                    )
                    (case 3
                        south
                    )
                    (case 4
                        west
                    )
                )
            (if (temp0)
                (if (== (= temp0 
                    (switch ((send ((User:alterEgo)):edgeHit))
                        (case 1
                            north
                        )
                        (case 2
                            east
                        )
                        (case 3
                            south
                        )
                        (case 4
                            west
                        )
                    )
) west)
                    (send (ScriptID(0 23)):
                        loop(1)
                        fade()
                    )
                )
                (self:newRoom(temp0))
            )
        )
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )(else
            (if ((super:handleEvent(pEvent)))
                return 
            )(else
                (if (Said('cast,use/water,bucket'))
                    (if (proc0_12(1))
                        localproc_1d4c()
                    )(else
                        (if (not (send gEgo:has(8)))
                            proc0_6()
                        )(else
                            (if (not proc0_12(9))
                                proc255_0(51 0)
                            )(else
                                (if (proc0_12(83))
                                    proc255_0(51 1)
                                )(else
                                    (if (proc0_12(82))
                                        proc255_0(51 2)
                                    )(else
                                        (if ((send global2:script))
                                            proc0_22()
                                        )(else
                                            (if (< (send gEgo:x) 130)
                                                proc255_0(51 3)
                                            )(else
                                                (send global2:setScript(throwWater))
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )(else
                    (if (Said('look,look/boulder,boulder') or proc255_5(rock pEvent 3))
                        proc255_0(51 4)
                    )(else
                        (if (Said('look,look>'))
                            (if (Said('[<at,around][/room,cave]'))
                                (if (proc0_12(83) and proc0_12(84))
                                    proc255_0(51 5)
                                )(else
                                    (if (proc0_12(83))
                                        proc255_0(51 6)
                                    )(else
                                        (if (proc0_12(82) and proc0_12(84))
                                            proc255_0(51 7)
                                        )(else
                                            (if (proc0_12(82))
                                                proc255_0(51 8)
                                            )(else
                                                (if (proc0_12(84))
                                                    proc255_0(51 9)
                                                )(else
                                                    proc255_0(51 10)
                                                )
                                            )
                                        )
                                    )
                                )
                            )(else
                                (if (Said('/stalactite,stalactite'))
                                    proc255_0(51 11)
                                )(else
                                    (if (Said('/doorway'))
                                        (if ((< (send gEgo:x) 160) and (== (send gEgo:loop) 1))
                                            proc255_0(51 12)
                                        )(else
                                            (if ((>= (send gEgo:x) 160) and (== (send gEgo:loop) 0))
                                                proc255_0(51 13)
                                            )(else
                                                proc255_0(51 14)
                                            )
                                        )
                                    )(else
                                        (if (Said('/dragon'))
                                            (if (proc0_12(83))
                                                proc255_0(51 15)
                                            )(else
                                                proc255_0(51 16)
                                            )
                                        )(else
                                            (if (Said('/tongue'))
                                                (if (proc0_12(83))
                                                    proc255_0(51 17)
                                                )(else
                                                    (if (proc0_12(82))
                                                        proc255_0(51 18)
                                                    )(else
                                                        proc255_0(51 19)
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )(else
                            (if (Said('get,get/mirror'))
                                (if (proc0_12(84))
                                    proc255_0(51 20)
                                )(else
                                    (if ((send global2:script))
                                        proc0_22()
                                    )(else
                                        (if (not (send gEgo:inRect((- (mirror:x) 12) (- (mirror:y) 1) (+ (mirror:x) 12) (+ (mirror:y) 15))))
                                            proc0_4()
                                        )(else
                                            (send (ScriptID(0 21)):
                                                number(66)
                                                init()
                                                play()
                                            )
                                            proc255_0(51 21)
                                            (send gEgo:get(14))
                                            proc0_19(84 8)
                                            (mirror:dispose())
                                        )
                                    )
                                )
                            )(else
                                (if (Said('get,get/tongue'))
                                    (if (proc0_12(83))
                                        proc255_0(51 22)
                                    )(else
                                        (if (proc0_12(82))
                                            proc255_0(51 23)
                                        )(else
                                            proc255_0(51 19)
                                        )
                                    )
                                )(else
                                    (if (Said('move,move/boulder,boulder'))
                                        proc255_0(51 24)
                                    )(else
                                        (if (Said('/ring>'))
                                            (if (Said('remove') or Said('get<off'))
                                                (if (== (send gEgo:view) 
                                                (if (proc0_12(0))
                                                    23
                                                )(else
                                                    16
                                                )
)
                                                    proc0_22()
                                                )(else
                                                    (if (not proc0_12(17))
                                                        proc255_0(51 25)
                                                    )(else
                                                        proc255_0(51 26)
                                                        (if ((== gNumber 51) and (< (send gEgo:x) 130))
                                                            proc255_0(51 27)
                                                        )
                                                        (if ((send gCast:contains(gGoat)) and (send gEgo:has(2)))
                                                            (send gGoat:setMotion(Follow gEgo 60))
                                                            proc0_10(2)
                                                        )
                                                        proc0_11(17)
                                                        proc0_11(1)
                                                        (if (== (send gEgo:illegalBits) -16384)
                                                            proc0_1()
                                                            (send gEgo:illegalBits(-16384))
                                                        )(else
                                                            proc0_1()
                                                        )
                                                        (send pEvent:claimed(1))
                                                    )
                                                )
                                            )(else
                                                (if (Said('rub'))
                                                    (if (proc0_12(1))
                                                        proc255_0(51 28)
                                                    )(else
                                                        (if (not global134)
                                                            proc255_0(51 29)
                                                        )(else
                                                            (if (proc0_12(17))
                                                                proc255_0(51 30)
                                                                proc0_10(1)
                                                                (if (== (send gEgo:illegalBits) -16384)
                                                                    proc0_1()
                                                                    (send gEgo:illegalBits(-16384))
                                                                )(else
                                                                    proc0_1()
                                                                )
                                                            )(else
                                                                proc255_0(51 31)
                                                                (send pEvent:claimed(1))
                                                            )
                                                        )
                                                    )
                                                )
                                            )
                                        )(else
                                            (if (Said('give/[/dragon]'))
                                                (if (proc0_12(82))
                                                    proc255_0(51 32)
                                                )(else
                                                    (if (proc0_12(83))
                                                        proc255_0(51 33)
                                                    )(else
                                                        (if ((send gEgo:has(14)))
                                                            proc255_0(51 34)
                                                        )(else
                                                            proc255_0(51 35)
                                                        )
                                                    )
                                                )
                                            )(else
                                                (if (((== (send pEvent:type) 1) and (& (send pEvent:modifiers) $0003)) and (== OnControl(2 (send pEvent:x) (send pEvent:y)) -32768))
                                                    (if (> (send pEvent:y) 115)
                                                        proc255_0(51 36)
                                                    )(else
                                                        proc255_0(51 37)
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
    )

)
(instance smoke of Prop
    (properties
        x 126
        y 135
        view 146
        loop 1
        cycleSpeed 1
    )

    (method (doVerb theVerb)
        (switch (theVerb)
            (case 1
                proc255_0(51 38)
            )
        )
    )

)
(instance fireHead of Prop
    (properties
        view 145
        loop 1
        cycleSpeed 1
    )

    (method (doVerb theVerb)
        (switch (theVerb)
            (case 1
                proc255_0(51 39)
            )
        )
    )

)
(instance dragBod of PicView
    (properties
        x 117
        y 126
        description 7790
        view 251
        loop 3
    )

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


    (method (doVerb theVerb)
        (switch (theVerb)
            (case 1
                proc255_0(51 40)
            )
        )
    )

)
(instance dragTail of Actor
    (properties
        x 51
        y 131
        description 7790
        yStep 1
        view 146
        signal $5801
        illegalBits $0000
        xStep 6
        moveSpeed 1
    )
)
(instance fireBall of Actor
    (properties
        description 7814
        yStep 6
        view 146
        xStep 8
    )
)
(instance projectile of Actor
    (properties
        description 7833
        yStep 8
        view 51
        loop 2
        xStep 10
    )
)
(instance puff of Prop
    (properties
        description 7851
        view 251
        loop 1
    )
)
(instance rock of PicView
    (properties
        x 69
        y 127
        view 251
    )

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


    (method (handleEvent)
    )

)
(instance mirror of Prop
    (properties
        x 149
        y 104
        view 251
        loop 2
    )

    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )(else
            (if (Said('look,look<in/mirror'))
                (if (< (send gEgo:distanceTo(self)) 10)
                    proc0_15(gEgo mirror)
                    (send pEvent:claimed(0))
                )(else
                    proc255_0(51 41)
                )
            )(else
                (if (Said('look,look/mirror') or proc255_5(self pEvent 3))
                    proc255_0(51 42)
                    (send pEvent:claimed(1))
                )(else
                    (if ((super:handleEvent(pEvent)))
                        return 
                    )
                )
            )
        )
    )

)
(instance dragKneck of View
    (properties)

    (method (doVerb theVerb)
        (switch (theVerb)
            (case 1
                proc255_0(51 43)
            )
        )
    )

)
(instance dragHead of Prop
    (properties
        x 41
        y 90
        description 7884
        view 145
        signal $0001
        cycleSpeed 1
    )

    (method (doit param1)
        (super:doit(rest param1))
        (if (((script or proc0_12(83)) or proc0_12(82)) or (== (send global2:script) daggerDrag))
            0
        )(else
            (if (((> (send gEgo:x) 266) and (== (dragHead:cel) (- NumCels(dragHead) 1))) and not proc0_12(1))
                (self:setScript(lowerHead))
            )(else
                (if (((< (send gEgo:x) 266) and (<= (dragHead:cel) 1)) and not proc0_12(1))
                    (if (not local1)
                        = local1 1
                        (smoke:hide())
                    )
                    (self:setScript(raiseHead))
                )(else
                    (if ((((< 130 (send gEgo:x)) and (< (send gEgo:x) 208)) and not proc0_12(1)) and not local0)
                        (if (<> (send global2:script) daggerDrag)
                            (self:setScript(flameEgo))
                        )
                    )(else
                        (if (local0 and (> (send gEgo:x) 208))
                            = local0 0
                        )(else
                            (if (not global124)
                                = local0 0
                            )
                        )
                    )
                )
            )
        )
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )(else
            (if ((((Said('look,look/dragon') or Said('look,look/head[<dragon]')) or Said('look,look/body[<dragon]')) or proc255_5(self pEvent 3)) or proc255_5(dragBod pEvent 3))
                (if (proc0_12(83))
                    proc255_0(51 44)
                )(else
                    (if (proc0_12(82) and proc0_12(84))
                        proc255_0(51 7)
                    )(else
                        (if (proc0_12(82))
                            proc255_0(51 8)
                        )(else
                            (if (proc0_12(84))
                                (if (<= (dragHead:cel) 1)
                                    proc255_0(51 45)
                                )(else
                                    proc255_0(51 46)
                                )
                            )(else
                                proc255_0(51 40)
                                proc255_0(51 10)
                            )
                        )
                    )
                )
                (send pEvent:claimed(1))
            )(else
                (if (Said('play/fiddle'))
                    (if ((send gEgo:has(17)))
                        proc255_0(51 47)
                    )(else
                        (send pEvent:claimed(0))
                    )
                )(else
                    (if (Said('cast,use/dagger') or Said('kill,stab/dragon'))
                        (if (proc0_12(1))
                            localproc_1d4c()
                        )(else
                            (if (proc0_12(83))
                                proc255_0(51 48)
                            )(else
                                (if (not (send gEgo:has(0)))
                                    proc255_0(51 49)
                                )(else
                                    (if ((send global2:script))
                                        proc0_22()
                                    )(else
                                        (if (not (dragHead:script))
                                            (if (< (send gEgo:x) 130)
                                                proc255_0(51 3)
                                            )(else
                                                (send global2:setScript(daggerDrag))
                                            )
                                        )(else
                                            proc255_0(51 50)
                                            (send gEgo:setMotion(0))
                                            (send global2:setScript(0))
                                        )
                                    )
                                )
                            )
                        )
                    )(else
                        (if (Said('shoot/dragon'))
                            (if (not (send gEgo:has(10)) or not (send gEgo:has(9)))
                                proc255_0(51 51)
                            )(else
                                (if ((send global2:script))
                                    proc0_22()
                                )(else
                                    (if (proc0_12(1))
                                        localproc_1d4c()
                                    )(else
                                        (if (proc0_12(83))
                                            proc255_0(51 52)
                                        )(else
                                            proc255_0(51 53)
                                        )
                                    )
                                )
                            )
                        )(else
                            (if ((Said('talk,speak[/dragon]') or Said('/hello')) or Said('hello,say'))
                                (if (proc0_12(83))
                                    proc255_0(51 54)
                                )(else
                                    proc255_0(51 55)
                                )
                            )(else
                                (if (Said('get,get/dagger'))
                                    (if (proc0_12(83))
                                        proc255_0(51 56)
                                    )(else
                                        proc255_0(51 57)
                                    )
                                )(else
                                    (if (Said('/dragon'))
                                        (if (proc0_12(83))
                                            proc255_0(51 58)
                                        )(else
                                            proc255_0(51 59)
                                        )
                                    )(else
                                        (super:handleEvent(pEvent))
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
    )

)
(instance flameEgo of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (smoke:
                    hide()
                    stopUpd()
                )
                (send gEgo:stopUpd())
                (dragHead:stopUpd())
                (if (== (dragHead:cel) (- NumCels(dragHead) 1))
                    (fireHead:posn(97 111))
                )(else
                    (fireHead:posn(104 149))
                )
                (fireHead:
                    init()
                    ignoreActors()
                    cycleSpeed(2)
                    cel(0)
                    setPri(12)
                    setCycle(End self)
                )
                (mirror:
                    cel(0)
                    setScript(0)
                    stopUpd()
                )
            )
            (case 1
                (fireHead:dispose())
                (fireBall:
                    init()
                    setLoop(
                        (if (< (send gEgo:y) 142)
                            3
                        )(else
                            2
                        )
)
                    ignoreActors()
                    ignoreHorizon()
                    setPri(4)
                    illegalBits(0)
                    setCycle(Fwd)
                )
                (if (== (dragHead:cel) (- NumCels(dragHead) 1))
                    (fireBall:posn(126 102))
                )(else
                    (fireBall:posn(136 144))
                )
                (fireBall:setMotion(MoveTo (- (send gEgo:x) 12) (- (send gEgo:y) 20) self))
            )
            (case 2
                (if (not global124)
                    (send (ScriptID(0 21)):
                        number(37)
                        init()
                        play()
                    )
                    (send gEgo:
                        setLoop(2)
                        cel(0)
                        view(22)
                        cycleSpeed(1)
                        setCycle(Fwd)
                    )
                    (fireBall:dispose())
                    = cycles 22
                )(else
                    (fireBall:dispose())
                    (self:changeState(6))
                )
            )
            (case 3
                (send gEgo:
                    setLoop(0)
                    cel(0)
                    cycleSpeed(2)
                    setCycle(End self)
                )
            )
            (case 4
                (send gEgo:
                    setLoop(1)
                    cel(0)
                    setCycle(Fwd)
                )
                = seconds 6
            )
            (case 5
                (if ((send gEgo:has(16)))
                    proc0_16("Your shield melted from the intensity of the dragon's flames!  Looks like the dragon made an ash out of you.")
                )(else
                    proc0_16("By venturing too close to the dragon's flame, you made an ash out of yourself.")
                )
                (self:changeState(7))
            )
            (case 6
                proc255_0(51 60)
                = local0 1
                proc0_3()
                (self:cue())
            )
            (case 7
                (self:dispose())
            )
        )
    )

)
(instance raiseHead of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (dragHead:setCycle(End self))
                (smoke:
                    hide()
                    stopUpd()
                )
            )
            (case 1
                (dragHead:stopUpd())
                (smoke:
                    posn(119 98)
                    show()
                    startUpd()
                )
                (self:dispose())
            )
        )
    )

)
(instance lowerHead of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (dragHead:setCycle(CT 1 -1 self))
                (smoke:
                    hide()
                    stopUpd()
                )
            )
            (case 1
                (dragHead:stopUpd())
                (smoke:
                    posn(126 135)
                    show()
                    startUpd()
                )
                (self:dispose())
            )
        )
    )

)
(instance daggerDrag of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gEgo:put(0))
                (if (<= (dragHead:cel) 1)
                    (dragHead:setCycle(End self))
                    (smoke:
                        hide()
                        stopUpd()
                    )
                )(else
                    = cycles 1
                )
            )
            (case 1
                (dragHead:stopUpd())
                (send gEgo:
                    view(51)
                    cel(0)
                    loop(
                        (if (< (send gEgo:x) 130)
                            0
                        )(else
                            1
                        )
)
                    setCycle(CT 6 1 self)
                )
            )
            (case 2
                (send (ScriptID(0 21)):
                    number(65)
                    loop(1)
                    init()
                    play()
                )
                (send gEgo:setCycle(End))
                (projectile:
                    init()
                    setLoop(2)
                    cel(2)
                    setCycle(Fwd)
                    illegalBits(0)
                    ignoreActors()
                )
                (if ((send gEgo:loop))
                    (projectile:
                        posn(- (send gEgo:x) 19 - (send gEgo:y) 41)
                        setMotion(MoveTo + (dragHead:x) 40 + (dragHead:y) 23 self)
                    )
                )(else
                    (projectile:
                        posn(+ (send gEgo:x) 20 - (send gEgo:y) 36)
                        setMotion(MoveTo 330 118 self)
                    )
                )
            )
            (case 3
                (send gEgo:stopUpd())
                (projectile:dispose())
                (if ((send gEgo:loop))
                    proc0_19(83 3)
                    (smoke:hide())
                    (send (ScriptID(0 21)):
                        number(18)
                        loop(1)
                        play()
                    )
                    (dragHead:
                        view(147)
                        cel(0)
                        loop(0)
                        cycleSpeed(
                            (if (>= global101 1)
                                2
                            )(else
                                0
                            )
)
                        setCycle(ForwardCounter 2 self)
                    )
                )(else
                    proc255_0(51 61)
                    = local1 1
                    (smoke:hide())
                    proc0_1()
                    (send gEgo:illegalBits(-16384))
                    proc0_3()
                    (self:dispose())
                )
            )
            (case 4
                (dragHead:setCycle(Beg))
                = cycles 4
            )
            (case 5
                (send (ScriptID(0 21)):
                    number(59)
                    init()
                    play()
                )
                (dragHead:
                    loop(2)
                    cel(1)
                    posn(102 145)
                )
                (dragKneck:
                    init()
                    stopUpd()
                )
                (smoke:
                    view(147)
                    loop(1)
                    setCel(0)
                    posn(41 90)
                    show()
                )
                = cycles 3
            )
            (case 6
                (dragHead:posn(102 144))
                (smoke:cel(1))
                = cycles 3
            )
            (case 7
                (dragHead:posn(102 145))
                (smoke:
                    cycleSpeed(3)
                    setCycle(End)
                )
                = cycles 3
            )
            (case 8
                ShakeScreen(3 1)
                = cycles 1
            )
            (case 9
                (dragHead:stopUpd())
                (smoke:
                    hide()
                    stopUpd()
                )
                = cycles 2
            )
            (case 10
                proc0_3()
                proc255_0(51 62)
                proc0_1()
                (send gEgo:illegalBits(-16384))
                (self:dispose())
            )
        )
    )

)
(instance throwWater of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                proc0_19(82 5)
                proc0_20(0)
                (send gEgo:stopUpd())
                (if (<= (dragHead:cel) 1)
                    (dragHead:setCycle(End))
                    (smoke:
                        hide()
                        stopUpd()
                    )
                )
                (mirror:
                    cel(0)
                    setScript(0)
                    stopUpd()
                )
                (send gEgo:
                    view(50)
                    cel(0)
                    loop(0)
                    setMotion(0)
                    setCycle(End)
                )
                = cycles 4
            )
            (case 1
                (projectile:
                    init()
                    view(50)
                    setLoop(2)
                    setCel(0)
                    setCycle(0)
                    illegalBits(0)
                    setPri((send gEgo:priority))
                    ignoreActors()
                    xStep(
                        (if (>= global101 1)
                            10
                        )(else
                            15
                        )
)
                    posn(- (send gEgo:x) 30 - (send gEgo:y) 25)
                    setMotion(MoveTo 108 103 self)
                )
            )
            (case 2
                (send gEgo:stopUpd())
                (projectile:dispose())
                (smoke:dispose())
                (send (ScriptID(0 21)):
                    number(63)
                    init()
                    play()
                )
                (dragHead:
                    view(148)
                    loop(0)
                    cel(0)
                    setCycle(Fwd)
                )
                = cycles 6
            )
            (case 3
                proc255_0(51 63)
                (self:cue())
            )
            (case 4
                (send (= local3[local2] Clone(puff)):
                    init()
                    setPri(local33[local2])
                    x(local13[local2])
                    y(local23[local2])
                )
                (if (global101)
                    (send local3[local2]:setCycle(End self))
                )(else
                    (send local3[local2]:setCel((puff:lastCel())))
                    = cycles 1
                )
            )
            (case 5
                = cycles (+ 1 (* global101 5))
            )
            (case 6
                (send local3[local2]:addToPic())
                (switch (local2)
                    (case 9
                        (mirror:posn(134 90))
                        = cycles 10
                    )
                    (case 2
                        (dragHead:stopUpd())
                        ++local2
                        (self:changeState(4))
                    )
                    (default 
                        ++local2
                        (self:changeState(4))
                    )
                )
            )
            (case 7
                (send global2:drawPic(51 8))
                (rock:
                    x(69)
                    y(127)
                    init()
                )
                (send gAddToPics:doit())
                (send gEgo:observeBlocks(rockBlock))
                (dragHead:dispose())
                (send (ScriptID(0 23)):
                    loop(1)
                    fade()
                )
                (dragTail:
                    init()
                    setMotion(MoveTo -45 131 self)
                )
            )
            (case 8
                (if (not (send gEgo:has(14)))
                    proc255_0(51 64)
                )(else
                    proc255_0(51 65)
                )
                proc0_1()
                (send gEgo:
                    observeBlocks(rockBlock)
                    loop(1)
                )
                (if (not (send gEgo:has(14)) and (>= global101 1))
                    (mirror:setScript(flashMirror))
                )
                (dragTail:dispose())
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance flashMirror of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (mirror:setCycle(End self))
            )
            (case 1
                (mirror:stopUpd())
                = cycles Random(40 60)
            )
            (case 2
                (self:changeState(0))
            )
        )
    )

)
