(version 2)
(include "sci.sh")
(exports
    0 rm560
)
(use "Main")
(use "FPRoom")
(use "Scaler")
(use "n958")
(use "Cycle")
(use "View")
(use "Obj")
(script 560)


(local
    theCel
    local1

)
(instance public rm560 of FPRoom
    (properties
        picture 560
    )

    (method (init)
        (send gEgo:
            wearingGuns(1)
            get(-1 44)
        )
        = global120 4
        proc958_0(132 2124)
        proc958_0(128 560)
        (super:init())
        (hand1:
            init()
            stopUpd()
        )
        (hand2:
            init()
            stopUpd()
        )
        (gun1:
            init()
            stopUpd()
        )
        (gun2:
            init()
            stopUpd()
        )
        (send gGameMusic1:
            number(565)
            flags(1)
            loop(-1)
            play()
        )
        (kenny:
            posn(151 141)
            setCycle(Walk)
            cycleSpeed(5)
            moveSpeed(10)
            setLoop(1)
            setScale(Scaler 100 0 148 137)
            yStep(1)
            init()
        )
        (self:setScript(sKennyTheKid))
    )


    (method (doit)
        (super:doit())
        (if (local1)
            (send gGame:setCursor(10 1 160 180))
        )
    )


    (method (dispose)
        (super:dispose())
    )


    (method (handleEvent pEvent)
        (send pEvent:claimed(1))
    )

)
(instance sKennyTheKid of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = cycles 10
            )
            (case 1
                (send gIconBar:enable(5))
                (send gIconBar:
                    curIcon((send gIconBar:useIconItem))
                    curInvIcon((send ((send gInv:at(44))):
                            cursor(10)
                            yourself()
                        )
)
                    enable((send gIconBar:at(5)))
                )
                (send ((send gIconBar:curIcon)):cursor(10))
                (send gIconBar:select((send gIconBar:at(5))))
                (kenny:setMotion(MoveTo 151 149 self))
            )
            (case 2
                (kenny:
                    view(560)
                    loop(2)
                    cel(0)
                    cycleSpeed(10)
                    scaleSignal(0)
                    stopUpd()
                )
                = cycles 5
            )
            (case 3
                (send gFpMessager:say(13 0 0 0 self))
            )
            (case 4
                (send gGame:
                    handsOn()
                    setCursor(996 1)
                )
                (send gIconBar:disable(0 1 2 3 4 6 7))
                = local1 1
                = seconds Random(2 5)
            )
            (case 5
                = local1 0
                (kenny:setCycle(CT 6 1 self))
            )
            (case 6
                (gunShot:play())
                (kenny:setCycle(End self))
            )
            (case 7
                (send gIconBar:enable())
                (send global2:newRoom(565))
                (self:dispose())
            )
        )
    )

)
(instance sTooSoon of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (gunShot:play())
                = cycles 5
                (hand2:dispose())
                (gun2:dispose())
            )
            (case 1
                (send gFpMessager:say(16 0 0 0 self))
            )
            (case 2
                (hand2:init())
                (gun2:init())
                (self:dispose())
            )
        )
    )

)
(instance hand1 of Prop
    (properties
        x 38
        y 26
        view 560
    )

    (method (handleEvent pEvent)
        (send pEvent:claimed(1))
    )

)
(instance hand2 of Prop
    (properties
        x 278
        y 26
        view 560
        cel 1
    )

    (method (handleEvent pEvent)
        (send pEvent:claimed(1))
    )

)
(instance gun1 of Prop
    (properties
        x 61
        y 66
        view 560
        loop 3
    )

    (method (handleEvent pEvent)
        (send pEvent:claimed(1))
    )

)
(instance gun2 of Prop
    (properties
        x 246
        y 68
        view 560
        loop 3
        cel 1
    )

    (method (handleEvent pEvent)
        (send pEvent:claimed(1))
    )

)
(instance kenny of Actor
    (properties
        view 560
    )

    (method (doVerb theVerb param2)
        = theCel cel
        (switch (theVerb)
            (case 47
                (if (mover)
                    (self:setScript(sTooSoon))
                )(else
                    (if (== loop 2)
                        (if (<= theCel 6)
                            proc0_3(60)
                            (hand2:dispose())
                            (gun2:dispose())
                            (gunShot:play())
                        )
                    )(else
                        (send gFpMessager:say(15))
                    )
                )
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )

)
(instance gunShot of FPSound
    (properties
        flags $0001
        number 2124
    )
)
